本文整理汇总了PHP中plagiarism_update_status函数的典型用法代码示例。如果您正苦于以下问题:PHP plagiarism_update_status函数的具体用法?PHP plagiarism_update_status怎么用?PHP plagiarism_update_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了plagiarism_update_status函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
//.........这里部分代码省略.........
示例2: 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));
}
//.........这里部分代码省略.........
示例3: display_submissions
/**
* Display all the submissions ready for grading
*
* @global object
* @global object
* @global object
* @global object
* @param string $message
* @return bool|void
*/
function display_submissions($message='') {
global $CFG, $DB, $USER, $DB, $OUTPUT, $PAGE;
require_once($CFG->libdir.'/gradelib.php');
/* first we check to see if the form has just been submitted
* to request user_preference updates
*/
$filters = array(self::FILTER_ALL => get_string('all'),
self::FILTER_SUBMITTED => get_string('submitted', 'assignment'),
self::FILTER_REQUIRE_GRADING => get_string('requiregrading', 'assignment'));
$updatepref = optional_param('updatepref', 0, PARAM_INT);
if (isset($_POST['updatepref'])){
$perpage = optional_param('perpage', 10, PARAM_INT);
$perpage = ($perpage <= 0) ? 10 : $perpage ;
$filter = optional_param('filter', 0, PARAM_INT);
set_user_preference('assignment_perpage', $perpage);
set_user_preference('assignment_quickgrade', optional_param('quickgrade', 0, PARAM_BOOL));
set_user_preference('assignment_filter', $filter);
}
/* 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);
$filter = get_user_preferences('assignment_filter', 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;
}
$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->cm->id, $this->assignment->id, $this->cm->id);
$PAGE->set_title(format_string($this->assignment->name,true));
$PAGE->set_heading($this->course->fullname);
echo $OUTPUT->header();
echo '<div class="usersubmissions">';
//hook to allow plagiarism plugins to update status/print links.
plagiarism_update_status($this->course, $this->cm);
/// Print quickgrade form around the table
if ($quickgrade) {
$formattrs = array();
$formattrs['action'] = new moodle_url('/mod/assignment/submissions.php');
$formattrs['id'] = 'fastg';
$formattrs['method'] = 'post';
echo html_writer::start_tag('form', $formattrs);
echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'id', 'value'=> $this->cm->id));
echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'mode', 'value'=> 'fastgrade'));
echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'page', 'value'=> $page));
echo html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=> sesskey()));
}
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">'
. get_string('seeallcoursegrades', 'grades') . '</a></div>';
}
if (!empty($message)) {
echo $message; // display messages here if any
}
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
/// Check to see if groups are being used in this assignment
/// find out current groups mode
$groupmode = groups_get_activity_groupmode($cm);
$currentgroup = groups_get_activity_group($cm, true);
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id);
//.........这里部分代码省略.........
示例4: 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/gradingactionsform.php';
require_once $CFG->dirroot . '/mod/assign/quickgradingform.php';
require_once $CFG->dirroot . '/mod/assign/gradingbatchoperationsform.php';
$o = '';
$links = array();
$selecturl = (string) new moodle_url('/mod/assign/view.php', array('action' => 'grading', 'id' => $this->get_course_module()->id));
$links[$selecturl] = get_string('selectlink', 'assign');
if (has_capability('gradereport/grader:view', $this->get_course_context()) && has_capability('moodle/grade:viewall', $this->get_course_context())) {
$gradebookurl = (string) new moodle_url('/grade/report/grader/index.php', array('id' => $this->get_course()->id));
$links[$gradebookurl] = get_string('viewgradebook', 'assign');
}
if ($this->is_any_submission_plugin_enabled()) {
$downloadurl = (string) new moodle_url('/mod/assign/view.php', array('id' => $this->get_course_module()->id, 'action' => 'downloadall'));
$links[$downloadurl] = get_string('downloadall', 'assign');
}
$gradingactionsform = new mod_assign_grading_actions_form(null, array('links' => $links, 'cm' => $this->get_course_module()->id), 'post', '', array('class' => 'gradingactionsform'));
$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, '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), 'post', '', array('class' => 'gradingbatchoperationsform'));
$gradingoptionsdata = new stdClass();
$gradingoptionsdata->perpage = $perpage;
$gradingoptionsdata->filter = $filter;
$gradingoptionsform->set_data($gradingoptionsdata);
// plagiarism update status apearring in the grading book
if (!empty($CFG->enableplagiarism)) {
/** Include plagiarismlib.php */
require_once $CFG->libdir . '/plagiarismlib.php';
plagiarism_update_status($this->get_course(), $this->get_course_module());
}
$o .= $this->output->render(new assign_form('gradingactionsform', $gradingactionsform));
$o .= $this->output->render(new assign_form('gradingoptionsform', $gradingoptionsform, 'M.mod_assign.init_grading_options'));
// 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));
}
$currentgroup = groups_get_activity_group($this->get_course_module(), true);
$users = array_keys($this->list_participants($currentgroup, true));
if (count($users) != 0) {
// if no enrolled user in a course then don't display the batch operations feature
$o .= $this->output->render(new assign_form('gradingbatchoperationsform', $gradingbatchoperationsform));
}
return $o;
}