An enumeration representing the states a question can be in after a question_attempt_step.
More...
|
| __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 | $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 |
|
An enumeration representing the states a question can be in after a question_attempt_step.
There are also some useful methods for testing and manipulating states.
- Copyright
- 2009 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __toString()
question_state::__toString |
( |
| ) |
|
- Return values
-
string | convert this state to a string. |
◆ corresponding_commented_state()
question_state::corresponding_commented_state |
( |
|
$fraction | ) |
|
◆ default_string()
question_state::default_string |
( |
|
$showcorrectness | ) |
|
The result of doing get_string on the result of get_state_class().
- Parameters
-
bool | $showcorrectness | Whether right/partial/wrong states should be distinguised. |
- Return values
-
string | a string from the lang pack that can be used in the UI. |
◆ get()
static question_state::get |
( |
|
$name | ) |
|
|
static |
◆ get_all()
static question_state::get_all |
( |
| ) |
|
|
static |
Get all the states in an array.
- Return values
-
◆ get_all_for_summary_state()
static question_state::get_all_for_summary_state |
( |
|
$summarystate | ) |
|
|
static |
Get all the states in an array.
- Parameters
-
string | $summarystate | one of the four summary states inprogress, needsgrading, manuallygraded or autograded. |
- Return values
-
array | of the corresponding states. |
◆ get_feedback_class()
question_state::get_feedback_class |
( |
| ) |
|
◆ get_state_class()
question_state::get_state_class |
( |
|
$showcorrectness | ) |
|
|
abstract |
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 | $showcorrectness | Whether right/partial/wrong states should be distinguised, or just treated as 'complete'. |
- Return values
-
string | the name of a string that can be looked up in the 'question' lang pack, or used as a CSS class name, etc. |
Reimplemented in question_state_graded, question_state_gaveup, question_state_finished, question_state_needsgrading, question_state_complete, question_state_invalid, question_state_todo, question_state_unprocessed, and question_state_notstarted.
◆ get_summary_state()
question_state::get_summary_state |
( |
| ) |
|
Each state can be categorised into one of four categories: inprogress, needsgrading, manuallygraded or autograded.
- Return values
-
string | which category this state falls into. |
◆ graded_state_for_fraction()
static question_state::graded_state_for_fraction |
( |
|
$fraction | ) |
|
|
static |
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 | $fraction | the grade, on the fraction scale. |
- Return values
-
◆ is_active()
question_state::is_active |
( |
| ) |
|
◆ is_commented()
question_state::is_commented |
( |
| ) |
|
◆ is_correct()
question_state::is_correct |
( |
| ) |
|
◆ is_finished()
question_state::is_finished |
( |
| ) |
|
◆ is_gave_up()
question_state::is_gave_up |
( |
| ) |
|
Is this state one of the ones that mean the question attempt has been graded?
- Return values
-
Reimplemented in question_state_gaveup.
◆ is_graded()
question_state::is_graded |
( |
| ) |
|
◆ is_incorrect()
question_state::is_incorrect |
( |
| ) |
|
◆ is_partially_correct()
question_state::is_partially_correct |
( |
| ) |
|
◆ manually_graded_state_for_fraction()
static question_state::manually_graded_state_for_fraction |
( |
|
$fraction | ) |
|
|
static |
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 | $fraction | the grade, on the fraction scale. |
- Return values
-
int | one of the state constants. |
The documentation for this class was generated from the following file: