NAME

WeBWorK::Utils::Instructor - Useful instructor utility tools.

METHODS

assignSetToUser

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

assignSetVersionToUser($db, $userID, $GlobalSet)

Assigns a version of $GlobalSet to $userID.

assignProblemToUser

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

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

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

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

unassignSetFromAllUsers($db, $setID)

Unassigns the specified sets and all problems contained therein from all users.

assignAllSetsToUser

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

unassignAllSetsFromUser($db, $userID)

Unassigns all sets and all problems contained therein from the specified user.

assignSetsToUsers

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

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

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

addProblemToSet($db, $problemDefaults, %args)

Adds a problem to a set. The paramters setName and sourceFile%args must be specified in %args.

loadSetDefListFile

loadSetDefListFile($file)

Returns the contents of the set definition list file specified in $file.

getDefList

getDefList($ce)

Returns a list of all set definition files found in a course's templates directory.