WeBWorK::Utils::Instructor - Useful instructor utility tools.
assignSetToUser($db, $userID, $GlobalSet)
Assigns the set $GlobalSet
and all problems contained therein to the user identified by $userID
. If the assignment of the set or the assignment of any of the problems in the set fails, then an exception is thrown. Note that it is not considered a failure for the set or a problem in the set to have already been assigned to the user.
assignSetVersionToUser($db, $userID, $GlobalSet)
Assigns a version of $GlobalSet
to $userID
.
assignProblemToUser($db, $userID, $GlobalProblem, $seed)
Assigns the given problem to the given user. If $seed is defined, the user problem will be given that seed. If the assignment fails an exception is thrown. Note that it is not considered a failure for the problem to have already been assigned to the user.
assignProblemToUserSetVersion($db, $userID, $userSet, $GlobalProblem, $groupProbRef, $seed)
Assigns a problem version to $userID
. An exception is thrown in the case of a failure. It is not a failure for the problem to have already been assigned to the user.
assignSetToAllUsers($db, $ce, $setID)
Assigns the set specified and all problems contained therein to all users in the course. This skips users whose status does not have the behavior include_in_assignment. This is more efficient than repeatedly calling assignSetToUser(). If any assignments fail, a list of failure messages is returned.
assignSetToGivenUsers($db, $ce, $setID, $alwaysInclude, @userRecords)
Assigns the set specified and all problems contained therein to all users in the list provided. When $alwaysInclude
is false, it will skip users whose status does not have the behavior include_in_assignment. This is more efficient than repeatedly calling assignSetToUser
. If any assignments fail, an exception is thrown.
unassignSetFromAllUsers($db, $setID)
Unassigns the specified sets and all problems contained therein from all users.
assignAllSetsToUser($db, $userID)
Assigns all sets in the course and all problems contained therein to the specified user. If any assignments fail, an exception is thrown. Note that it is not considered a failure for the set or a problem in the set to have already been assigned to the user.
unassignAllSetsFromUser($db, $userID)
Unassigns all sets and all problems contained therein from the specified user.
assignSetsToUsers($db, $ce, $setIDsRef, $userIDsRef)
Assign each of the given sets to each of the given users. If any assignments fail, an exception is thrown. Note that it is not considered a failure for a set (or any problems therein) to have already been assigned to a user.
unassignSetsFromUsers($db, $setIDsRef, $userIDsRef)
Unassign each of the given sets from each of the given users. Note that this method returns a Mojo::Promise
and so must be awaited.
assignProblemToAllSetUsers($GlobalProblem)
Assigns the problem specified to all users to whom the problem's set is assigned. If any assignments fail, a list of failure messages is returned.
addProblemToSet($db, $problemDefaults, %args)
Adds a problem to a set. The paramters setName
and sourceFile
%args
must be specified in %args
.
loadSetDefListFile($file)
Returns the contents of the set definition list file specified in $file
.
getDefList($ce)
Returns a list of all set definition files found in a course's templates directory.