diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php
index eafe14f0081..8166e8d8487 100644
--- a/mod/quiz/locallib.php
+++ b/mod/quiz/locallib.php
@@ -821,9 +821,16 @@ function quiz_question_preview_button($quiz, $question, $label = false) {
}
// Build the icon.
- return link_to_popup_window('/question/preview.php?id=' . $question->id . '&quizid=' . $quiz->id, 'questionpreview',
- "
old_icon_url('t/preview') . "\" class=\"iconsmall\" alt=\"$strpreviewquestion\" /> $strpreviewlabel",
- 0, 0, $strpreviewquestion, QUESTION_PREVIEW_POPUP_OPTIONS, true);
+ $image = new html_image();
+ $image->src = $OUTPUT->old_icon_url('t/preview');
+ $image->add_class('iconsmall');
+ $image->alt = $strpreviewquestion;
+
+ $link = html_link::make("/question/preview.php?id=$question->id&quizid=$quiz->id", $strpreviewlabel);
+ parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
+ $link->add_action(new popup_action('click', $link->url, 'questionpreview', $options));
+ $link->title = $strpreviewquestion;
+ return $OUTPUT->link_to_popup($link, $image);
}
/**
diff --git a/mod/quiz/report/overview/overview_table.php b/mod/quiz/report/overview/overview_table.php
index 5f28958a578..7917f10edcd 100644
--- a/mod/quiz/report/overview/overview_table.php
+++ b/mod/quiz/report/overview/overview_table.php
@@ -206,6 +206,7 @@ class quiz_report_overview_table extends table_sql {
* @return string the contents of the cell.
*/
function other_cols($colname, $attempt){
+ global $OUTPUT;
if (preg_match('/^qsgrade([0-9]+)$/', $colname, $matches)){
$questionid = $matches[1];
@@ -226,11 +227,12 @@ class quiz_report_overview_table extends table_sql {
$grade = ''.$oldgrade.'
'.
$newgrade;
}
- $linktopopup = link_to_popup_window('/mod/quiz/reviewquestion.php?attempt=' .
- $attempt->attempt . '&question=' . $question->id,
- 'reviewquestion', $grade, 450, 650,
- get_string('reviewresponsetoq', 'quiz', $question->formattedname),
- 'none', true);
+
+ $link = html_link::make("/mod/quiz/reviewquestion.php?attempt=$attempt->attempt&question=$question->id", $grade);
+ $link->add_action(new popup_action('click', $link->url, 'reviewquestion', array('height' => 450, 'width' => 650)));
+ $link->title = get_string('reviewresponsetoq', 'quiz', $question->formattedname);
+ $linktopopup = $OUTPUT->link($link);
+
if (($this->questions[$questionid]->maxgrade != 0)){
$fractionofgrade = $stateforqinattempt->grade
/ $this->questions[$questionid]->maxgrade;
@@ -241,7 +243,7 @@ class quiz_report_overview_table extends table_sql {
} else {
return $linktopopup;
}
-
+
} else {
return $grade;
}
diff --git a/mod/quiz/report/responses/responses_table.php b/mod/quiz/report/responses/responses_table.php
index e89d08ea5f6..2f968b4ba85 100644
--- a/mod/quiz/report/responses/responses_table.php
+++ b/mod/quiz/report/responses/responses_table.php
@@ -137,7 +137,7 @@ class quiz_report_responses_table extends table_sql {
}
}
function other_cols($colname, $attempt){
- global $QTYPES;
+ global $QTYPES, $OUTPUT;
static $states =array();
if (preg_match('/^qsanswer([0-9]+)$/', $colname, $matches)){
if ($attempt->uniqueid == 0) {
@@ -158,16 +158,16 @@ class quiz_report_responses_table extends table_sql {
} else {
$formathtml = false;
}
-
+
$summary = $QTYPES[$question->qtype]->response_summary($question, $stateforqinattempt,
QUIZ_REPORT_RESPONSES_MAX_LEN_TO_DISPLAY, $formathtml);
if (!$this->is_downloading()) {
if ($summary){
- $summary = link_to_popup_window('/mod/quiz/reviewquestion.php?attempt=' .
- $attempt->attempt . '&question=' . $question->id,
- 'reviewquestion', $summary, 450, 650,
- get_string('reviewresponsetoq', 'quiz', $question->formattedname),
- 'none', true);
+ $link = html_link::make("/mod/quiz/reviewquestion.php?attempt=$attempt->attempt&question=$question->id", $summary);
+ $link->add_action(new popup_action('click', $link->url, 'reviewquestion', array('height' => 450, 'width' => 650)));
+ $link->title = $question->formattedname;
+ $summary = $OUTPUT->link($link);
+
if (question_state_is_graded($stateforqinattempt)
&& ($question->maxgrade > 0)){
$grade = $stateforqinattempt->grade