quiz / questions: MDL-17919 Bad link edit questions from quiz preview page.
Thanks to Ann Adamcik for noticing this. It was a regression from MDL-6085.
This commit is contained in:
@@ -464,6 +464,7 @@
|
||||
|
||||
// Start the form
|
||||
$quiz->thispageurl = $CFG->wwwroot . '/mod/quiz/attempt.php?q=' . s($quiz->id) . '&page=' . s($page);
|
||||
$quiz->cmid = $cm->id;
|
||||
echo '<form id="responseform" method="post" action="', $quiz->thispageurl . '" enctype="multipart/form-data"' .
|
||||
' onclick="this.autocomplete=\'off\'" onkeypress="return check_enter(event);">', "\n";
|
||||
if($quiz->timelimit > 0) {
|
||||
|
||||
@@ -278,6 +278,7 @@
|
||||
|
||||
/// Print all the questions
|
||||
$quiz->thispageurl = $CFG->wwwroot . '/mod/quiz/review.php?attempt=' . $attempt->id . $urloptions;
|
||||
$quiz->cmid = $cm->id;
|
||||
$number = quiz_first_questionnumber($attempt->layout, $pagelist);
|
||||
foreach ($pagequestions as $i) {
|
||||
if (!isset($questions[$i])) {
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
|
||||
$baseurl = $CFG->wwwroot . '/mod/quiz/reviewquestion.php?question=' . $question->id . '&number=' . $number . '&attempt=';
|
||||
$quiz->thispageurl = $baseurl . $attempt->id;
|
||||
$quiz->cmid = $cm->id;
|
||||
|
||||
$session = get_record('question_sessions', 'attemptid', $attempt->uniqueid, 'questionid', $question->id);
|
||||
$state->sumpenalty = $session->sumpenalty;
|
||||
|
||||
@@ -877,7 +877,7 @@ class default_questiontype {
|
||||
* @param object $question the question object.
|
||||
* @param object $cmoptions the options from the module. If $cmoptions->thispageurl is set
|
||||
* then the link will be to edit the question in this browser window, then return to
|
||||
* $cmoptions->thispageurl. Otherwise the link will be to edit in a popup.
|
||||
* $cmoptions->thispageurl. Otherwise the link will be to edit in a popup. $cmoptions->cmid should also be set.
|
||||
* @return string the HTML of the link, or nothing it the currenty user is not allowed to edit.
|
||||
*/
|
||||
function get_question_edit_link($question, $cmoptions, $options) {
|
||||
@@ -890,8 +890,8 @@ class default_questiontype {
|
||||
|
||||
/// Work out the right URL.
|
||||
$linkurl = '/question/question.php?id=' . $question->id;
|
||||
if (!empty($cmoptions->id)) {
|
||||
$linkurl .= '&cmid=' . $cmoptions->id;
|
||||
if (!empty($cmoptions->cmid)) {
|
||||
$linkurl .= '&cmid=' . $cmoptions->cmid;
|
||||
} else if (!empty($cmoptions->course)) {
|
||||
$linkurl .= '&courseid=' . $cmoptions->course;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user