MDL-23784 converted question types to use new pix API and locations
authorPetr Skoda <skodak@moodle.org>
Thu, 12 Aug 2010 19:01:28 +0000 (19:01 +0000)
committerPetr Skoda <skodak@moodle.org>
Thu, 12 Aug 2010 19:01:28 +0000 (19:01 +0000)
16 files changed:
lib/questionlib.php
question/type/calculated/pix/icon.gif [moved from question/type/calculated/icon.gif with 100% similarity]
question/type/calculatedmulti/pix/icon.gif [moved from question/type/calculatedmulti/icon.gif with 100% similarity]
question/type/calculatedsimple/pix/icon.gif [moved from question/type/calculatedsimple/icon.gif with 100% similarity]
question/type/description/pix/icon.gif [moved from question/type/description/icon.gif with 100% similarity]
question/type/essay/pix/icon.gif [moved from question/type/essay/icon.gif with 100% similarity]
question/type/match/pix/icon.gif [moved from question/type/match/icon.gif with 100% similarity]
question/type/missingtype/pix/icon.gif [moved from question/type/missingtype/icon.gif with 100% similarity]
question/type/multianswer/pix/icon.gif [moved from question/type/multianswer/icon.gif with 100% similarity]
question/type/multianswer/questiontype.php
question/type/multichoice/pix/icon.gif [moved from question/type/multichoice/icon.gif with 100% similarity]
question/type/numerical/pix/icon.gif [moved from question/type/numerical/icon.gif with 100% similarity]
question/type/random/pix/icon.gif [moved from question/type/random/icon.gif with 100% similarity]
question/type/randomsamatch/pix/icon.gif [moved from question/type/randomsamatch/icon.gif with 100% similarity]
question/type/shortanswer/pix/icon.gif [moved from question/type/shortanswer/icon.gif with 100% similarity]
question/type/truefalse/pix/icon.gif [moved from question/type/truefalse/icon.gif with 100% similarity]

index c05efd2..c359637 100644 (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;
index 35f51e8..9f1b47e 100644 (file)
@@ -302,7 +302,7 @@ class embedded_cloze_qtype extends default_questiontype {
         // adding an icon with alt to warn user this is a fill in the gap question
         // MDL-7497
         if (!empty($USER->screenreader)) {
-            echo "<img src=\"$CFG->wwwroot/question/type/$question->qtype/icon.gif\" ".
+            echo "<img src=\"".$OUTPUT->pix_url('icon', 'qtype_'.$question->qtype)."\" ".
                 "class=\"icon\" alt=\"".get_string('clozeaid','qtype_multichoice')."\" />  ";
         }