MDL-73350 qbank_statistics: Discrimination index column update

This implementation changes a little logic where the
discrimination index shows an empty row if there is
no attempts been made to a question rather than showing
very likely.
This commit is contained in:
Safat Shahin
2021-12-15 15:02:16 +11:00
parent 222c8cc77c
commit 750fafeedd
3 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -204,7 +204,10 @@ class helper {
* @return array
*/
public static function format_discrimination_index(?float $value): array {
if (is_null($value) || $value < self::NEED_FOR_REVISION_LOWER_THRESHOLD) {
if (is_null($value)) {
$content = get_string('emptyvalue', 'qbank_statistics');
$classes = '';
} else if ($value < self::NEED_FOR_REVISION_LOWER_THRESHOLD) {
$content = get_string('verylikely', 'qbank_statistics');
$classes = 'alert-danger';
} else if ($value < self::NEED_FOR_REVISION_UPPER_THRESHOLD) {
@@ -38,3 +38,4 @@ $string['verylikely'] = 'Very likely';
$string['likely'] = 'Likely';
$string['unlikely'] = 'Unlikely';
$string['na'] = 'N/A';
$string['emptyvalue'] = '-';
+1 -1
View File
@@ -26,6 +26,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbank_statistics';
$plugin->version = 2021092000;
$plugin->version = 2021121500;
$plugin->requires = 2021052500;
$plugin->maturity = MATURITY_STABLE;