Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
question_state_mangrright Class Reference
Inheritance diagram for question_state_mangrright:
question_state_manuallygraded question_state_graded question_state

Public Member Functions

 __toString ()
 
 corresponding_commented_state ($fraction)
 Compute an appropriate state to move to after a manual comment has been added to this state. More...
 
 default_string ($showcorrectness)
 The result of doing get_string on the result of get_state_class(). More...
 
 get_feedback_class ()
 Return an appropriate CSS class name ''/'correct'/'partiallycorrect'/'incorrect', for a state. More...
 
 get_state_class ($showcorrectness)
 Return the name of an appropriate string to look up in the question language pack for a state. More...
 
 get_summary_state ()
 Each state can be categorised into one of four categories: inprogress, needsgrading, manuallygraded or autograded. More...
 
 is_active ()
 Is this state one of the ones that mean the question attempt is in progress? That is, started, but no finished. More...
 
 is_commented ()
 Is this state one of the ones that mean the question attempt has had a manual comment added? More...
 
 is_correct ()
 Is this state one of the ones that mean the question attempt has been graded? More...
 
 is_finished ()
 Is this state one of the ones that mean the question attempt is finished? That is, no further interaction possible, apart from manual grading. More...
 
 is_gave_up ()
 Is this state one of the ones that mean the question attempt has been graded? More...
 
 is_graded ()
 Is this state one of the ones that mean the question attempt has been graded? More...
 
 is_incorrect ()
 Is this state one of the ones that mean the question attempt has been graded? More...
 
 is_partially_correct ()
 Is this state one of the ones that mean the question attempt has been graded? More...
 

Static Public Member Functions

static get ($name)
 
static get_all ()
 Get all the states in an array. More...
 
static get_all_for_summary_state ($summarystate)
 Get all the states in an array. More...
 
static graded_state_for_fraction ($fraction)
 Return the appropriate graded state based on a fraction. More...
 
static init ()
 
static manually_graded_state_for_fraction ($fraction)
 Return the appropriate manually graded state based on a fraction. More...
 

Static Public Attributes

static $complete
 
static $finished
 
static $gaveup
 
static $gradedpartial
 
static $gradedright
 
static $gradedwrong
 
static $invalid
 
static $manfinished
 
static $mangaveup
 
static $mangrpartial
 
static $mangrright
 
static $mangrwrong
 
static $needsgrading
 
static $notstarted
 #+ Specific question_state instances.
 
static $todo
 
static $unprocessed
 

Member Function Documentation

◆ __toString()

question_state::__toString ( )
inherited
Return values
stringconvert this state to a string.

◆ corresponding_commented_state()

question_state_graded::corresponding_commented_state (   $fraction)
inherited

Compute an appropriate state to move to after a manual comment has been added to this state.

Parameters
number$fractionthe manual grade (if any) on the fraction scale.
Return values
intthe new state.

Reimplemented from question_state.

◆ default_string()

question_state::default_string (   $showcorrectness)
inherited

The result of doing get_string on the result of get_state_class().

Parameters
bool$showcorrectnessWhether right/partial/wrong states should be distinguised.
Return values
stringa string from the lang pack that can be used in the UI.

◆ get()

static question_state::get (   $name)
staticinherited
Parameters
string$namea state name.
Return values
question_statethe state with that name.

◆ get_all()

static question_state::get_all ( )
staticinherited

Get all the states in an array.

Return values
question_state[]of question_state objects.

◆ get_all_for_summary_state()

static question_state::get_all_for_summary_state (   $summarystate)
staticinherited

Get all the states in an array.

Parameters
string$summarystateone of the four summary states inprogress, needsgrading, manuallygraded or autograded.
Return values
arrayof the corresponding states.

◆ get_feedback_class()

question_state_mangrright::get_feedback_class ( )

Return an appropriate CSS class name ''/'correct'/'partiallycorrect'/'incorrect', for a state.

Return values
string

Reimplemented from question_state.

◆ get_state_class()

question_state_graded::get_state_class (   $showcorrectness)
inherited

Return the name of an appropriate string to look up in the question language pack for a state.

This is used, for example, by question_behaviour::get_state_string(). However, behaviours sometimes change this default string for soemthing more specific.

Parameters
bool$showcorrectnessWhether right/partial/wrong states should be distinguised, or just treated as 'complete'.
Return values
stringthe name of a string that can be looked up in the 'question' lang pack, or used as a CSS class name, etc.

Reimplemented from question_state.

◆ get_summary_state()

question_state::get_summary_state ( )
inherited

Each state can be categorised into one of four categories: inprogress, needsgrading, manuallygraded or autograded.

Return values
stringwhich category this state falls into.

◆ graded_state_for_fraction()

static question_state::graded_state_for_fraction (   $fraction)
staticinherited

Return the appropriate graded state based on a fraction.

That is 0 or less is $graded_incorrect, 1 is $graded_correct, otherwise it is $graded_partcorrect. Appropriate allowance is made for rounding float values.

Parameters
number$fractionthe grade, on the fraction scale.
Return values
question_stateone of the state constants.

◆ is_active()

question_state::is_active ( )
inherited

Is this state one of the ones that mean the question attempt is in progress? That is, started, but no finished.

Return values
bool

Reimplemented in question_state_complete, question_state_invalid, and question_state_todo.

◆ is_commented()

question_state_manuallygraded::is_commented ( )
inherited

Is this state one of the ones that mean the question attempt has had a manual comment added?

Return values
bool

Reimplemented from question_state.

◆ is_correct()

question_state_mangrright::is_correct ( )

Is this state one of the ones that mean the question attempt has been graded?

Return values
bool

Reimplemented from question_state.

◆ is_finished()

question_state::is_finished ( )
inherited

Is this state one of the ones that mean the question attempt is finished? That is, no further interaction possible, apart from manual grading.

Return values
bool

Reimplemented in question_state_complete, question_state_invalid, question_state_todo, question_state_unprocessed, and question_state_notstarted.

◆ is_gave_up()

question_state::is_gave_up ( )
inherited

Is this state one of the ones that mean the question attempt has been graded?

Return values
bool

Reimplemented in question_state_gaveup.

◆ is_graded()

question_state_graded::is_graded ( )
inherited

Is this state one of the ones that mean the question attempt has been graded?

Return values
bool

Reimplemented from question_state.

Reimplemented in question_state_gradedright, and question_state_gradedpartial.

◆ is_incorrect()

question_state::is_incorrect ( )
inherited

Is this state one of the ones that mean the question attempt has been graded?

Return values
bool

Reimplemented in question_state_mangrwrong, and question_state_gradedwrong.

◆ is_partially_correct()

question_state::is_partially_correct ( )
inherited

Is this state one of the ones that mean the question attempt has been graded?

Return values
bool

Reimplemented in question_state_mangrpartial, and question_state_gradedpartial.

◆ manually_graded_state_for_fraction()

static question_state::manually_graded_state_for_fraction (   $fraction)
staticinherited

Return the appropriate manually graded state based on a fraction.

That is 0 or less is $manually_graded_incorrect, 1 is $manually_graded_correct, otherwise it is $manually_graded_partcorrect. Appropriate allowance is made for rounding float values.

Parameters
number$fractionthe grade, on the fraction scale.
Return values
intone of the state constants.

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