|
Moodle
2.2.1
http://www.collinsharper.com
|

Public Member Functions | |
| __toString () | |
| is_active () | |
| is_finished () | |
| is_graded () | |
| is_correct () | |
| is_partially_correct () | |
| is_incorrect () | |
| is_gave_up () | |
| is_commented () | |
| get_summary_state () | |
| corresponding_commented_state ($fraction) | |
| get_feedback_class () | |
| get_state_class ($showcorrectness) | |
| default_string ($showcorrectness) | |
Static Public Member Functions | |
| static | init () |
| static | get_all () |
| static | get_all_for_summary_state ($summarystate) |
| static | get ($name) |
| static | graded_state_for_fraction ($fraction) |
| static | manually_graded_state_for_fraction ($fraction) |
Static Public Attributes | |
| static | $notstarted |
| static | $unprocessed |
| static | $todo |
| static | $invalid |
| static | $complete |
| static | $needsgrading |
| static | $finished |
| static | $gaveup |
| static | $gradedwrong |
| static | $gradedpartial |
| static | $gradedright |
| static | $manfinished |
| static | $mangaveup |
| static | $mangrwrong |
| static | $mangrpartial |
| static | $mangrright |
Protected Member Functions | |
| __construct () | |
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.
Definition at line 39 of file states.php.
| __construct | ( | ) | [protected] |
#@+-
Definition at line 61 of file states.php.
| __toString | ( | ) |
Definition at line 108 of file states.php.
| corresponding_commented_state | ( | $ | fraction | ) |
Compute an appropriate state to move to after a manual comment has been added to this state.
| number | $fraction | the manual grade (if any) on the fraction scale. |
Reimplemented in question_state_graded, question_state_gaveup, question_state_finished, and question_state_needsgrading.
Definition at line 247 of file states.php.
| default_string | ( | $ | showcorrectness | ) |
The result of doing get_string on the result of get_state_class().
| bool | $showcorrectness | Whether right/partial/wrong states should be distinguised. |
Definition at line 280 of file states.php.

| static get | ( | $ | name | ) | [static] |
| string | $name | a state name. |
Definition at line 116 of file states.php.

| static get_all | ( | ) | [static] |
Get all the states in an array.
Definition at line 77 of file states.php.

| static get_all_for_summary_state | ( | $ | summarystate | ) | [static] |
Get all the states in an array.
| string | $summarystate | one of the four summary states inprogress, needsgrading, manuallygraded or autograded. |
Definition at line 92 of file states.php.

Return an appropriate CSS class name ''/'correct'/'partiallycorrect'/'incorrect', for a state.
Reimplemented in question_state_mangrright, question_state_mangrpartial, question_state_mangrwrong, question_state_gradedright, question_state_gradedpartial, question_state_gradedwrong, and question_state_gaveup.
Definition at line 256 of file states.php.

| 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.
| bool | $showcorrectness | Whether right/partial/wrong states should be distinguised, or just treated as 'complete'. |
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.

Each state can be categorised into one of four categories: inprogress, needsgrading, manuallygraded or autograded.
Definition at line 191 of file states.php.

| static 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.
| number | $fraction | the grade, on the fraction scale. |
Definition at line 211 of file states.php.

| static init | ( | ) | [static] |
Definition at line 64 of file states.php.
| is_active | ( | ) |
Is this state one of the ones that mean the question attempt is in progress? That is, started, but no finished.
Reimplemented in question_state_complete, question_state_invalid, and question_state_todo.
Definition at line 125 of file states.php.
| is_commented | ( | ) |
Is this state one of the ones that mean the question attempt has had a manual comment added?
Reimplemented in question_state_manuallygraded, question_state_mangaveup, and question_state_manfinished.
Definition at line 182 of file states.php.

| is_correct | ( | ) |
Is this state one of the ones that mean the question attempt has been graded?
Reimplemented in question_state_mangrright, and question_state_gradedright.
Definition at line 150 of file states.php.
| 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.
Reimplemented in question_state_complete, question_state_invalid, question_state_todo, question_state_unprocessed, and question_state_notstarted.
Definition at line 134 of file states.php.

| is_gave_up | ( | ) |
Is this state one of the ones that mean the question attempt has been graded?
Reimplemented in question_state_gaveup.
Definition at line 174 of file states.php.
| is_graded | ( | ) |
Is this state one of the ones that mean the question attempt has been graded?
Reimplemented in question_state_gradedright, question_state_gradedpartial, and question_state_graded.
Definition at line 142 of file states.php.
| is_incorrect | ( | ) |
Is this state one of the ones that mean the question attempt has been graded?
Reimplemented in question_state_mangrwrong, and question_state_gradedwrong.
Definition at line 166 of file states.php.
Is this state one of the ones that mean the question attempt has been graded?
Reimplemented in question_state_mangrpartial, and question_state_gradedpartial.
Definition at line 158 of file states.php.
| static 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.
| number | $fraction | the grade, on the fraction scale. |
Definition at line 229 of file states.php.

$complete [static] |
Definition at line 47 of file states.php.
$finished [static] |
Definition at line 49 of file states.php.
$gaveup [static] |
Definition at line 50 of file states.php.
$gradedpartial [static] |
Definition at line 52 of file states.php.
$gradedright [static] |
Definition at line 53 of file states.php.
$gradedwrong [static] |
Definition at line 51 of file states.php.
$invalid [static] |
Definition at line 46 of file states.php.
$manfinished [static] |
Definition at line 54 of file states.php.
$mangaveup [static] |
Definition at line 55 of file states.php.
$mangrpartial [static] |
Definition at line 57 of file states.php.
$mangrright [static] |
Definition at line 58 of file states.php.
$mangrwrong [static] |
Definition at line 56 of file states.php.
$needsgrading [static] |
Definition at line 48 of file states.php.
$notstarted [static] |
#@+ Specific question_state instances.
Definition at line 43 of file states.php.
$todo [static] |
Definition at line 45 of file states.php.
$unprocessed [static] |
Definition at line 44 of file states.php.