MDL-19813 Upgraded calls to link_to_popup_window()
This commit is contained in:
+10
-3
@@ -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',
|
||||
"<img src=\"" . $OUTPUT->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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 = '<del>'.$oldgrade.'</del><br />'.
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user