Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
question_cbm Class Reference

This helper class contains the constants and methods required for manipulating scores for certainty based marking. More...

Static Public Member Functions

static adjust_fraction ($fraction, $certainty)
 Given a fraction, and a certainty, compute the adjusted fraction.
 
static default_certainty ()
 #-
 
static get_short_string ($certainty)
 
static get_string ($certainty)
 
static optimal_probablility_high ($certainty)
 
static optimal_probablility_low ($certainty)
 
static summary_with_certainty ($summary, $certainty)
 Add information about certainty to a response summary.
 

Public Attributes

const HIGH = 3
 
integer const LOW = 1
 #+ named constants for the certainty levels.
 
const MED = 2
 

Static Public Attributes

static array $certainties = array(self::LOW, self::MED, self::HIGH)
 #-
 

Static Protected Attributes

static $highlimit
 
static array $lowlimit
 #-
 
static array $rightscore
 #+ coefficients used to adjust the fraction based on certainty.
 
static $wrongscore
 

Detailed Description

This helper class contains the constants and methods required for manipulating scores for certainty based marking.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ adjust_fraction()

static question_cbm::adjust_fraction ( $fraction,
$certainty )
static

Given a fraction, and a certainty, compute the adjusted fraction.

Parameters
number$fractionthe raw fraction for this question.
int$certaintyone of the certainty level constants.
Return values
numberthe adjusted fraction taking the certainty into account.

◆ default_certainty()

static question_cbm::default_certainty ( )
static

#-

Return values
intthe default certaintly level that should be assuemd if the student does not choose one.

◆ get_short_string()

static question_cbm::get_short_string ( $certainty)
static
Parameters
int$certaintyone of the LOW/MED/HIGH constants.
Return values
stringa short textual description of this certainty.

◆ get_string()

static question_cbm::get_string ( $certainty)
static
Parameters
int$certaintyone of the LOW/MED/HIGH constants.
Return values
stringa textual description of this certainty.

◆ optimal_probablility_high()

static question_cbm::optimal_probablility_high ( $certainty)
static
Parameters
int$certaintyone of the LOW/MED/HIGH constants.
Return values
floatthe upper limit of the optimal probability range for this certainty.

◆ optimal_probablility_low()

static question_cbm::optimal_probablility_low ( $certainty)
static
Parameters
int$certaintyone of the LOW/MED/HIGH constants.
Return values
floatthe lower limit of the optimal probability range for this certainty.

◆ summary_with_certainty()

static question_cbm::summary_with_certainty ( $summary,
$certainty )
static

Add information about certainty to a response summary.

Parameters
string$summarythe response summary.
int$certaintythe level of certainty to add.
Return values
stringthe summary with information about the certainty added.

Member Data Documentation

◆ $certainties

array question_cbm::$certainties = array(self::LOW, self::MED, self::HIGH)
static

#-

list of all the certainty levels.

◆ $highlimit

question_cbm::$highlimit
staticprotected
Initial value:
= array(
self::LOW => 0.666666666666667,
self::MED => 0.8,
self::HIGH => 1,
)

◆ $lowlimit

array question_cbm::$lowlimit
staticprotected
Initial value:
= array(
self::LOW => 0,
self::MED => 0.666666666666667,
self::HIGH => 0.8,
)

#-

#+ upper and lower limits of the optimal window.

◆ $rightscore

array question_cbm::$rightscore
staticprotected
Initial value:
= array(
self::LOW => 1,
self::MED => 2,
self::HIGH => 3,
)

#+ coefficients used to adjust the fraction based on certainty.

◆ $wrongscore

question_cbm::$wrongscore
staticprotected
Initial value:
= array(
self::LOW => 0,
self::MED => -2,
self::HIGH => -6,
)

The documentation for this class was generated from the following file: