本文整理汇总了PHP中workshop::overall_feedback_attachment_options方法的典型用法代码示例。如果您正苦于以下问题:PHP workshop::overall_feedback_attachment_options方法的具体用法?PHP workshop::overall_feedback_attachment_options怎么用?PHP workshop::overall_feedback_attachment_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workshop
的用法示例。
在下文中一共展示了workshop::overall_feedback_attachment_options方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
$strategy = $workshop->grading_strategy_instance();
// load the assessment form and process the submitted data eventually
$mform = $strategy->get_assessment_form($PAGE->url, 'assessment', $assessment, $assessmenteditable);
// Set data managed by the workshop core, subplugins set their own data themselves.
$currentdata = (object)array(
'feedbackauthor' => $assessment->feedbackauthor,
'feedbackauthorformat' => $assessment->feedbackauthorformat,
);
if ($assessmenteditable and $workshop->overallfeedbackmode) {
$currentdata = file_prepare_standard_editor($currentdata, 'feedbackauthor', $workshop->overall_feedback_content_options(),
$workshop->context, 'mod_workshop', 'overallfeedback_content', $assessment->id);
if ($workshop->overallfeedbackfiles) {
$currentdata = file_prepare_standard_filemanager($currentdata, 'feedbackauthorattachment',
$workshop->overall_feedback_attachment_options(), $workshop->context, 'mod_workshop', 'overallfeedback_attachment',
$assessment->id);
}
}
$mform->set_data($currentdata);
if ($mform->is_cancelled()) {
redirect($workshop->view_url());
} elseif ($assessmenteditable and ($data = $mform->get_data())) {
if ($canmanage) {
if (is_null($assessment->grade)) {
$workshop->log('add reference assessment', $workshop->exassess_url($assessment->id), $assessment->submissionid);
} else {
$workshop->log('update reference assessment', $workshop->exassess_url($assessment->id), $assessment->submissionid);
}
} else {
示例2: array
// only the reviewer is allowed to modify the assessment
if ($canmanage and $assessment->weight == 1 or $isreviewer and $workshop->assessing_examples_allowed()) {
$assessmenteditable = true;
} else {
$assessmenteditable = false;
}
// load the grading strategy logic
$strategy = $workshop->grading_strategy_instance();
// load the assessment form and process the submitted data eventually
$mform = $strategy->get_assessment_form($PAGE->url, 'assessment', $assessment, $assessmenteditable);
// Set data managed by the workshop core, subplugins set their own data themselves.
$currentdata = (object) array('feedbackauthor' => $assessment->feedbackauthor, 'feedbackauthorformat' => $assessment->feedbackauthorformat);
if ($assessmenteditable and $workshop->overallfeedbackmode) {
$currentdata = file_prepare_standard_editor($currentdata, 'feedbackauthor', $workshop->overall_feedback_content_options(), $workshop->context, 'mod_workshop', 'overallfeedback_content', $assessment->id);
if ($workshop->overallfeedbackfiles) {
$currentdata = file_prepare_standard_filemanager($currentdata, 'feedbackauthorattachment', $workshop->overall_feedback_attachment_options(), $workshop->context, 'mod_workshop', 'overallfeedback_attachment', $assessment->id);
}
}
$mform->set_data($currentdata);
if ($mform->is_cancelled()) {
redirect($workshop->view_url());
} elseif ($assessmenteditable and $data = $mform->get_data()) {
// Let the grading strategy subplugin save its data.
$rawgrade = $strategy->save_assessment($assessment, $data);
// Store the data managed by the workshop core.
$coredata = (object) array('id' => $assessment->id);
if (isset($data->feedbackauthor_editor)) {
$coredata->feedbackauthor_editor = $data->feedbackauthor_editor;
$coredata = file_postupdate_standard_editor($coredata, 'feedbackauthor', $workshop->overall_feedback_content_options(), $workshop->context, 'mod_workshop', 'overallfeedback_content', $assessment->id);
unset($coredata->feedbackauthor_editor);
}