mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-32188 question CBM: minimal handling of certainty -1
Certainty -1 has never been used in standard Moodle, but is used in Tony-Gardiner Medwin's patches to mean 'No idea' which we intend to implement: MDL-42077. In the mean time, these changes avoid errors for people who have used TGM's patches.
This commit is contained in:
parent
e74aa0aa97
commit
2bf83cb218
@ -684,6 +684,13 @@ abstract class question_cbm {
|
||||
* @return number the adjusted fraction taking the certainty into account.
|
||||
*/
|
||||
public static function adjust_fraction($fraction, $certainty) {
|
||||
if ($certainty == -1) {
|
||||
// Certainty -1 has never been used in standard Moodle, but is
|
||||
// used in Tony-Gardiner Medwin's patches to mean 'No idea' which
|
||||
// we intend to implement: MDL-42077. In the mean time, avoid
|
||||
// errors for people who have used TGM's patches.
|
||||
return 0;
|
||||
}
|
||||
if ($fraction <= 0.00000005) {
|
||||
return self::$wrongscore[$certainty];
|
||||
} else {
|
||||
|
@ -85,7 +85,11 @@ class qbehaviour_deferredcbm_type extends qbehaviour_deferredfeedback_type {
|
||||
}
|
||||
|
||||
$certainty = $qa->get_last_behaviour_var('certainty');
|
||||
if (is_null($certainty)) {
|
||||
if (is_null($certainty) || $certainty == -1) {
|
||||
// Certainty -1 has never been used in standard Moodle, but is
|
||||
// used in Tony-Gardiner Medwin's patches to mean 'No idea' which
|
||||
// we intend to implement: MDL-42077. In the mean time, avoid
|
||||
// errors for people who have used TGM's patches.
|
||||
$certainty = question_cbm::default_certainty();
|
||||
}
|
||||
|
||||
|
@ -43,9 +43,11 @@ 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['certainty-1'] = 'No Idea';
|
||||
$string['certainty1'] = 'C=1 (Unsure: <67%)';
|
||||
$string['certainty2'] = 'C=2 (Mid: >67%)';
|
||||
$string['certainty3'] = 'C=3 (Quite sure: >80%)';
|
||||
$string['certaintyshort-1'] = 'No Idea';
|
||||
$string['certaintyshort1'] = 'C=1';
|
||||
$string['certaintyshort2'] = 'C=2';
|
||||
$string['certaintyshort3'] = 'C=3';
|
||||
|
Loading…
x
Reference in New Issue
Block a user