Keeps track of the ITS screen state.
More...
|
| __construct ($id, $term, $chapter_num, $tb_name, $tb_user, mysqli $mysqli) |
| ITS_screen_mobile class construct. More...
|
|
| set_IDR ($del_index) |
| Increments, decrements, or resets the review index array. More...
|
|
| get_SCREEN ($mode) |
| Returns JSON array of the screen content based on the provided mode. More...
|
|
| record_QUESTION ($qid, $qtype, $answered, $event) |
| Writes query to record user answer and permutation. More...
|
|
Keeps track of the ITS screen state.
- Date
- February 26, 2014
- Author
- Ricky Liou
-
Greg Krudysz
- Todo:
Split into another class, such as ITS_submit_mobile class
Properly record skips
__construct |
( |
|
$id, |
|
|
|
$term, |
|
|
|
$chapter_num, |
|
|
|
$tb_name, |
|
|
|
$tb_user, |
|
|
mysqli |
$mysqli |
|
) |
| |
ITS_screen_mobile class construct.
- Parameters
-
[in] | $id | User id |
[in] | $term | Current ITS term |
[in] | $chapter_num | Current chapter number |
[in] | $tb_name | MYSQL table name of where the question info are stored |
[in] | $tb_user | Prefix of individual user tables |
[in] | $mysqli | MYSQL database connection object |
Constructs the WHERE clause partial query that is used to query information about questions in a desired chapter.
- Parameters
-
- Returns
- The WHERE clause partial query that is used to query information about questions in a desired chapter
get_MC_statistics |
( |
|
$qid | ) |
|
|
private |
Fetches array of percentages of all current term student answers for each answer in order.
- Parameters
-
[in] | $qid | Question id number |
- Returns
- array of percentages of all current term student answers for each answer in order
get_QUESTION_score |
( |
|
$qid, |
|
|
|
$qtype, |
|
|
|
$qanswer |
|
) |
| |
|
private |
Calculates question score.
- Parameters
-
[in] | $qid | Question id number |
[in] | $qtype | Question type |
[in] | $qanswer | User answer to question |
Returns JSON array of the screen content based on the provided mode.
- Parameters
-
[in] | $mode | 's' for score, 'q' for question, 'r' for review |
- Returns
- JSON array of content, see ITS_ajax_mobile.php
random_QNUM_from_CHAPTER |
( |
| ) |
|
|
private |
Returns random question id number from current chapter.
- Returns
- Random question id number from current chapter
record_QUESTION |
( |
|
$qid, |
|
|
|
$qtype, |
|
|
|
$answered, |
|
|
|
$event |
|
) |
| |
Writes query to record user answer and permutation.
- Parameters
-
[in] | $qid | Question id number |
[in] | $qtype | Question type |
[in] | $answered | User answer to question |
[in] | $event | 1 = user submitted score, 0 = user skip |
Increments, decrements, or resets the review index array.
If the index tries to go out of bounds, the index will remain the same.
- Parameters
-
[in] | $del_index | 1 to increment index, -1 to in decrement index, 0 to set index to 0 |
[out] | $end_reached | Equal to 1 when end of review index array has been reached, -1 when beginning has been reached, 0 otherwise |
The documentation for this class was generated from the following file: