WeBWorK::DB::Schema::WW1Hash - support access to the set_user and problem_user tables with a WWDBv1 hash-style backend.
See descriptions in the WeBWorK::DB::Schema manpage.
count(@keyparts)
list(@keyparts)
exists(@keyparts)
add($Record)
get(@keyparts)
gets(@keypartsRefs)
put($Record)
delete(@keyparts)
These are helper methods used by the TABLE ACCESS METHODS.
get1(@keyparts)
Retrieves one set or problem from the database, packages it into a record object, and removes values that match global defaults. Assumes that the driver is already connected to the database. Used by gets().
getsNoFilter(@keypartsRefs)
Similar to gets(), but does not remove values that match global defaults.
get1NoFilter(@keyparts)
Similar to get1(), but does not remove values that match global defaults. Used
by get1() and getsNoFilter() and several methods in GlobalTableEmulator.
Returns all problems in a given set. Only supported for the problem_user table.
Similar to getAll(), but does not remove values that match global defaults.
Used by getAll() and the getAll() method in GlobalTableEmulator.
for the set_user table, ignore $problemID and deletes the set with the matching $PSVN. for the problem_user table, deletes the problem matching $problemID from the set matching $PSVN, or all problems if $problemID is not defined. Assumes that the driver is already connected to the database. Used by delete().
Copies global values from $GlobalRecord into the correponding fields in $UserRecord.
reindex()
Destroy and rebuild the internal set-PSVN and user-PSVN indices to eliminate any inconsistancies.
# mark down that we've seen these IDs in a "real" PSVN record
$userIDsMentioned{$userID} = 1;
$setIDsMentioned{$setID} = 1;
These methods use string2hash() and the TABLE MULTIPLEXING METHODS to convert
between strings and IDs/records.
string2IDs($string)
string2set($string)
string2problems($string)
string2records($string)
Both the set_user and problem_user tables are stored in one hash, keyed by PSVN. These methods split a hash value into multiple records, and combine multiple records into a single hash value.
hash2IDs(%hash)
hash2set(%hash)
set2hash($Set)
problem2hash($Problem)
# the PSVN pseudo-table and the set and user indexes are not visible to the # API, but we need to be able to update them to remain compatible with WWDBv1.
Retrieves an existing PSVN from the PSVN indices given a user ID and set ID. If no PSVN for that user/set pair exists, an undefined value is returned.
Retrieves an existing PSVN from the PSVN indices given a user ID and set ID. If no PSVN for that user/set pair exists, a new one is generated, added to the indices, and returned.
Remove an existing PSVN from the PSVN indexes, given the user ID and set ID for that PSVN.
getAllPSVNs()
Retrieves a list of all existing PSVNs.
getPSVNsForUser($userID)
Retrieves a list of PSVNs for a user from the user PSVN index.
getPSVNsForSet($setID)
Retrieves a list of PSVNs for a set from the set PSVN index.
These methods store and fetch PSVN indexes as hashes. The $prefix argument is the prefix on the hash keys that make up the index, which are set as constants in this module (i.e. LOGIN_PREFIX or SET_PREFIX).
listPSVNIndices($prefix)
list IDs for which PSVN indices exist given a prefix.
Return the PSVN index identified by the given prefix and ID as a hash.
Store the data in %PSVNIndex in the PSVN index identified by the given prefix and ID.
Delete the PSVN index identified by the given prefix and ID.
fetchString($PSVN)
deleteString($PSVN)