Contains the logic for handling question flags.
More...
|
static | get_postdata (question_attempt $qa) |
| Get the postdata that needs to be sent to question/toggleflag.php to change the flag state. More...
|
|
static | initialise_js () |
|
static | update_flag ($qubaid, $questionid, $qaid, $slot, $checksum, $newstate) |
| If the request seems valid, update the flag state of a question attempt. More...
|
|
|
static | get_toggle_checksum ($qubaid, $questionid, $qaid, $slot, $user=null) |
| Get the checksum that validates that a toggle request is valid. More...
|
|
Contains the logic for handling question flags.
- Copyright
- 2010 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ get_postdata()
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.
- Return values
-
◆ get_toggle_checksum()
static question_flags::get_toggle_checksum |
( |
|
$qubaid, |
|
|
|
$questionid, |
|
|
|
$qaid, |
|
|
|
$slot, |
|
|
|
$user = null |
|
) |
| |
|
staticprotected |
Get the checksum that validates that a toggle request is valid.
- Parameters
-
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. |
- Return values
-
string | that needs to be sent to question/toggleflag.php for it to work. |
◆ update_flag()
static question_flags::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.
- Parameters
-
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. |
The documentation for this class was generated from the following file: