Direct link to quiz questions page

Direct link to quiz questions page

by Gustav W Delius -
Number of replies: 3

Currently, in order to get to the page on which one can change the list of questions included in a quiz one has first go to the page where one can change the quiz options and then click on "Continue". I would find it more convenient to have a direct link to the question editing page. I have implemented that with a second button on view.php, see attached screenshot. The "Edit questions" button brings me to the question editing page for the quiz and the "Update quiz" button brings me to the page where I set the quiz name, description and options. Can I submit that to Moodle 1.5dev?

Attachment Image1.gif
Average of ratings: -
In reply to Gustav W Delius

Re: Direct link to quiz questions page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I like the idea, though it would be good if there was also a "save and edit questions" button on the quiz editing page so that the current flow can be maintained if preferred.
In reply to Martin Dougiamas

Re: Direct link to quiz questions page

by Gustav W Delius -

The easiest way to do this would be to change the lines

$SESSION->returnpage = "$CFG->wwwroot/mod/$mod->modulename/view.php?id=$mod->coursemodule";

in course/mod.php to

if (isset($mod->redirect)) {
    $SESSION->returnpage = $mod->redirecturl;
} else {
    $SESSION->returnpage = "$CFG->wwwroot/mod/$mod->modulename/view.php?id=$mod->coursemodule";
}

because then such a submit button that leads to somewhere else could simply be realized as

<input type="hidden" name="redirecturl" value="some URL" />
<input type="submit" name="redirect" value="some buttontext" />

Is that acceptable?