MDL-23784 converted question types to use new pix API and locations

This commit is contained in:
Petr Skoda
2010-08-12 19:01:28 +00:00
parent 3002e7fd98
commit 0c3c54934a
16 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -1834,15 +1834,14 @@ function question_apply_penalty_and_timelimit(&$question, &$state, $attempt, $cm
* @param boolean $return If true the functions returns the link as a string
*/
function print_question_icon($question, $return = false) {
global $QTYPES, $CFG;
global $QTYPES, $CFG, $OUTPUT;
if (array_key_exists($question->qtype, $QTYPES)) {
$namestr = $QTYPES[$question->qtype]->local_name();
} else {
$namestr = 'missingtype';
}
$html = '<img src="' . $CFG->wwwroot . '/question/type/' .
$question->qtype . '/icon.gif" alt="' .
$html = '<img src="' . $OUTPUT->pix_url('icon', 'qtype_'.$question->qtype) . '" alt="' .
$namestr . '" title="' . $namestr . '" />';
if ($return) {
return $html;