diff --git a/archive_options.php b/archive_options.php index 6003b9f..c73fa05 100644 --- a/archive_options.php +++ b/archive_options.php @@ -88,8 +88,16 @@ public function setup_from_form_data($fromform) { * Set the fields of this object from the URL parameters. */ public function setup_from_params() { - $this->showright = optional_param('right', $this->showright, PARAM_BOOL); - $this->showhistory = optional_param('history', $this->showhistory, PARAM_BOOL); + if (optional_param('right', $this->showright, PARAM_BOOL)) { + $this->showright = 1; + } else { + $this->showright = 0; + } + if (optional_param('history', $this->showhistory, PARAM_BOOL)) { + $this->showhistory = 1; + } else { + $this->showhistory = 0; + } } /** diff --git a/report.php b/report.php index 241cacd..492c165 100644 --- a/report.php +++ b/report.php @@ -345,13 +345,15 @@ protected function quiz_report_get_student_attempt($attemptid, $userid) { $displayoptions = $attemptobj->get_display_options_with_edit_link(true, $slot, ""); $displayoptions->marks = 2; $displayoptions->manualcomment = 1; + $displayoptions->manualcommentlink = new moodle_url('/mod/quiz/comment.php', ['attempt' => $attempt->id]); $displayoptions->feedback = 1; $displayoptions->history = $this->options->showhistory; $displayoptions->rightanswer = $this->options->showright; $displayoptions->correctness = 1; $displayoptions->numpartscorrect = 1; $displayoptions->flags = 1; - $displayoptions->manualcommentlink = 0; + $displayoptions->editquestionparams['cmid'] = $this->cm->id; + $displayoptions->editquestionparams['returnurl'] = new moodle_url('/mod/quiz/edit.php', ['cmid' => $this->cm->id]); if ($slot != $originalslot) { $attemptobj->get_question_attempt($slot)->set_max_mark(