本文整理汇总了PHP中groups_print_activity_menu函数的典型用法代码示例。如果您正苦于以下问题:PHP groups_print_activity_menu函数的具体用法?PHP groups_print_activity_menu怎么用?PHP groups_print_activity_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了groups_print_activity_menu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Displays the full report
*
* @param \stdClass $scorm full SCORM object
* @param \stdClass $cm - full course_module object
* @param \stdClass $course - full course object
* @param string $download - type of download being requested
*/
public function display($scorm, $cm, $course, $download)
{
global $DB, $OUTPUT, $PAGE;
if ($groupmode = groups_get_activity_groupmode($cm)) {
// Groups are being used.
groups_print_activity_menu($cm, new \moodle_url($PAGE->url));
}
if ($scoes = $DB->get_records('scorm_scoes', array("scorm" => $scorm->id), 'sortorder, id')) {
foreach ($scoes as $sco) {
if ($sco->launch != '') {
$imageurl = new \moodle_url('/mod/scorm/report/graphs/graph.php', array('scoid' => $sco->id));
$graphname = $sco->title;
echo $OUTPUT->heading($graphname, 3);
echo \html_writer::tag('div', \html_writer::empty_tag('img', array('src' => $imageurl, 'alt' => $graphname)), array('class' => 'graph'));
}
}
}
}
示例2: groups_print_activity_menu
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
/// Print the links to get responses and analysis
////////////////////////////////////////////////////////
if ($do_show == 'showentries') {
//print the link to analysis
if (has_capability('mod/feedback:viewreports', $context)) {
//get the effective groupmode of this course and module
if (isset($cm->groupmode) && empty($course->groupmodeforce)) {
$groupmode = $cm->groupmode;
} else {
$groupmode = $course->groupmode;
}
// $groupselect = groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/feedback/show_entries.php?id=' . $cm->id.'&do_show=showentries', true);
$groupselect = groups_print_activity_menu($cm, $url->out(), true);
$mygroupid = groups_get_activity_group($cm);
// preparing the table for output
$baseurl = new moodle_url('/mod/feedback/show_entries.php');
$baseurl->params(array('id' => $id, 'do_show' => $do_show, 'showall' => $showall));
$tablecolumns = array('userpic', 'fullname', 'c.timemodified');
$tableheaders = array(get_string('userpic'), get_string('fullnameuser'), get_string('date'));
if (has_capability('mod/feedback:deletesubmissions', $context)) {
$tablecolumns[] = 'deleteentry';
$tableheaders[] = '';
}
$table = new flexible_table('feedback-showentry-list-' . $course->id);
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($baseurl);
$table->sortable(true, 'lastname', SORT_DESC);
示例3: add_to_log
if ($field) {
$field->update_content($recordid, $value, $name);
}
}
}
add_to_log($course->id, 'data', 'add', "view.php?d={$data->id}&rid={$recordid}", $data->id, $cm->id);
if (!empty($datarecord->saveandview)) {
redirect($CFG->wwwroot . '/mod/data/view.php?d=' . $data->id . '&rid=' . $recordid);
}
}
}
}
// End of form processing
/// Print the page header
echo $OUTPUT->header();
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/data/edit.php?d=' . $data->id);
echo $OUTPUT->heading(format_string($data->name));
/// Print the tabs
$currenttab = 'add';
if ($rid) {
$editentry = true;
//used in tabs
}
include 'tabs.php';
/// Print the browsing interface
$patterns = array();
//tags to replace
$replacement = array();
//html to replace those yucky tags
//form goes here first in case add template is empty
echo '<form enctype="multipart/form-data" action="edit.php" method="post">';
示例4: format_string
// Note: MDL-19010 there will be further changes to printing header and blocks.
// The code will be much nicer than this eventually.
$title = $courseshortname . ': ' . format_string($data->name);
if ($PAGE->user_allowed_editing()) {
$buttons = '<table><tr><td><form method="get" action="view.php"><div>' . '<input type="hidden" name="id" value="' . $cm->id . '" />' . '<input type="hidden" name="edit" value="' . ($PAGE->user_is_editing() ? 'off' : 'on') . '" />' . '<input type="submit" value="' . get_string($PAGE->user_is_editing() ? 'blockseditoff' : 'blocksediton') . '" /></div></form></td></tr></table>';
$PAGE->set_button($buttons);
}
if ($mode == 'asearch') {
$PAGE->navbar->add(get_string('search'));
}
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
/// Check to see if groups are being used here
$returnurl = $CFG->wwwroot . '/mod/data/view.php?d=' . $data->id . '&search=' . s($search) . '&sort=' . s($sort) . '&order=' . s($order) . '&';
groups_print_activity_menu($cm, $returnurl);
$currentgroup = groups_get_activity_group($cm);
$groupmode = groups_get_activity_groupmode($cm);
// detect entries not approved yet and show hint instead of not found error
if ($record and $data->approval and !$record->approved and $record->userid != $USER->id and !has_capability('mod/data:manageentries', $context)) {
if (!$currentgroup or $record->groupid == $currentgroup or $record->groupid == 0) {
print_error('notapproved', 'data');
}
}
echo $OUTPUT->heading(format_string($data->name));
// Do we need to show a link to the RSS feed for the records?
//this links has been Settings (database activity administration) block
/*if (!empty($CFG->enablerssfeeds) && !empty($CFG->data_enablerssfeeds) && $data->rssarticles > 0) {
echo '<div style="float:right;">';
rss_print_link($context->id, $USER->id, 'mod_data', $data->id, get_string('rsstype'));
echo '</div>';
示例5: view_grading_table
/**
* View the grading table of all submissions for this assignment.
*
* @return string
*/
protected function view_grading_table()
{
global $USER, $CFG;
// Include grading options form.
require_once $CFG->dirroot . '/mod/assign/gradingoptionsform.php';
require_once $CFG->dirroot . '/mod/assign/quickgradingform.php';
require_once $CFG->dirroot . '/mod/assign/gradingbatchoperationsform.php';
$o = '';
$cmid = $this->get_course_module()->id;
$links = array();
if (has_capability('gradereport/grader:view', $this->get_course_context()) && has_capability('moodle/grade:viewall', $this->get_course_context())) {
$gradebookurl = '/grade/report/grader/index.php?id=' . $this->get_course()->id;
$links[$gradebookurl] = get_string('viewgradebook', 'assign');
}
if ($this->is_any_submission_plugin_enabled() && $this->count_submissions()) {
$downloadurl = '/mod/assign/view.php?id=' . $cmid . '&action=downloadall';
$links[$downloadurl] = get_string('downloadall', 'assign');
}
if ($this->is_blind_marking() && has_capability('mod/assign:revealidentities', $this->get_context())) {
$revealidentitiesurl = '/mod/assign/view.php?id=' . $cmid . '&action=revealidentities';
$links[$revealidentitiesurl] = get_string('revealidentities', 'assign');
}
foreach ($this->get_feedback_plugins() as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
foreach ($plugin->get_grading_actions() as $action => $description) {
$url = '/mod/assign/view.php' . '?id=' . $cmid . '&plugin=' . $plugin->get_type() . '&pluginsubtype=assignfeedback' . '&action=viewpluginpage&pluginaction=' . $action;
$links[$url] = $description;
}
}
}
// Sort links alphabetically based on the link description.
core_collator::asort($links);
$gradingactions = new url_select($links);
$gradingactions->set_label(get_string('choosegradingaction', 'assign'));
$gradingmanager = get_grading_manager($this->get_context(), 'mod_assign', 'submissions');
$perpage = get_user_preferences('assign_perpage', 10);
$filter = get_user_preferences('assign_filter', '');
$markerfilter = get_user_preferences('assign_markerfilter', '');
$workflowfilter = get_user_preferences('assign_workflowfilter', '');
$controller = $gradingmanager->get_active_controller();
$showquickgrading = empty($controller);
$quickgrading = get_user_preferences('assign_quickgrading', false);
$showonlyactiveenrolopt = has_capability('moodle/course:viewsuspendedusers', $this->context);
$markingallocation = $this->get_instance()->markingallocation && has_capability('mod/assign:manageallocations', $this->context);
// Get markers to use in drop lists.
$markingallocationoptions = array();
if ($markingallocation) {
$markers = get_users_by_capability($this->context, 'mod/assign:grade');
$markingallocationoptions[''] = get_string('filternone', 'assign');
foreach ($markers as $marker) {
$markingallocationoptions[$marker->id] = fullname($marker);
}
}
$markingworkflow = $this->get_instance()->markingworkflow;
// Get marking states to show in form.
$markingworkflowoptions = array();
if ($markingworkflow) {
$notmarked = get_string('markingworkflowstatenotmarked', 'assign');
$markingworkflowoptions[''] = get_string('filternone', 'assign');
$markingworkflowoptions[ASSIGN_MARKING_WORKFLOW_STATE_NOTMARKED] = $notmarked;
$markingworkflowoptions = array_merge($markingworkflowoptions, $this->get_marking_workflow_states_for_current_user());
}
// Print options for changing the filter and changing the number of results per page.
$gradingoptionsformparams = array('cm' => $cmid, 'contextid' => $this->context->id, 'userid' => $USER->id, 'submissionsenabled' => $this->is_any_submission_plugin_enabled(), 'showquickgrading' => $showquickgrading, 'quickgrading' => $quickgrading, 'markingworkflowopt' => $markingworkflowoptions, 'markingallocationopt' => $markingallocationoptions, 'showonlyactiveenrolopt' => $showonlyactiveenrolopt, 'showonlyactiveenrol' => $this->show_only_active_users());
$classoptions = array('class' => 'gradingoptionsform');
$gradingoptionsform = new mod_assign_grading_options_form(null, $gradingoptionsformparams, 'post', '', $classoptions);
$batchformparams = array('cm' => $cmid, 'submissiondrafts' => $this->get_instance()->submissiondrafts, 'duedate' => $this->get_instance()->duedate, 'attemptreopenmethod' => $this->get_instance()->attemptreopenmethod, 'feedbackplugins' => $this->get_feedback_plugins(), 'context' => $this->get_context(), 'markingworkflow' => $markingworkflow, 'markingallocation' => $markingallocation);
$classoptions = array('class' => 'gradingbatchoperationsform');
$gradingbatchoperationsform = new mod_assign_grading_batch_operations_form(null, $batchformparams, 'post', '', $classoptions);
$gradingoptionsdata = new stdClass();
$gradingoptionsdata->perpage = $perpage;
$gradingoptionsdata->filter = $filter;
$gradingoptionsdata->markerfilter = $markerfilter;
$gradingoptionsdata->workflowfilter = $workflowfilter;
$gradingoptionsform->set_data($gradingoptionsdata);
$actionformtext = $this->get_renderer()->render($gradingactions);
$header = new assign_header($this->get_instance(), $this->get_context(), false, $this->get_course_module()->id, get_string('grading', 'assign'), $actionformtext);
$o .= $this->get_renderer()->render($header);
$currenturl = $CFG->wwwroot . '/mod/assign/view.php?id=' . $this->get_course_module()->id . '&action=grading';
$o .= groups_print_activity_menu($this->get_course_module(), $currenturl, true);
// Plagiarism update status apearring in the grading book.
if (!empty($CFG->enableplagiarism)) {
require_once $CFG->libdir . '/plagiarismlib.php';
$o .= plagiarism_update_status($this->get_course(), $this->get_course_module());
}
// Load and print the table of submissions.
if ($showquickgrading && $quickgrading) {
$gradingtable = new assign_grading_table($this, $perpage, $filter, 0, true);
$table = $this->get_renderer()->render($gradingtable);
$quickformparams = array('cm' => $this->get_course_module()->id, 'gradingtable' => $table);
$quickgradingform = new mod_assign_quick_grading_form(null, $quickformparams);
$o .= $this->get_renderer()->render(new assign_form('quickgradingform', $quickgradingform));
} else {
$gradingtable = new assign_grading_table($this, $perpage, $filter, 0, false);
$o .= $this->get_renderer()->render($gradingtable);
//.........这里部分代码省略.........
示例6: require
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// print the tabs
require('tabs.php');
$previewimg = $OUTPUT->pix_icon('t/preview', get_string('preview'));
$previewlnk = '<a href="'.$CFG->wwwroot.'/mod/feedback/print.php?id='.$id.'">'.$previewimg.'</a>';
echo $OUTPUT->heading(format_text($feedback->name.' '.$previewlnk));
//show some infos to the feedback
if (has_capability('mod/feedback:edititems', $context)) {
//get the groupid
$groupselect = groups_print_activity_menu($cm, $CFG->wwwroot.'/mod/feedback/view.php?id='.$cm->id, true);
$mygroupid = groups_get_activity_group($cm);
echo $OUTPUT->box_start('boxaligncenter boxwidthwide');
echo $groupselect.'<div class="clearer"> </div>';
$completedscount = feedback_get_completeds_group_count($feedback, $mygroupid);
echo $OUTPUT->box_start('feedback_info');
echo '<span class="feedback_info">';
echo get_string('completed_feedbacks', 'feedback').': ';
echo '</span>';
echo '<span class="feedback_info_value">';
echo $completedscount;
echo '</span>';
echo $OUTPUT->box_end();
$params = array('feedback'=>$feedback->id, 'hasvalue'=>1);
示例7: display_submissions
/**
* Display all the submissions ready for grading
*/
function display_submissions($message = '')
{
global $CFG, $db, $USER;
require_once $CFG->libdir . '/gradelib.php';
/* first we check to see if the form has just been submitted
* to request user_preference updates
*/
if (isset($_POST['updatepref'])) {
$perpage = optional_param('perpage', 10, PARAM_INT);
$perpage = $perpage <= 0 ? 10 : $perpage;
set_user_preference('assignment_perpage', $perpage);
set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));
}
/* next we get perpage and quickgrade (allow quick grade) params
* from database
*/
$perpage = get_user_preferences('assignment_perpage', 10);
$quickgrade = get_user_preferences('assignment_quickgrade', 0);
$grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id);
if (!empty($CFG->enableoutcomes) and !empty($grading_info->outcomes)) {
$uses_outcomes = true;
} else {
$uses_outcomes = false;
}
$teacherattempts = true;
/// Temporary measure
$page = optional_param('page', 0, PARAM_INT);
$strsaveallfeedback = get_string('saveallfeedback', 'assignment');
/// Some shortcuts to make the code read better
$course = $this->course;
$assignment = $this->assignment;
$cm = $this->cm;
$tabindex = 1;
//tabindex for quick grading tabbing; Not working for dropdowns yet
add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id=' . $this->assignment->id, $this->assignment->id, $this->cm->id);
$navlinks = array();
$navlinks[] = array('name' => $this->strassignments, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
$navlinks[] = array('name' => format_string($this->assignment->name, true), 'link' => "view.php?a={$this->assignment->id}", 'type' => 'activityinstance');
$navlinks[] = array('name' => $this->strsubmissions, 'link' => '', 'type' => 'title');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($this->assignment->name, true), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
if (!empty($message)) {
echo $message;
// display messages here if any
}
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
/// find out current groups mode
$groupmode = groups_get_activity_groupmode($cm);
$currentgroup = groups_get_activity_group($cm, true);
groups_print_activity_menu($cm, 'submissions.php?id=' . $this->cm->id);
/// Get all ppl that are allowed to submit assignments
$users = get_users_by_capability($context, 'mod/assignment:submit', '', '', '', '', $currentgroup, '', false);
$users = array_keys($users);
if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) {
$groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id');
$users = array_intersect($users, array_keys($groupingusers));
}
$tablecolumns = array('picture', 'fullname', 'grade', 'submissioncomment', 'timemodified', 'timemarked', 'status', 'finalgrade');
if ($uses_outcomes) {
$tablecolumns[] = 'outcome';
// no sorting based on outcomes column
}
$tableheaders = array('', get_string('fullname'), get_string('grade'), get_string('comment', 'assignment'), get_string('lastmodified') . ' (' . $course->student . ')', get_string('lastmodified') . ' (' . $course->teacher . ')', get_string('status'), get_string('finalgrade', 'grades'));
if ($uses_outcomes) {
$tableheaders[] = get_string('outcome', 'grades');
}
require_once $CFG->libdir . '/tablelib.php';
$table = new flexible_table('mod-assignment-submissions');
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
$table->define_baseurl($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id . '&currentgroup=' . $currentgroup);
$table->sortable(true, 'lastname');
//sorted by lastname by default
$table->collapsible(true);
$table->initialbars(true);
$table->column_suppress('picture');
$table->column_suppress('fullname');
$table->column_class('picture', 'picture');
$table->column_class('fullname', 'fullname');
$table->column_class('grade', 'grade');
$table->column_class('submissioncomment', 'comment');
$table->column_class('timemodified', 'timemodified');
$table->column_class('timemarked', 'timemarked');
$table->column_class('status', 'status');
$table->column_class('finalgrade', 'finalgrade');
if ($uses_outcomes) {
$table->column_class('outcome', 'outcome');
}
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'attempts');
$table->set_attribute('class', 'submissions');
$table->set_attribute('width', '90%');
//$table->set_attribute('align', 'center');
$table->no_sorting('finalgrade');
$table->no_sorting('outcome');
// Start working -- this is necessary as soon as the niceties are over
$table->setup();
//.........这里部分代码省略.........
示例8: get_user_preferences
$detailedrep = get_user_preferences('scorm_report_detailed', false);
$pagesize = get_user_preferences('scorm_report_pagesize', 0);
$attemptsmode = optional_param('attemptsmode', SCORM_REPORT_ATTEMPTS_STUDENTS_WITH, PARAM_INT);
}
if ($pagesize < 1) {
$pagesize = SCORM_REPORT_DEFAULT_PAGE_SIZE;
}
// select group menu
$displayoptions = array();
$displayoptions['id'] = $cm->id;
$displayoptions['attemptsmode'] = $attemptsmode;
$reporturlwithdisplayoptions = new moodle_url($CFG->wwwroot . '/mod/scorm/report.php', $displayoptions);
if ($groupmode = groups_get_activity_groupmode($cm)) {
// Groups are being used
if (!$download) {
groups_print_activity_menu($cm, $reporturlwithdisplayoptions->out());
}
}
// We only want to show the checkbox to delete attempts
// if the user has permissions and if the report mode is showing attempts.
$candelete = has_capability('mod/scorm:deleteresponses', $contextmodule) && $attemptsmode != SCORM_REPORT_ATTEMPTS_STUDENTS_WITH_NO;
// select the students
$nostudents = false;
if (empty($currentgroup)) {
// all users who can attempt scoes
if (!($students = get_users_by_capability($contextmodule, 'mod/scorm:savetrack', '', '', '', '', '', '', false))) {
echo $OUTPUT->notification(get_string('nostudentsyet'));
$nostudents = true;
$allowedlist = '';
} else {
$allowedlist = join(',', array_keys($students));
示例9: display
public function display($quiz, $cm, $course) {
global $CFG, $DB, $OUTPUT;
list($currentgroup, $students, $groupstudents, $allowed) =
$this->init('responses', 'quiz_responses_settings_form', $quiz, $cm, $course);
$options = new quiz_responses_options('responses', $quiz, $cm, $course);
if ($fromform = $this->form->get_data()) {
$options->process_settings_from_form($fromform);
} else {
$options->process_settings_from_params();
}
$this->form->set_data($options->get_initial_form_data());
if ($options->attempts == self::ALL_WITH) {
// This option is only available to users who can access all groups in
// groups mode, so setting allowed to empty (which means all quiz attempts
// are accessible, is not a security porblem.
$allowed = array();
}
// Load the required questions.
$questions = quiz_report_get_significant_questions($quiz);
// Prepare for downloading, if applicable.
$courseshortname = format_string($course->shortname, true,
array('context' => context_course::instance($course->id)));
$table = new quiz_responses_table($quiz, $this->context, $this->qmsubselect,
$options, $groupstudents, $students, $questions, $this->get_base_url());
$filename = quiz_report_download_filename(get_string('responsesfilename', 'quiz_responses'),
$courseshortname, $quiz->name);
$table->is_downloading($options->download, $filename,
$courseshortname . ' ' . format_string($quiz->name, true));
if ($table->is_downloading()) {
raise_memory_limit(MEMORY_EXTRA);
}
$this->process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $options->get_url());
// Start output.
if (!$table->is_downloading()) {
// Only print headers if not asked to download data.
$this->print_header_and_tabs($cm, $course, $quiz, $this->mode);
}
if ($groupmode = groups_get_activity_groupmode($cm)) {
// Groups are being used, so output the group selector if we are not downloading.
if (!$table->is_downloading()) {
groups_print_activity_menu($cm, $options->get_url());
}
}
// Print information on the number of existing attempts.
if (!$table->is_downloading()) {
// Do not print notices when downloading.
if ($strattemptnum = quiz_num_attempt_summary($quiz, $cm, true, $currentgroup)) {
echo '<div class="quizattemptcounts">' . $strattemptnum . '</div>';
}
}
$hasquestions = quiz_questions_in_quiz($quiz->questions);
if (!$table->is_downloading()) {
if (!$hasquestions) {
echo quiz_no_questions_message($quiz, $cm, $this->context);
} else if (!$students) {
echo $OUTPUT->notification(get_string('nostudentsyet'));
} else if ($currentgroup && !$groupstudents) {
echo $OUTPUT->notification(get_string('nostudentsingroup'));
}
// Print the display options.
$this->form->display();
}
$hasstudents = $students && (!$currentgroup || $groupstudents);
if ($hasquestions && ($hasstudents || $options->attempts == self::ALL_WITH)) {
list($fields, $from, $where, $params) = $table->base_sql($allowed);
$table->set_count_sql("SELECT COUNT(1) FROM $from WHERE $where", $params);
$table->set_sql($fields, $from, $where, $params);
if (!$table->is_downloading()) {
// Print information on the grading method.
if ($strattempthighlight = quiz_report_highlighting_grading_method(
$quiz, $this->qmsubselect, $options->onlygraded)) {
echo '<div class="quizattemptcounts">' . $strattempthighlight . '</div>';
}
}
// Define table columns.
$columns = array();
$headers = array();
if (!$table->is_downloading() && $options->checkboxcolumn) {
$columns[] = 'checkbox';
$headers[] = null;
//.........这里部分代码省略.........
示例10: display
/**
* displays the full report
* @param stdClass $scorm full SCORM object
* @param stdClass $cm - full course_module object
* @param stdClass $course - full course object
* @param string $download - type of download being requested
*/
function display($scorm, $cm, $course, $download) {
global $CFG, $DB, $OUTPUT, $PAGE;
$contextmodule = get_context_instance(CONTEXT_MODULE, $cm->id);
$action = optional_param('action', '', PARAM_ALPHA);
$attemptids = optional_param_array('attemptid', array(), PARAM_RAW);
$attemptsmode = optional_param('attemptsmode', SCORM_REPORT_ATTEMPTS_ALL_STUDENTS, PARAM_INT);
$PAGE->set_url(new moodle_url($PAGE->url, array('attemptsmode' => $attemptsmode)));
if ($action == 'delete' && has_capability('mod/scorm:deleteresponses', $contextmodule) && confirm_sesskey()) {
if (scorm_delete_responses($attemptids, $scorm)) { //delete responses.
add_to_log($course->id, 'scorm', 'delete attempts', 'report.php?id=' . $cm->id, implode(",", $attemptids), $cm->id);
echo $OUTPUT->notification(get_string('scormresponsedeleted', 'scorm'), 'notifysuccess');
}
}
// find out current groups mode
$currentgroup = groups_get_activity_group($cm, true);
// detailed report
$mform = new mod_scorm_report_interactions_settings($PAGE->url, compact('currentgroup'));
if ($fromform = $mform->get_data()) {
$pagesize = $fromform->pagesize;
$includeqtext = $fromform->qtext;
$includeresp = $fromform->resp;
$includeright = $fromform->right;
set_user_preference('scorm_report_pagesize', $pagesize);
set_user_preference('scorm_report_interactions_qtext', $includeqtext);
set_user_preference('scorm_report_interactions_resp', $includeresp);
set_user_preference('scorm_report_interactions_right', $includeright);
} else {
$pagesize = get_user_preferences('scorm_report_pagesize', 0);
$includeqtext = get_user_preferences('scorm_report_interactions_qtext', 0);
$includeresp = get_user_preferences('scorm_report_interactions_resp', 1);
$includeright = get_user_preferences('scorm_report_interactions_right', 0);
}
if ($pagesize < 1) {
$pagesize = SCORM_REPORT_DEFAULT_PAGE_SIZE;
}
// select group menu
$displayoptions = array();
$displayoptions['attemptsmode'] = $attemptsmode;
$displayoptions['qtext'] = $includeqtext;
$displayoptions['resp'] = $includeresp;
$displayoptions['right'] = $includeright;
$mform->set_data($displayoptions + array('pagesize' => $pagesize));
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used
if (!$download) {
groups_print_activity_menu($cm, new moodle_url($PAGE->url, $displayoptions));
}
}
$formattextoptions = array('context' => get_context_instance(CONTEXT_COURSE, $course->id));
// We only want to show the checkbox to delete attempts
// if the user has permissions and if the report mode is showing attempts.
$candelete = has_capability('mod/scorm:deleteresponses', $contextmodule)
&& ($attemptsmode != SCORM_REPORT_ATTEMPTS_STUDENTS_WITH_NO);
// select the students
$nostudents = false;
if (empty($currentgroup)) {
// all users who can attempt scoes
if (!$students = get_users_by_capability($contextmodule, 'mod/scorm:savetrack', '', '', '', '', '', '', false)) {
echo $OUTPUT->notification(get_string('nostudentsyet'));
$nostudents = true;
$allowedlist = '';
} else {
$allowedlist = array_keys($students);
}
} else {
// all users who can attempt scoes and who are in the currently selected group
if (!$groupstudents = get_users_by_capability($contextmodule, 'mod/scorm:savetrack', '', '', '', '', $currentgroup, '', false)) {
echo $OUTPUT->notification(get_string('nostudentsingroup'));
$nostudents = true;
$groupstudents = array();
}
$allowedlist = array_keys($groupstudents);
}
if ( !$nostudents ) {
// Now check if asked download of data
$coursecontext = context_course::instance($course->id);
if ($download) {
$filename = clean_filename("$course->shortname ".format_string($scorm->name, true,$formattextoptions));
}
// Define table columns
$columns = array();
$headers = array();
if (!$download && $candelete) {
$columns[] = 'checkbox';
$headers[] = null;
}
if (!$download && $CFG->grade_report_showuserimage) {
//.........这里部分代码省略.........
示例11: display
/**
* (non-PHPdoc)
*
* @see offlinequiz_default_report::display()
*/
public function display($offlinequiz, $cm, $course)
{
global $CFG, $OUTPUT, $SESSION, $DB;
// Define some strings.
$strtimeformat = get_string('strftimedatetime');
$letterstr = ' ABCDEFGHIJKLMNOPQRSTUVWXYZ';
offlinequiz_load_useridentification();
$offlinequizconfig = get_config('offlinequiz');
// Deal with actions.
$action = optional_param('action', '', PARAM_ACTION);
// Only print headers if not asked to download data or delete data.
if (!($download = optional_param('download', null, PARAM_TEXT)) && !$action == 'delete') {
$this->print_header_and_tabs($cm, $course, $offlinequiz, 'overview');
echo $OUTPUT->box_start('linkbox');
echo $OUTPUT->heading(format_string($offlinequiz->name));
echo $OUTPUT->heading(get_string('results', 'offlinequiz'));
require_once $CFG->libdir . '/grouplib.php';
echo groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/offlinequiz/report.php?id=' . $cm->id . '&mode=overview', true);
echo $OUTPUT->box_end();
echo '<br/>';
}
$context = context_module::instance($cm->id);
$systemcontext = context_system::instance();
// Set table options.
$noresults = optional_param('noresults', 0, PARAM_INT);
$pagesize = optional_param('pagesize', 10, PARAM_INT);
$groupid = optional_param('group', 0, PARAM_INT);
if ($pagesize < 1) {
$pagesize = 10;
}
$answerletters = 'abcdefghijklmnopqrstuvwxyz';
if ($action == 'delete' && confirm_sesskey()) {
$selectedresultids = array();
$params = (array) data_submitted();
foreach ($params as $key => $value) {
if (preg_match('!^s([0-9]+)$!', $key, $matches)) {
$selectedresultids[] = $matches[1];
}
}
if ($selectedresultids) {
foreach ($selectedresultids as $resultid) {
if ($resultid && ($todelete = $DB->get_record('offlinequiz_results', array('id' => $resultid)))) {
offlinequiz_delete_result($resultid, $context);
// Log this event.
$params = array('objectid' => $resultid, 'relateduserid' => $todelete->userid, 'context' => context_module::instance($cm->id), 'other' => array('mode' => 'overview'));
$event = \mod_offlinequiz\event\attempt_deleted::create($params);
$event->trigger();
// Change the status of all related pages with error 'resultexists' to 'suspended'.
$user = $DB->get_record('user', array('id' => $todelete->userid));
$group = $DB->get_record('offlinequiz_groups', array('id' => $todelete->offlinegroupid));
$sql = "SELECT id\n FROM {offlinequiz_scanned_pages}\n WHERE offlinequizid = :offlinequizid\n AND userkey = :userkey\n AND groupnumber = :groupnumber\n AND status = 'error'\n AND (error = 'resultexists' OR error = 'differentresultexists')";
$params = array('offlinequizid' => $offlinequiz->id, 'userkey' => $user->{$offlinequizconfig->ID_field}, 'groupnumber' => $group->number);
$otherpages = $DB->get_records_sql($sql, $params);
foreach ($otherpages as $page) {
$DB->set_field('offlinequiz_scanned_pages', 'status', 'suspended', array('id' => $page->id));
$DB->set_field('offlinequiz_scanned_pages', 'error', '', array('id' => $page->id));
}
}
}
offlinequiz_grade_item_update($offlinequiz, 'reset');
offlinequiz_update_grades($offlinequiz);
redirect(new moodle_url('/mod/offlinequiz/report.php', array('mode' => 'overview', 'id' => $cm->id, 'noresults' => $noresults, 'pagesize' => $pagesize)));
}
}
// Now check if asked download of data.
if ($download) {
$filename = clean_filename("{$course->shortname} " . format_string($offlinequiz->name, true));
$sort = '';
}
// Fetch the group data.
$groups = $DB->get_records('offlinequiz_groups', array('offlinequizid' => $offlinequiz->id), 'number', '*', 0, $offlinequiz->numgroups);
// Define table columns.
$tablecolumns = array('checkbox', 'picture', 'fullname', $offlinequizconfig->ID_field, 'timestart', 'offlinegroupid', 'sumgrades');
$tableheaders = array('<input type="checkbox" name="toggle" onClick="if (this.checked) {select_all_in(\'DIV\',null,\'tablecontainer\');}
else {deselect_all_in(\'DIV\',null,\'tablecontainer\');}"/>', '', get_string('fullname'), get_string($offlinequizconfig->ID_field), get_string('importedon', 'offlinequiz'), get_string('group'), get_string('grade', 'offlinequiz'));
$checked = array();
// Get participants list.
$withparticipants = false;
if ($lists = $DB->get_records('offlinequiz_p_lists', array('offlinequizid' => $offlinequiz->id))) {
$withparticipants = true;
$tablecolumns[] = 'checked';
$tableheaders[] = get_string('present', 'offlinequiz');
foreach ($lists as $list) {
$participants = $DB->get_records('offlinequiz_participants', array('listid' => $list->id));
foreach ($participants as $participant) {
$checked[$participant->userid] = $participant->checked;
}
}
}
if (!$download) {
// Set up the table.
$params = array('offlinequiz' => $offlinequiz, 'noresults' => $noresults, 'pagesize' => $pagesize);
$table = new offlinequiz_results_table('mod-offlinequiz-report-overview-report', $params);
$table->define_columns($tablecolumns);
$table->define_headers($tableheaders);
//.........这里部分代码省略.........
示例12: view_grading_table
/**
* View the grading table of all submissions for this assignment
*
* @return string
*/
private function view_grading_table() {
global $USER, $CFG;
// Include grading options form
require_once($CFG->dirroot . '/mod/assign/gradingoptionsform.php');
require_once($CFG->dirroot . '/mod/assign/quickgradingform.php');
require_once($CFG->dirroot . '/mod/assign/gradingbatchoperationsform.php');
$o = '';
$links = array();
if (has_capability('gradereport/grader:view', $this->get_course_context()) &&
has_capability('moodle/grade:viewall', $this->get_course_context())) {
$gradebookurl = '/grade/report/grader/index.php?id=' . $this->get_course()->id;
$links[$gradebookurl] = get_string('viewgradebook', 'assign');
}
if ($this->is_any_submission_plugin_enabled()) {
$downloadurl = '/mod/assign/view.php?id=' . $this->get_course_module()->id . '&action=downloadall';
$links[$downloadurl] = get_string('downloadall', 'assign');
}
if ($this->is_blind_marking() && has_capability('mod/assign:revealidentities', $this->get_context())) {
$revealidentitiesurl = '/mod/assign/view.php?id=' . $this->get_course_module()->id . '&action=revealidentities';
$links[$revealidentitiesurl] = get_string('revealidentities', 'assign');
}
foreach ($this->get_feedback_plugins() as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
foreach ($plugin->get_grading_actions() as $action => $description) {
$url = '/mod/assign/view.php' .
'?id=' . $this->get_course_module()->id .
'&plugin=' . $plugin->get_type() .
'&pluginsubtype=assignfeedback' .
'&action=viewpluginpage&pluginaction=' . $action;
$links[$url] = $description;
}
}
}
$gradingactions = new url_select($links);
$gradingmanager = get_grading_manager($this->get_context(), 'mod_assign', 'submissions');
$perpage = get_user_preferences('assign_perpage', 10);
$filter = get_user_preferences('assign_filter', '');
$controller = $gradingmanager->get_active_controller();
$showquickgrading = empty($controller);
if (optional_param('action', '', PARAM_ALPHA) == 'saveoptions') {
$quickgrading = optional_param('quickgrading', false, PARAM_BOOL);
set_user_preference('assign_quickgrading', $quickgrading);
}
$quickgrading = get_user_preferences('assign_quickgrading', false);
// print options for changing the filter and changing the number of results per page
$gradingoptionsform = new mod_assign_grading_options_form(null,
array('cm'=>$this->get_course_module()->id,
'contextid'=>$this->context->id,
'userid'=>$USER->id,
'submissionsenabled'=>$this->is_any_submission_plugin_enabled(),
'showquickgrading'=>$showquickgrading,
'quickgrading'=>$quickgrading),
'post', '',
array('class'=>'gradingoptionsform'));
$gradingbatchoperationsform = new mod_assign_grading_batch_operations_form(null,
array('cm'=>$this->get_course_module()->id,
'submissiondrafts'=>$this->get_instance()->submissiondrafts,
'duedate'=>$this->get_instance()->duedate,
'feedbackplugins'=>$this->get_feedback_plugins()),
'post', '',
array('class'=>'gradingbatchoperationsform'));
$gradingoptionsdata = new stdClass();
$gradingoptionsdata->perpage = $perpage;
$gradingoptionsdata->filter = $filter;
$gradingoptionsform->set_data($gradingoptionsdata);
$actionformtext = $this->output->render($gradingactions);
$o .= $this->output->render(new assign_header($this->get_instance(),
$this->get_context(), false, $this->get_course_module()->id, get_string('grading', 'assign'), $actionformtext));
$o .= groups_print_activity_menu($this->get_course_module(), $CFG->wwwroot . '/mod/assign/view.php?id=' . $this->get_course_module()->id.'&action=grading', true);
// plagiarism update status apearring in the grading book
if (!empty($CFG->enableplagiarism)) {
/** Include plagiarismlib.php */
require_once($CFG->libdir . '/plagiarismlib.php');
$o .= plagiarism_update_status($this->get_course(), $this->get_course_module());
}
// load and print the table of submissions
if ($showquickgrading && $quickgrading) {
$table = $this->output->render(new assign_grading_table($this, $perpage, $filter, 0, true));
$quickgradingform = new mod_assign_quick_grading_form(null,
array('cm'=>$this->get_course_module()->id,
'gradingtable'=>$table));
$o .= $this->output->render(new assign_form('quickgradingform', $quickgradingform));
} else {
$o .= $this->output->render(new assign_grading_table($this, $perpage, $filter, 0, false));
}
//.........这里部分代码省略.........
示例13: get_string
$strsubscribeall = get_string("subscribeall", "forum");
$strsubscribenone = get_string("subscribenone", "forum");
$strsubscribers = get_string("subscribers", "forum");
$strforums = get_string("forums", "forum");
$navigation = build_navigation($strsubscribers, $cm);
if (has_capability('mod/forum:managesubscriptions', $context)) {
print_header_simple("{$strsubscribers}", "", $navigation, "", "", true, forum_update_subscriptions_button($course->id, $id));
if ($edit != -1) {
$USER->subscriptionsediting = $edit;
}
} else {
print_header_simple("{$strsubscribers}", "", $navigation, "", "", true, '');
unset($USER->subscriptionsediting);
}
/// Check to see if groups are being used in this forum
groups_print_activity_menu($cm, "subscribers.php?id={$forum->id}");
$currentgroup = groups_get_activity_group($cm);
$groupmode = groups_get_activity_groupmode($cm);
if (empty($USER->subscriptionsediting)) {
/// Display an overview of subscribers
if (!($users = forum_subscribed_users($course, $forum, $currentgroup, $context))) {
echo $OUTPUT->heading(get_string("nosubscribers", "forum"));
} else {
echo $OUTPUT->heading(get_string("subscribersto", "forum", "'" . format_string($forum->name) . "'"));
echo '<table align="center" cellpadding="5" cellspacing="5">';
foreach ($users as $user) {
echo '<tr><td>';
echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
echo '</td><td>';
echo fullname($user);
echo '</td><td>';
示例14: redirect
// Use the subscribe list to check this user is on it. That
// means they can't unsubscribe users in different groups.
if (array_key_exists($matches[1], $subscribers)) {
$forum->unsubscribe($matches[1]);
}
}
}
$transaction->allow_commit();
redirect('subscribers.php?' . $forum->get_link_params(mod_forumng::PARAM_PLAIN));
}
$thisurl = new moodle_url('/mod/forumng/subscribers.php', $pageparams);
$out = $forum->init_page($thisurl, get_string('subscribers', 'forumng'));
print $out->header();
$forum->print_js();
// Display group selector if required
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/forumng/subscribers.php?' . $forum->get_link_params(mod_forumng::PARAM_PLAIN));
// Get all subscribers
$subscribers = $forum->get_subscribers();
$individualgroup = $groupid != mod_forumng::ALL_GROUPS && $groupid != mod_forumng::NO_GROUPS;
//Remove the subscribers to other groups and discussions which don't belong to this group
if ($individualgroup) {
foreach ($subscribers as $key => $user) {
$removeuser = true;
if (array_key_exists($groupid, $user->groupids)) {
$removeuser = false;
}
if (in_array($groupid, $user->discussionids)) {
$removeuser = false;
}
if ($user->wholeforum) {
$removeuser = false;
示例15: get_string
}
/// Print the page header
$strfeedbacks = get_string("modulenameplural", "feedback");
$strfeedback = get_string("modulename", "feedback");
$PAGE->navbar->add(get_string('analysis', 'feedback'));
$PAGE->set_heading(format_string($course->fullname));
$PAGE->set_title(format_string($feedback->name));
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($feedback->name));
/// print the tabs
require 'tabs.php';
//print analysed items
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
//get the groupid
$myurl = $CFG->wwwroot . '/mod/feedback/analysis.php?id=' . $cm->id . '&do_show=analysis';
$groupselect = groups_print_activity_menu($cm, $myurl, true);
$mygroupid = groups_get_activity_group($cm);
if (has_capability('mod/feedback:viewreports', $context)) {
echo isset($groupselect) ? $groupselect : '';
echo '<div class="clearer"></div>';
//button "export to excel"
echo $OUTPUT->container_start('form-buttons');
$aurl = new moodle_url('analysis_to_excel.php', array('sesskey' => sesskey(), 'id' => $id));
echo $OUTPUT->single_button($aurl, get_string('export_to_excel', 'feedback'));
echo $OUTPUT->container_end();
}
//get completed feedbacks
$completedscount = feedback_get_completeds_group_count($feedback, $mygroupid);
//show the group, if available
if ($mygroupid and $group = $DB->get_record('groups', array('id' => $mygroupid))) {
echo '<b>' . get_string('group') . ': ' . $group->name . '</b><br />';