mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-34310 display grading method description inside render_preview
This way we can use the function gradingform_controller::render_preview() to display a preview for students in different modules without worrying on gradingform-specific options on whether to display description for students or not
This commit is contained in:
parent
c92d6f417c
commit
42b1867410
@ -506,6 +506,14 @@ class gradingform_guide_controller extends gradingform_controller {
|
||||
$comments = $this->definition->guide_comment;
|
||||
$options = $this->get_options();
|
||||
$guide = '';
|
||||
if (has_capability('moodle/grade:managegradingforms', $page->context)) {
|
||||
$showdescription = true;
|
||||
} else {
|
||||
$showdescription = $options['showdescriptionstudent'];
|
||||
}
|
||||
if ($showdescription) {
|
||||
$guide .= $output->box($this->get_formatted_description(), 'gradingform_guide-description');
|
||||
}
|
||||
if (has_capability('moodle/grade:managegradingforms', $page->context)) {
|
||||
$guide .= $output->display_guide_mapping_explained($this->get_min_max_score());
|
||||
$guide .= $output->display_guide($criteria, $comments, $options, self::DISPLAY_PREVIEW, 'guide');
|
||||
|
@ -49,8 +49,5 @@ $PAGE->set_heading($title);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title);
|
||||
if (!empty($options['showdescriptionstudent'])) {
|
||||
echo $OUTPUT->box($controller->get_formatted_description(), 'gradingform_guide-description');
|
||||
}
|
||||
echo $controller->render_preview($PAGE);
|
||||
echo $OUTPUT->footer();
|
||||
|
@ -508,6 +508,14 @@ class gradingform_rubric_controller extends gradingform_controller {
|
||||
$criteria = $this->definition->rubric_criteria;
|
||||
$options = $this->get_options();
|
||||
$rubric = '';
|
||||
if (has_capability('moodle/grade:managegradingforms', $page->context)) {
|
||||
$showdescription = true;
|
||||
} else {
|
||||
$showdescription = $options['showdescriptionstudent'];
|
||||
}
|
||||
if ($showdescription) {
|
||||
$rubric .= $output->box($this->get_formatted_description(), 'gradingform_rubric-description');
|
||||
}
|
||||
if (has_capability('moodle/grade:managegradingforms', $page->context)) {
|
||||
$rubric .= $output->display_rubric_mapping_explained($this->get_min_max_score());
|
||||
$rubric .= $output->display_rubric($criteria, $options, self::DISPLAY_PREVIEW, 'rubric');
|
||||
|
@ -49,8 +49,5 @@ $PAGE->set_heading($title);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($title);
|
||||
if (!empty($options['showdescriptionstudent'])) {
|
||||
echo $OUTPUT->box($controller->get_formatted_description(), 'gradingform_rubric-description');
|
||||
}
|
||||
echo $controller->render_preview($PAGE);
|
||||
echo $OUTPUT->footer();
|
||||
|
@ -233,7 +233,6 @@ if (!empty($method)) {
|
||||
$tag = html_writer::tag('span', get_string('statusdraft', 'core_grading'), array('class' => 'status draft'));
|
||||
}
|
||||
echo $output->heading(s($definition->name) . ' ' . $tag, 3, 'definition-name');
|
||||
echo $output->box($controller->get_formatted_description());
|
||||
echo $output->box($controller->render_preview($PAGE), 'definition-preview');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user