WeBWorK::Utils::JITAR - contains utility subroutines for JITAR problems.
Usage: seq_to_jitar_id(@seq)
This method takes the tree sequence @seq
and returns the jitar id. This id is a specially crafted signed 32 bit integer of the form
SAAAAAAABBBBBBCCCCCCDDDDEEEEFFFF
in binary. Here A is the level 1 index, B is the level 2 index, and C, D, E and F are the indexes for levels 3 through 6.
Note: Level 1 can contain indexes up to 125. Levels 2 and 3 can contain indxes up to 63. For levels 4 through six you are limited to 15.
Usage: jitar_id_to_seq($id)
Takes a jitar_id and returns the tree sequence. Jitar ids have the format described above.
Usage: is_jitar_problem_hidden($db, $userID, $setID, $problemID)
Returns 1 if the problem is hidden. The problem is hidden if the number of attempts on the parent problem is greater than att_to_open_children, or if the user has run out of attempts. Everything is opened up after the due date.
Usage: is_jitar_problem_closed($db, $ce, $userID, $setID, $problemID)
Returns 1 if the jitar problem is closed. JITAR problems are closed if the restrict_prob_progression variable is set on the set, and if the previous problem is closed, or hasn't been finished yet. The first problem in a level is always open.
Usage: jitar_problem_finished($userProblem, $db)
This returns 1 if the given problem is "finished". This happens when the problem attempts have been maxed out, and the attempts of any children with the "counts_to_parent_grade" also have their attemtps maxed out. (In other words if the grade can't be raised any more.)
Usage: jitar_problem_adjusted_status($userProblem, $db)
This returns the adjusted status for a jitar problem. This is either the problems status, or it is the greater of the status and the score generated by taking the weighted average of all child problems that have the "counts_parent_grade" flag set.
Usage: prob_id_sort(@ids)
Sorts problem ID's so that the usual integral problem ids are first and just-in-time ids after that. For example,
1, 1.1, 1.1.1, 2, 2.1, 2.2, 3, 4