Permalink
Browse files

MDL-27550 workshop: rendering links to the submission and the assessm…

…ent page

This usability improvement helps to provide feedback quickly during the
grading evaluation phase.
  • Loading branch information...
1 parent 8981b64 commit 08282ec16c0fb0373d98b37dc264a2fff71d153c @mudrd8mz mudrd8mz committed Jul 28, 2011
Showing with 20 additions and 4 deletions.
  1. +15 −3 mod/workshop/renderer.php
  2. +5 −1 mod/workshop/submission.php
@@ -91,7 +91,14 @@ protected function render_workshop_submission(workshop_submission $submission) {
}
$o .= $this->output->container_start($classes);
$o .= $this->output->container_start('header');
- $o .= $this->output->heading(format_string($submission->title), 3, 'title');
+
+ $title = $this->output->heading(format_string($submission->title), 3, 'title');
+
+ if ($this->page->url != $submission->url) {
+ $o .= html_writer::link($submission->url, $title);
+ } else {
+ $o .= $title;
+ }
if (!$anonymous) {
$author = new stdclass();
@@ -554,9 +561,14 @@ protected function render_workshop_assessment(workshop_assessment $assessment) {
$o .= $this->output->container_start('header');
if (!empty($assessment->title)) {
- $o .= $this->output->container(s($assessment->title), 'title');
+ $title = s($assessment->title);
+ } else {
+ $title = get_string('assessment', 'workshop');
+ }
+ if ($this->page->url != $assessment->url) {
+ $o .= $this->output->container(html_writer::link($assessment->url, $title), 'title');
} else {
- $o .= $this->output->container(get_string('assessment', 'workshop'), 'title');
+ $o .= $this->output->container($title, 'title');
}
if (!$anonymous) {
@@ -43,7 +43,11 @@
$workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
$workshop = new workshop($workshop, $cm, $course);
-$PAGE->set_url($workshop->submission_url(), array('cmid' => $cmid, 'id' => $id, 'edit' => $edit));
+$PAGE->set_url($workshop->submission_url(), array('cmid' => $cmid, 'id' => $id));
+
+if ($edit) {
+ $PAGE->url->param('edit', $edit);
+}
if ($id) { // submission is specified
$submission = $workshop->get_submission_by_id($id);

0 comments on commit 08282ec

Please sign in to comment.