|
Moodle
2.2.1
http://www.collinsharper.com
|
Static Public Member Functions | |
| static | get_postdata (question_attempt $qa) |
| static | update_flag ($qubaid, $questionid, $qaid, $slot, $checksum, $newstate) |
| static | initialise_js () |
Static Protected Member Functions | |
| static | get_toggle_checksum ($qubaid, $questionid, $qaid, $slot, $user=null) |
Contains the logic for handling question flags.
| static get_postdata | ( | question_attempt $ | qa | ) | [static] |
Get the postdata that needs to be sent to question/toggleflag.php to change the flag state. You need to append &newstate=0/1 to this.
Definition at line 579 of file lib.php.


| static get_toggle_checksum | ( | $ | qubaid, |
| $ | questionid, | ||
| $ | qaid, | ||
| $ | slot, | ||
| $ | user = null |
||
| ) | [static, protected] |
Get the checksum that validates that a toggle request is valid.
| int | $qubaid | the question usage id. |
| int | $questionid | the question id. |
| int | $sessionid | the question_attempt id. |
| object | $user | the user. If null, defaults to $USER. |
Definition at line 565 of file lib.php.

| static initialise_js | ( | ) | [static] |
| static update_flag | ( | $ | qubaid, |
| $ | questionid, | ||
| $ | qaid, | ||
| $ | slot, | ||
| $ | checksum, | ||
| $ | newstate | ||
| ) | [static] |
If the request seems valid, update the flag state of a question attempt. Throws exceptions if this is not a valid update request.
| int | $qubaid | the question usage id. |
| int | $questionid | the question id. |
| int | $sessionid | the question_attempt id. |
| string | $checksum | checksum, as computed by get_toggle_checksum() corresponding to the last three arguments. |
| bool | $newstate | the new state of the flag. true = flagged. |