Skip to content

Commit

Permalink
Merge branch 'wip-MDL-34310-master' of git://github.com/marinaglancy/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
stronk7 committed Aug 27, 2012
2 parents 7b0c1bf + 42b1867 commit a72ff02
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
8 changes: 8 additions & 0 deletions grade/grading/form/guide/lib.php
Expand Up @@ -506,6 +506,14 @@ public function render_preview(moodle_page $page) {
$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');
Expand Down
3 changes: 0 additions & 3 deletions grade/grading/form/guide/preview.php
Expand Up @@ -49,8 +49,5 @@

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();
8 changes: 8 additions & 0 deletions grade/grading/form/rubric/lib.php
Expand Up @@ -508,6 +508,14 @@ public function render_preview(moodle_page $page) {
$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');
Expand Down
3 changes: 0 additions & 3 deletions grade/grading/form/rubric/preview.php
Expand Up @@ -49,8 +49,5 @@

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();
1 change: 0 additions & 1 deletion grade/grading/manage.php
Expand Up @@ -233,7 +233,6 @@
$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');
}
}
Expand Down

0 comments on commit a72ff02

Please sign in to comment.