From: jamiesensei Date: Tue, 14 Aug 2007 02:50:56 +0000 (+0000) Subject: fix for MDL-10835 Results and Preview Tabs broken - requred param 'cmid' missing... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9f877cb07250c62db928a73d3d42fb5b8d227e86;p=moodle.git fix for MDL-10835 Results and Preview Tabs broken - requred param 'cmid' missing (for quiz with no questions) --- diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index e50ec7712b..3f1ae33448 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -62,7 +62,7 @@ // if no questions have been set up yet redirect to edit.php if (!$quiz->questions and has_capability('mod/quiz:manage', $context)) { - redirect('edit.php?quizid=' . $quiz->id); + redirect('edit.php?cmid='.$cm->id); } // Get number for the next or unfinished attempt @@ -412,9 +412,9 @@ $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); $navlinks[] = array('name' => $strattemptnum, 'link' => '', 'type' => 'title'); - + $navigation = build_navigation($navlinks); - + print_header_simple(format_string($quiz->name), "", $navigation, "", $headtags, true, $strupdatemodule); } diff --git a/mod/quiz/report.php b/mod/quiz/report.php index 4ffaa4dddd..fcb7f7daf2 100644 --- a/mod/quiz/report.php +++ b/mod/quiz/report.php @@ -41,10 +41,10 @@ // if no questions have been set up yet redirect to edit.php if (!$quiz->questions and has_capability('mod/quiz:manage', $context)) { - redirect('edit.php?quizid='.$quiz->id); + redirect('edit.php?cmid='.$cm->id); } - // Upgrade any attempts that have not yet been upgraded to the + // Upgrade any attempts that have not yet been upgraded to the // Moodle 1.5 model (they will not yet have the timestamp set) if ($attempts = get_records_sql("SELECT a.*". " FROM {$CFG->prefix}quiz_attempts a, {$CFG->prefix}question_states s".