MDL-36638 usability: Core changes for new quiz/question icons
authorFrederic Massart <fred@moodle.com>
Tue, 27 Nov 2012 08:52:13 +0000 (16:52 +0800)
committerFrederic Massart <fred@moodle.com>
Thu, 29 Nov 2012 04:41:29 +0000 (12:41 +0800)
18 files changed:
backup/util/ui/backup_ui_setting.class.php
backup/util/ui/renderer.php
blog/external_blogs.php
cache/renderer.php
mod/lti/mod_form.php
mod/quiz/lib.php
mod/quiz/renderer.php
mod/quiz/report/attemptsreport_table.php
mod/quiz/styles.css
mod/resource/lib.php
mod/workshop/allocation/scheduled/settings_form.php
pix/i/grade_partiallycorrect.png [moved from pix/i/grade_partial.png with 100% similarity]
pix/i/grade_partiallycorrect.svg [moved from pix/i/grade_partial.svg with 100% similarity]
question/editlib.php
question/engine/renderer.php
question/type/rendererbase.php
theme/base/style/question.css
theme/upgrade.txt

index c18d463..c778fb7 100644 (file)
@@ -400,9 +400,9 @@ class backup_setting_ui_checkbox extends backup_setting_ui {
         global $OUTPUT;
         // Checkboxes are always yes or no
         if ($this->get_value()) {
-            return $OUTPUT->pix_icon('i/tick_green_big', get_string('yes'));
+            return $OUTPUT->pix_icon('i/valid', get_string('yes'));
         } else {
-            return $OUTPUT->pix_icon('i/cross_red_big', get_string('no'));
+            return $OUTPUT->pix_icon('i/invalid', get_string('no'));
         }
     }
 
index 2a5f3da..c58f367 100644 (file)
@@ -72,8 +72,8 @@ class core_backup_renderer extends plugin_renderer_base {
      * @return string
      */
     public function backup_details($details, $nextstageurl) {
-        $yestick = $this->output->pix_icon('i/tick_green_big', get_string('yes'));
-        $notick = $this->output->pix_icon('i/cross_red_big', get_string('no'));
+        $yestick = $this->output->pix_icon('i/valid', get_string('yes'));
+        $notick = $this->output->pix_icon('i/valid', get_string('no'));
 
         $html  = html_writer::start_tag('div', array('class'=>'backup-restore'));
 
index bc91d40..57af11a 100644 (file)
@@ -81,9 +81,9 @@ if (!empty($blogs)) {
 
     foreach ($blogs as $blog) {
         if ($blog->failedlastsync) {
-            $validicon = $OUTPUT->pix_icon('i/cross_red_big', get_string('feedisinvalid', 'blog'));
+            $validicon = $OUTPUT->pix_icon('i/invalid', get_string('feedisinvalid', 'blog'));
         } else {
-            $validicon = $OUTPUT->pix_icon('i/tick_green_big', get_string('feedisvalid', 'blog'));
+            $validicon = $OUTPUT->pix_icon('i/valid', get_string('feedisvalid', 'blog'));
         }
 
         $editurl = new moodle_url('/blog/external_blog_edit.php', array('id' => $blog->id));
index 81e86b1..7e55df8 100644 (file)
@@ -101,7 +101,7 @@ class core_cache_renderer extends plugin_renderer_base {
             $row = new html_table_row(array(
                 $storename,
                 get_string('pluginname', 'cachestore_'.$store['plugin']),
-                ($store['isready'] && $store['requirementsmet']) ? $this->output->pix_icon('i/tick_green_small', '1') : '',
+                ($store['isready'] && $store['requirementsmet']) ? $this->output->pix_icon('i/valid', '1') : '',
                 $store['mappings'],
                 join(', ', $modes),
                 join(', ', $supports),
@@ -171,7 +171,7 @@ class core_cache_renderer extends plugin_renderer_base {
 
             $row = new html_table_row(array(
                 $plugin['name'],
-                ($plugin['requirementsmet']) ? $this->output->pix_icon('i/tick_green_small', '1') : '',
+                ($plugin['requirementsmet']) ? $this->output->pix_icon('i/valid', '1') : '',
                 $plugin['instances'],
                 join(', ', $modes),
                 join(', ', $supports),
@@ -321,7 +321,7 @@ class core_cache_renderer extends plugin_renderer_base {
             // Useful later: get_string('actions', 'cache').
         );
         $table->data = array();
-        $tick = $this->output->pix_icon('i/tick_green_big', '');
+        $tick = $this->output->pix_icon('i/valid', '');
         foreach ($locks as $lock) {
             $table->data[] = new html_table_row(array(
                 new html_table_cell($lock['name']),
index ec1b5bf..377c07d 100644 (file)
@@ -201,7 +201,7 @@ class mod_lti_mod_form extends moodleform_mod {
                         'edit_icon_url' => (string)$OUTPUT->pix_url('t/edit'),
                         'add_icon_url' => (string)$OUTPUT->pix_url('t/add'),
                         'delete_icon_url' => (string)$OUTPUT->pix_url('t/delete'),
-                        'green_check_icon_url' => (string)$OUTPUT->pix_url('i/tick_green_small'),
+                        'green_check_icon_url' => (string)$OUTPUT->pix_url('i/valid'),
                         'warning_icon_url' => (string)$OUTPUT->pix_url('warning', 'lti'),
                         'instructor_tool_type_edit_url' => $editurl->out(false),
                         'ajax_url' => $ajaxurl->out(true),
index ad918bd..42550fc 100644 (file)
@@ -1648,7 +1648,7 @@ function quiz_extend_settings_navigation($settings, $quiznode) {
                 array('cmid'=>$PAGE->cm->id, 'sesskey'=>sesskey()));
         $node = navigation_node::create(get_string('preview', 'quiz'), $url,
                 navigation_node::TYPE_SETTING, null, 'mod_quiz_preview',
-                new pix_icon('t/preview', ''));
+                new pix_icon('i/preview', ''));
         $quiznode->add_node($node, $beforekey);
     }
 
index 759cd76..66bc79d 100644 (file)
@@ -590,7 +590,7 @@ class mod_quiz_renderer extends plugin_renderer_base {
             $flag = '';
             if ($attemptobj->is_question_flagged($slot)) {
                 $flag = html_writer::empty_tag('img', array('src' => $this->pix_url('i/flagged'),
-                        'alt' => get_string('flagged', 'question'), 'class' => 'questionflag'));
+                        'alt' => get_string('flagged', 'question'), 'class' => 'questionflag icon-post'));
             }
             if ($attemptobj->can_navigate_to($slot)) {
                 $row = array(html_writer::link($attemptobj->attempt_url($slot),
index 4b57900..1f3270e 100644 (file)
@@ -242,18 +242,17 @@ abstract class quiz_attempts_report_table extends table_sql {
 
         $flag = '';
         if ($stepdata->flagged) {
-            $flag = ' ' . $OUTPUT->pix_icon('i/flagged', get_string('flagged', 'question'),
+            $flag = $OUTPUT->pix_icon('i/flagged', get_string('flagged', 'question'),
                     'moodle', array('class' => 'questionflag'));
         }
 
         $feedbackimg = '';
         if ($state->is_finished() && $state != question_state::$needsgrading) {
-            $feedbackimg = ' ' . $this->icon_for_fraction($stepdata->fraction);
+            $feedbackimg = $this->icon_for_fraction($stepdata->fraction);
         }
 
-        $output = html_writer::tag('span', html_writer::tag('span',
-                $data . $feedbackimg . $flag,
-                array('class' => $state->get_state_class(true))), array('class' => 'que'));
+        $output = html_writer::tag('span', $feedbackimg . html_writer::tag('span',
+                $data, array('class' => $state->get_state_class(true))) . $flag, array('class' => 'que'));
 
         $url = new moodle_url('/mod/quiz/reviewquestion.php',
                 array('attempt' => $attempt->attempt, 'slot' => $slot));
@@ -275,11 +274,11 @@ abstract class quiz_attempts_report_table extends table_sql {
 
         $state = question_state::graded_state_for_fraction($fraction);
         if ($state == question_state::$gradedright) {
-            $icon = 'i/tick_green_big';
+            $icon = 'i/grade_correct';
         } else if ($state == question_state::$gradedpartial) {
-            $icon = 'i/tick_amber_big';
+            $icon = 'i/grade_partiallycorrect';
         } else {
-            $icon = 'i/cross_red_big';
+            $icon = 'i/grade_incorrect';
         }
 
         return $OUTPUT->pix_icon($icon, get_string($state->get_feedback_class(), 'question'),
index 021a2ef..6d8d193 100644 (file)
@@ -127,7 +127,7 @@ table.quizattemptsummary .noreviewmessage {color: gray;}
 
 /** Mod quiz summary **/
 #page-mod-quiz-summary #content {text-align: center;}
-#page-mod-quiz-summary .questionflag {width: 16px;height: 16px;vertical-align: middle;}
+#page-mod-quiz-summary .questionflag { vertical-align: text-bottom; }
 #page-mod-quiz-summary #quiz-timer {text-align: center; margin-top: 1em;}
 #page-mod-quiz-summary .submitbtns {margin-top: 1.5em;}
 @media print {
@@ -170,7 +170,8 @@ table.quizreviewsummary td.cell {padding: 1px 1em 1px 0.5em;text-align: left;bac
 #page-mod-quiz-report table#attempts.grades span.que,
 #page-mod-quiz-report table#attempts span.avgcell {white-space: nowrap;}
 #page-mod-quiz-report table#attempts span.que .requiresgrading {white-space: normal;}
-#page-mod-quiz-report table#attempts .questionflag {width: 16px; height: 16px; vertical-align: middle;}
+#page-mod-quiz-report table#attempts .questionflag { vertical-align: text-bottom; padding-left: 6px; }
+.dir-rtl#page-mod-quiz-report table#attempts .questionflag { padding-right: 6px; padding-left: 0; }
 
 #page-mod-quiz-report .graph.flexible-wrap {text-align:center; overflow:auto;}
 
index 65ae201..e102b37 100644 (file)
@@ -249,7 +249,7 @@ function resource_get_coursemodule_info($coursemodule) {
     }
 
     if ($resource->tobemigrated) {
-        $info->icon ='i/cross_red_big';
+        $info->icon ='i/invalid';
         return $info;
     }
     $fs = get_file_storage();
index 172506d..129be65 100644 (file)
@@ -64,23 +64,23 @@ class workshop_scheduled_allocator_form extends workshop_random_allocator_form {
         if ($current === false) {
             $mform->addElement('static', 'infostatus', get_string('currentstatusexecution', 'workshopallocation_scheduled'),
                 get_string('resultdisabled', 'workshopallocation_scheduled').' '.
-                html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/block'))));
+                html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/invalid'))));
 
         } else {
             if (!empty($current->timeallocated)) {
                 $mform->addElement('static', 'infostatus', get_string('currentstatusexecution', 'workshopallocation_scheduled'),
                     get_string('currentstatusexecution1', 'workshopallocation_scheduled', $strtimeexecuted).' '.
-                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/tick_green_big'))));
+                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/valid'))));
 
                 if ($current->resultstatus == workshop_allocation_result::STATUS_EXECUTED) {
                     $strstatus = get_string('resultexecuted', 'workshopallocation_scheduled').' '.
-                        html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/tick_green_big')));
+                        html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/valid')));
                 } else if ($current->resultstatus == workshop_allocation_result::STATUS_FAILED) {
                     $strstatus = get_string('resultfailed', 'workshopallocation_scheduled').' '.
-                        html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/cross_red_big')));
+                        html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/invalid')));
                 } else {
                     $strstatus = get_string('resultvoid', 'workshopallocation_scheduled').' '.
-                        html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/cross_red_big')));
+                        html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/invalid')));
                 }
 
                 if (!empty($current->resultmessage)) {
@@ -91,7 +91,7 @@ class workshop_scheduled_allocator_form extends workshop_random_allocator_form {
                 if ($current->timeallocated < $workshop->submissionend) {
                     $mform->addElement('static', 'infoexpected', get_string('currentstatusnext', 'workshopallocation_scheduled'),
                         get_string('currentstatusexecution2', 'workshopallocation_scheduled', $strtimeexpected).' '.
-                        html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/tick_amber_big'))));
+                        html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/caution'))));
                     $mform->addHelpButton('infoexpected', 'currentstatusnext', 'workshopallocation_scheduled');
                 } else {
                     $mform->addElement('checkbox', 'reenablescheduled', get_string('currentstatusreset', 'workshopallocation_scheduled'),
@@ -102,19 +102,19 @@ class workshop_scheduled_allocator_form extends workshop_random_allocator_form {
             } else if (empty($current->enabled)) {
                 $mform->addElement('static', 'infostatus', get_string('currentstatusexecution', 'workshopallocation_scheduled'),
                     get_string('resultdisabled', 'workshopallocation_scheduled').' '.
-                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/block'))));
+                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/invalid'))));
 
             } else if ($workshop->phase != workshop::PHASE_SUBMISSION) {
                 $mform->addElement('static', 'infostatus', get_string('currentstatusexecution', 'workshopallocation_scheduled'),
                     get_string('resultfailed', 'workshopallocation_scheduled').' '.
-                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/block'))).
+                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/invalid'))).
                     html_writer::empty_tag('br').
                     get_string('resultfailedphase', 'workshopallocation_scheduled'));
 
             } else if (empty($workshop->submissionend)) {
                 $mform->addElement('static', 'infostatus', get_string('currentstatusexecution', 'workshopallocation_scheduled'),
                     get_string('resultfailed', 'workshopallocation_scheduled').' '.
-                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/block'))).
+                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/invalid'))).
                     html_writer::empty_tag('br').
                     get_string('resultfaileddeadline', 'workshopallocation_scheduled'));
 
@@ -122,12 +122,12 @@ class workshop_scheduled_allocator_form extends workshop_random_allocator_form {
                 // next cron will execute it
                 $mform->addElement('static', 'infostatus', get_string('currentstatusexecution', 'workshopallocation_scheduled'),
                     get_string('currentstatusexecution4', 'workshopallocation_scheduled').' '.
-                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/tick_amber_big'))));
+                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/caution'))));
 
             } else {
                 $mform->addElement('static', 'infostatus', get_string('currentstatusexecution', 'workshopallocation_scheduled'),
                     get_string('currentstatusexecution3', 'workshopallocation_scheduled', $strtimeexpected).' '.
-                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/tick_amber_big'))));
+                    html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/caution'))));
             }
         }
 
index db535e3..d1b9c59 100644 (file)
@@ -704,7 +704,7 @@ class question_bank_preview_action_column extends question_bank_action_column_ba
         global $OUTPUT;
         if (question_has_capability_on($question, 'use')) {
             // Build the icon.
-            $image = $OUTPUT->pix_icon('t/preview', $this->strpreview);
+            $image = $OUTPUT->pix_icon('t/preview', $this->strpreview, '', array('class' => 'iconsmall'));
 
             $link = $this->qbank->preview_question_url($question);
             $action = new popup_action('click', $link, 'questionpreview',
index dbb1ddd..d0f44c0 100644 (file)
@@ -300,7 +300,7 @@ class core_question_renderer extends plugin_renderer_base {
         $editurl = new moodle_url('/question/question.php', $params);
 
         return html_writer::tag('div', html_writer::link(
-                $editurl, $this->pix_icon('i/edit', get_string('edit')) .
+                $editurl, $this->pix_icon('t/edit', get_string('edit'), '', array('class' => 'iconsmall')) .
                 get_string('editquestion', 'question')),
                 array('class' => 'editquestion'));
     }
index 14fbdad..25179a7 100644 (file)
@@ -229,16 +229,11 @@ abstract class qtype_renderer extends plugin_renderer_base {
         $state = question_state::graded_state_for_fraction($fraction);
 
         if ($state == question_state::$gradedright) {
-            $icon = 'tick_green';
+            $icon = 'grade_correct';
         } else if ($state == question_state::$gradedpartial) {
-            $icon = 'tick_amber';
+            $icon = 'grade_partiallycorrect';
         } else {
-            $icon = 'cross_red';
-        }
-        if ($selected) {
-            $icon .= '_big';
-        } else {
-            $icon .= '_small';
+            $icon = 'grade_incorrect';
         }
 
         $attributes = array(
index b5156d7..52912bc 100644 (file)
 .que .history table {width: 100%;margin: 0;}
 .que .history .current {font-weight: bold;}
 
+.que .questioncorrectnessicon { vertical-align: text-bottom; }
+.que input.questionflagimage { padding-right: 3px; }
+.dir-rtl .que input.questionflagimage { padding-left: 3px; padding-right: 0; }
+
 .importerror {margin-top: 10px;border-bottom: 1px solid #555;}
 .mform .que.comment .fitemtitle {width: 20%;}
 
index 8bd58c8..0c3cc5f 100644 (file)
@@ -17,6 +17,10 @@ deprecation:
 * c/site: Use i/siteevent instead
 * c/user: Use i/userevent instead
 * t/clear: Use t/check instead
+* i/cross_red_big: Use i/invalid or i/grade_incorrect
+* i/tick_green_big: Use i/valid or i/grade_correct
+* i/tick_amber_big: Use i/caution or i/grade_partiallycorrect
+* No more small versions of i/cross_red_small, i/tick_green_small and i/tick_amber_small, use their big equivalent.
 
 optional changes:
 * new optional boolean parameter $withlinks for public function login_info() in lib/outputrenderers.php (MDL-31365)
@@ -37,6 +41,8 @@ optional changes:
 * new icon t/markasread (12x12) to replace t/clear used in forums.
 * new icon t/check (12x12) to replace t/clear which name does not reflect the icon meaning.
 * new classes 'icon-pre' and 'icon-post' supposedly to be used when the icon is positioned before or after the text. This is not really used yet, but it's a start towards some standardisation of the icon selectors.
+* new icons i/valid, i/caution and i/invalid for generic statuses.
+* new icons i/grade_correct, i/grade_partiallycorrect and i/grade_incorrect for grades.
 
 === 2.3 ===