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:
tjhunt 2007-04-24 16:59:23 +00:00
parent 9cb2c25061
commit 443768b8aa
6 changed files with 28 additions and 26 deletions

View file

@ -275,11 +275,8 @@ function quiz_print_question_list($quiz, $allowdelete=true, $showbreaks=true, $r
echo '</td><td align="center">';
$context = $quiz->id ? '&amp;contextquiz='.$quiz->id : '';
$quiz_id = $quiz->id ? '&amp;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\">

View file

@ -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 ? '&amp;contextquiz='.$quiz->id : '';
$quiz_id = $quiz->id ? '&amp;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 . '&amp;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
*

View file

@ -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";