mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-15693 - print_question_icon does not cope with missing question types
This commit is contained in:
parent
38e554420b
commit
b9d4b03134
@ -1610,7 +1610,11 @@ function question_apply_penalty_and_timelimit(&$question, &$state, $attempt, $cm
|
||||
function print_question_icon($question, $return = false) {
|
||||
global $QTYPES, $CFG;
|
||||
|
||||
$namestr = $QTYPES[$question->qtype]->menu_name();
|
||||
if (array_key_exists($question->qtype, $QTYPES)) {
|
||||
$namestr = $QTYPES[$question->qtype]->menu_name();
|
||||
} else {
|
||||
$namestr = 'missingtype';
|
||||
}
|
||||
$html = '<img src="' . $CFG->wwwroot . '/question/type/' .
|
||||
$question->qtype . '/icon.gif" alt="' .
|
||||
$namestr . '" title="' . $namestr . '" />';
|
||||
|
Loading…
x
Reference in New Issue
Block a user