mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-9565 - Question preview links don't work in developer debug mode, and not XHTML strict. Merged from OU Moodle.
This commit is contained in:
parent
9cb2c25061
commit
443768b8aa
6 changed files with 28 additions and 26 deletions
|
@ -302,14 +302,14 @@ function question_list($course, $categoryid, $quizid=0,
|
|||
|
||||
// add to quiz
|
||||
if ($editingquiz) {
|
||||
echo "<a title=\"$straddtoquiz\" href=\"edit.php?addquestion=$question->id&quizid=$quizid&sesskey=$USER->sesskey\"><img
|
||||
echo "<a title=\"$straddtoquiz\" href=\"$CFG->wwwroot/question/edit.php?addquestion=$question->id&quizid=$quizid&sesskey=$USER->sesskey\"><img
|
||||
src=\"$CFG->pixpath/t/moveleft.gif\" alt=\"$straddtoquiz\" /></a> ";
|
||||
}
|
||||
|
||||
// preview
|
||||
echo "<a title=\"$strpreview\" href=\"javascript:void();\" onclick=\"openpopup('/question/preview.php?id=$question->id&quizid=$quizid','$strpreview', " .
|
||||
QUESTION_PREVIEW_POPUP_OPTIONS . ", false)\"><img
|
||||
src=\"$CFG->pixpath/t/preview.gif\" alt=\"$strpreview\" /></a> ";
|
||||
link_to_popup_window('/question/preview.php?id=' . $question->id . '&quizid=' . $quizid, 'questionpreview',
|
||||
"<img src=\"$CFG->pixpath/t/preview.gif\" class=\"iconsmall\" alt=\"$strpreview\" />",
|
||||
0, 0, $strpreview, QUESTION_PREVIEW_POPUP_OPTIONS);
|
||||
|
||||
// edit, hide, delete question, using question capabilities, not quiz capabilieies
|
||||
if ($canedit) {
|
||||
|
@ -317,10 +317,10 @@ function question_list($course, $categoryid, $quizid=0,
|
|||
src=\"$CFG->pixpath/t/edit.gif\" alt=\"$stredit\" /></a> ";
|
||||
// hide-feature
|
||||
if($question->hidden) {
|
||||
echo "<a title=\"$strrestore\" href=\"edit.php?courseid=$course->id&unhide=$question->id&sesskey=$USER->sesskey\"><img
|
||||
echo "<a title=\"$strrestore\" href=\"$CFG->wwwroot/question/edit.php?courseid=$course->id&unhide=$question->id&sesskey=$USER->sesskey\"><img
|
||||
src=\"$CFG->pixpath/t/restore.gif\" alt=\"$strrestore\" /></a>";
|
||||
} else {
|
||||
echo "<a title=\"$strdelete\" href=\"edit.php?courseid=$course->id&deleteselected=$question->id&q$question->id=1\"><img
|
||||
echo "<a title=\"$strdelete\" href=\"$CFG->wwwroot/question/edit.php?courseid=$course->id&deleteselected=$question->id&q$question->id=1\"><img
|
||||
src=\"$CFG->pixpath/t/delete.gif\" alt=\"$strdelete\" /></a>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,9 +51,12 @@
|
|||
unset($SESSION->quizpreview);
|
||||
// Redirect to ourselves but with continue=1; prevents refreshing the page
|
||||
// from restarting an attempt (needed so that random questions don't change)
|
||||
$quizid = $quizid ? '&quizid=' . $quizid : '';
|
||||
redirect($CFG->wwwroot . '/question/preview.php?id=' . $id . $quizid .
|
||||
'&continue=1');
|
||||
$url = $CFG->wwwroot . '/question/preview.php?id=' . $id;
|
||||
if ($quizid) {
|
||||
$url .= '&quizid=' . $quizid;
|
||||
}
|
||||
$url .= '&continue=1';
|
||||
redirect($url);
|
||||
}
|
||||
|
||||
if (empty($quizid)) {
|
||||
|
@ -179,7 +182,9 @@
|
|||
}
|
||||
|
||||
$strpreview = get_string('preview', 'quiz').' '.format_string($questions[$id]->name);
|
||||
print_header($strpreview);
|
||||
$questionlist = array($id);
|
||||
$headtags = get_html_head_contributions($questionlist, $questions, $states[$historylength]);
|
||||
print_header($strpreview, '', '', '', $headtags);
|
||||
print_heading($strpreview);
|
||||
|
||||
if (!empty($quizid)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue