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

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;

View File

Before

Width:  |  Height:  |  Size: 78 B

After

Width:  |  Height:  |  Size: 78 B

View File

Before

Width:  |  Height:  |  Size: 909 B

After

Width:  |  Height:  |  Size: 909 B

View File

Before

Width:  |  Height:  |  Size: 896 B

After

Width:  |  Height:  |  Size: 896 B

View File

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

View File

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 104 B

View File

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 149 B

View File

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View File

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 84 B

View 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')."\" /> ";
}

View File

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View File

Before

Width:  |  Height:  |  Size: 78 B

After

Width:  |  Height:  |  Size: 78 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 152 B

After

Width:  |  Height:  |  Size: 152 B

View File

Before

Width:  |  Height:  |  Size: 68 B

After

Width:  |  Height:  |  Size: 68 B

View File

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B