mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +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
|
@ -275,11 +275,8 @@ function quiz_print_question_list($quiz, $allowdelete=true, $showbreaks=true, $r
|
|||
echo '</td><td align="center">';
|
||||
|
||||
$context = $quiz->id ? '&contextquiz='.$quiz->id : '';
|
||||
$quiz_id = $quiz->id ? '&quizid=' . $quiz->id : '';
|
||||
if ($question->qtype != 'random') {
|
||||
echo "<a title=\"$strpreview\" href=\"javascript:void(0)\" onclick=\"openpopup('/question/preview.php?id=$qnum$quiz_id','questionpreview', " .
|
||||
QUESTION_PREVIEW_POPUP_OPTIONS . ", false)\">
|
||||
<img src=\"$CFG->pixpath/t/preview.gif\" class=\"iconsmall\" alt=\"$strpreview\" /></a>";
|
||||
quiz_question_preview_button($quiz, $question);
|
||||
}
|
||||
if ($canedit) {
|
||||
echo "<a title=\"$stredit\" href=\"$CFG->wwwroot/question/question.php?id=$qnum$context\">
|
||||
|
|
|
@ -600,19 +600,19 @@ function quiz_upgrade_states($attempt) {
|
|||
}
|
||||
}
|
||||
|
||||
// ULPGc ecastro
|
||||
function quiz_get_question_review($quiz, $question) {
|
||||
// returns a question icon
|
||||
$qnum = $question->id;
|
||||
/**
|
||||
* @param object $quiz the quiz
|
||||
* @param object $question the question
|
||||
* @return the HTML for a preview question icon.
|
||||
*/
|
||||
function quiz_question_preview_button($quiz, $question) {
|
||||
global $CFG;
|
||||
$strpreview = get_string('previewquestion', 'quiz');
|
||||
$context = $quiz->id ? '&contextquiz='.$quiz->id : '';
|
||||
$quiz_id = $quiz->id ? '&quizid=' . $quiz->id : '';
|
||||
return "<a title=\"$strpreview\" href=\"javascript:void(0)\" onclick=\"openpopup('/question/preview.php?id=$qnum$quiz_id','questionpreview', " .
|
||||
QUESTION_PREVIEW_POPUP_OPTIONS . ", false)\">
|
||||
<img src=\"../../pix/t/preview.gif\" class=\"iconsmall\" alt=\"$strpreview\" /></a>";
|
||||
return link_to_popup_window('/question/preview.php?id=' . $question->id . '&quizid=' . $quiz->id, 'questionpreview',
|
||||
"<img src=\"$CFG->pixpath/t/preview.gif\" class=\"iconsmall\" alt=\"$strpreview\" />",
|
||||
0, 0, $strpreview, QUESTION_PREVIEW_POPUP_OPTIONS, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine render options
|
||||
*
|
||||
|
|
|
@ -312,7 +312,7 @@ class quiz_report extends quiz_default_report {
|
|||
$qnumber = " (".link_to_popup_window('/question/question.php?id='.$qid,'editquestion', $qid, 450, 550, get_string('edit'), 'none', true ).") ";
|
||||
$qname = '<div class="qname">'.format_text($question->name." : ", $question->questiontextformat, $format_options, $quiz->course).'</div>';
|
||||
$qicon = print_question_icon($question, true);
|
||||
$qreview = quiz_get_question_review($quiz, $question);
|
||||
$qreview = quiz_question_preview_button($quiz, $question);
|
||||
$qtext = format_text($question->questiontext, $question->questiontextformat, $format_options, $quiz->course);
|
||||
$qquestion = $qname."\n".$qtext."\n";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue