本文整理匯總了PHP中workshop::delete_submission方法的典型用法代碼示例。如果您正苦於以下問題:PHP workshop::delete_submission方法的具體用法?PHP workshop::delete_submission怎麽用?PHP workshop::delete_submission使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類workshop
的用法示例。
在下文中一共展示了workshop::delete_submission方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$example->authorid = $USER->id;
$example->example = 1;
}
$canmanage = has_capability('mod/workshop:manageexamples', $workshop->context);
$canassess = has_capability('mod/workshop:peerassess', $workshop->context);
$refasid = $DB->get_field('workshop_assessments', 'id', array('submissionid' => $example->id, 'weight' => 1));
if ($example->id and ($canmanage or $workshop->assessing_examples_allowed() and $canassess)) {
// ok you can go
} elseif (is_null($example->id) and $canmanage) {
// ok you can go
} else {
print_error('nopermissions', 'error', $workshop->view_url(), 'view or manage example submission');
}
if ($id and $delete and $confirm and $canmanage) {
require_sesskey();
$workshop->delete_submission($example);
redirect($workshop->view_url());
}
if ($id and $assess and $canmanage) {
// reference assessment of an example is the assessment with the weight = 1. There should be just one
// such assessment
require_sesskey();
if (!$refasid) {
$refasid = $workshop->add_allocation($example, $USER->id, 1);
}
redirect($workshop->exassess_url($refasid));
}
if ($id and $assess and $canassess) {
// training assessment of an example is the assessment with the weight = 0
require_sesskey();
$asid = $DB->get_field('workshop_assessments', 'id', array('submissionid' => $example->id, 'weight' => 0, 'reviewerid' => $USER->id));
示例2: array
break;
}
}
}
$edit = ($editable and $edit);
if (!$candeleteall and $ownsubmission and $editable) {
// Only allow the student to delete their own submission if it's still editable and hasn't been assessed.
if (count($workshop->get_assessments_of_submission($submission->id)) > 0) {
$deletable = false;
} else {
$deletable = true;
}
}
if ($submission->id and $delete and $confirm and $deletable) {
require_sesskey();
$workshop->delete_submission($submission);
// Event information.
$params = array('context' => $workshop->context, 'courseid' => $workshop->course->id, 'relateduserid' => $submission->authorid, 'other' => array('submissiontitle' => $submission->title));
$params['objectid'] = $submission->id;
$event = \mod_workshop\event\submission_deleted::create($params);
$event->add_record_snapshot('workshop', $workshoprecord);
$event->trigger();
redirect($workshop->view_url());
}
$seenaspublished = false;
// is the submission seen as a published submission?
if ($submission->id and ($ownsubmission or $canviewall or $isreviewer)) {
// ok you can go
} elseif ($submission->id and $ispublished) {
// ok you can go
$seenaspublished = true;