Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-30453 Use correct renderable classes to represent assessments of …

…example submission
  • Loading branch information...
commit 2bf6056b4af72f742b7294a565316d09857ef29d 1 parent 06cb4cb
@mudrd8mz mudrd8mz authored
View
8 mod/workshop/exassessment.php
@@ -127,9 +127,8 @@
'showreviewer' => false,
'showauthor' => false,
'showform' => true,
- 'showweight' => false,
);
- $assessment = $workshop->prepare_assessment($assessment, $mform, $options);
+ $assessment = $workshop->prepare_example_reference_assessment($assessment, $mform, $options);
$assessment->title = get_string('assessmentreference', 'workshop');
echo $output->render($assessment);
@@ -138,9 +137,8 @@
'showreviewer' => true,
'showauthor' => false,
'showform' => true,
- 'showweight' => false,
);
- $assessment = $workshop->prepare_assessment($assessment, $mform, $options);
+ $assessment = $workshop->prepare_example_assessment($assessment, $mform, $options);
$assessment->title = get_string('assessmentbyyourself', 'workshop');
echo $output->render($assessment);
@@ -151,7 +149,7 @@
'showform' => true,
'showweight' => false,
);
- $assessment = $workshop->prepare_assessment($assessment, $mform, $options);
+ $assessment = $workshop->prepare_example_assessment($assessment, $mform, $options);
echo $output->render($assessment);
}
View
12 mod/workshop/excompare.php
@@ -84,10 +84,12 @@
'showreviewer' => false,
'showauthor' => false,
'showform' => true,
- 'showweight' => false,
);
- $reference = $workshop->prepare_assessment($reference, $mformreference, $options);
+ $reference = $workshop->prepare_example_reference_assessment($reference, $mformreference, $options);
$reference->title = get_string('assessmentreference', 'workshop');
+ if ($canmanage) {
+ $reference->url = $workshop->exassess_url($reference->id);
+ }
echo $output->render($reference);
}
@@ -96,9 +98,8 @@
'showreviewer' => true,
'showauthor' => false,
'showform' => true,
- 'showweight' => false,
);
- $assessment = $workshop->prepare_assessment($assessment, $mformassessment, $options);
+ $assessment = $workshop->prepare_example_assessment($assessment, $mformassessment, $options);
$assessment->title = get_string('assessmentbyyourself', 'workshop');
if ($workshop->assessing_examples_allowed()) {
$assessment->add_action(
@@ -113,9 +114,8 @@
'showreviewer' => true,
'showauthor' => false,
'showform' => true,
- 'showweight' => false,
);
- $assessment = $workshop->prepare_assessment($assessment, $mformassessment, $options);
+ $assessment = $workshop->prepare_example_assessment($assessment, $mformassessment, $options);
echo $output->render($assessment);
}
View
22 mod/workshop/renderer.php
@@ -565,7 +565,7 @@ protected function render_workshop_assessment(workshop_assessment $assessment) {
} else {
$title = get_string('assessment', 'workshop');
}
- if ($this->page->url != $assessment->url) {
+ if (($assessment->url instanceof moodle_url) and ($this->page->url != $assessment->url)) {
$o .= $this->output->container(html_writer::link($assessment->url, $title), 'title');
} else {
$o .= $this->output->container($title, 'title');
@@ -629,6 +629,26 @@ protected function render_workshop_assessment(workshop_assessment $assessment) {
return $o;
}
+ /**
+ * Renders the assessment of an example submission
+ *
+ * @param workshop_example_assessment $assessment
+ * @return string HTML
+ */
+ protected function render_workshop_example_assessment(workshop_example_assessment $assessment) {
+ return $this->render_workshop_assessment($assessment);
+ }
+
+ /**
+ * Renders the reference assessment of an example submission
+ *
+ * @param workshop_example_reference_assessment $assessment
+ * @return string HTML
+ */
+ protected function render_workshop_example_reference_assessment(workshop_example_reference_assessment $assessment) {
+ return $this->render_workshop_assessment($assessment);
+ }
+
////////////////////////////////////////////////////////////////////////////
// Internal rendering helper methods
////////////////////////////////////////////////////////////////////////////
Please sign in to comment.
Something went wrong with that request. Please try again.