MDL-32188 question CBM: improve display of the certainty choices
authorTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 17 Aug 2012 16:57:10 +0000 (17:57 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Fri, 4 Oct 2013 16:52:31 +0000 (17:52 +0100)
Switch to the neutral C=1, 2, 3 mode. Also add a helpicon, and improve
line-wrapping.

question/behaviour/deferredcbm/lang/en/qbehaviour_deferredcbm.php
question/behaviour/deferredcbm/renderer.php
question/behaviour/deferredcbm/styles.css [new file with mode: 0644]

index 31bb35f..a28c25b 100644 (file)
 $string['assumingcertainty'] = 'You did not select a certainty. Assuming: {$a}.';
 $string['basemark'] = 'Base mark {$a}';
 $string['cbmmark'] = 'CBM mark {$a}';
-$string['certainty1'] = 'Not very (less than 67%)';
-$string['certainty2'] = 'Fairly (more than 67%)';
-$string['certainty3'] = 'Very (more than 80%)';
+$string['certainty'] = 'Certainty';
+$string['certainty_help'] = 'Certainty-based marking requires you to indicate how reliable you think your answer is. The available levels are:
+
+Certainty level     | C=1 (Unsure) | C=2 (Mid) | C=3 (Quite sure)
+------------------- | ------------ | --------- | ----------------
+Mark if correct     |   1          |    2      |      3
+Mark if wrong       |   0          |   -2      |     -6
+Probability correct |  <67%        | 67-80%    |    >80%
+
+Best marks are gained by acknowledging uncertainty. For example, if you think there is more than a 1 in 3 chance of being wrong, you should enter C=1 and avoid the risk of a negative mark.
+';
+$string['certainty_link'] = 'qbehaviour/deferredcbm/certainty';
+$string['certainty1'] = 'C=1 (Unsure: <67%)';
+$string['certainty2'] = 'C=2 (Mid: >67%)';
+$string['certainty3'] = 'C=3 (Quite sure: >80%)';
 $string['howcertainareyou'] = 'How certain are you? {$a}';
 $string['pluginname'] = 'Deferred feedback with CBM';
index 1f33df3..f5abbf5 100644 (file)
@@ -55,17 +55,20 @@ class qbehaviour_deferredcbm_renderer extends qbehaviour_renderer {
             } else {
                 unset($attributes['checked']);
             }
-            $choices .= ' ' . html_writer::empty_tag('input', $attributes) . ' ' .
-                    html_writer::tag('label', question_cbm::get_string($certainty),
-                            array('for' => $id));
+            $choices .= ' ' .
+                    html_writer::tag('label', html_writer::empty_tag('input', $attributes) .
+                            question_cbm::get_string($certainty), array('for' => $id));
         }
         return $choices;
     }
 
     public function controls(question_attempt $qa, question_display_options $options) {
-        return html_writer::tag('div', get_string('howcertainareyou', 'qbehaviour_deferredcbm',
-                $this->certainty_choices($qa->get_behaviour_field_name('certainty'),
-                $qa->get_last_behaviour_var('certainty'), $options->readonly)),
+        $a = new stdClass();
+        $a->help = $this->output->help_icon('certainty', 'qbehaviour_deferredcbm');
+        $a->choices = $this->certainty_choices($qa->get_behaviour_field_name('certainty'),
+                $qa->get_last_behaviour_var('certainty'), $options->readonly);
+
+        return html_writer::tag('div', get_string('howcertainareyou', 'qbehaviour_deferredcbm', $a),
                 array('class' => 'certaintychoices'));
     }
 
diff --git a/question/behaviour/deferredcbm/styles.css b/question/behaviour/deferredcbm/styles.css
new file mode 100644 (file)
index 0000000..99774eb
--- /dev/null
@@ -0,0 +1,6 @@
+.que.deferredcbm .certaintychoices input[type="radio"] {
+    margin-left: 0.5em;
+}
+.que.deferredcbm .certaintychoices label {
+    white-space: nowrap;
+}