NAME

WeBWorK::URLPath - the WeBWorK virtual URL heirarchy.

VIRTUAL HEIRARCHY

PLEASE FOR THE LOVE OF GOD UPDATE THIS IF YOU CHANGE THE HEIRARCHY BELOW!!!

 root                                /
 
 course_admin                        /admin/ -> logout, options, instructor_tools
 set_list                            /$courseID/
 
 equation_display                    /$courseID/equation/
 feedback                            /$courseID/feedback/
 gateway_quiz                        /$courseID/quiz_mode/$setID/
 grades                              /$courseID/grades/
 hardcopy                            /$courseID/hardcopy/
 hardcopy_preselect_set              /$courseID/hardcopy/$setID/
 logout                              /$courseID/logout/
 options                             /$courseID/options/
 
 instructor_tools                    /$courseID/instructor/
 
 instructor_user_list                /$courseID/instructor/users/
 instructor_user_detail              /$courseID/instructor/users/$userID/
 instructor_sets_assigned_to_user    /$courseID/instructor/users/$userID/sets/
 
 instructor_set_list                 /$courseID/instructor/sets/
 instructor_set_detail               /$courseID/instructor/sets/$setID/
 instructor_users_assigned_to_set    /$courseID/instructor/sets/$setID/users/
 
 instructor_add_users                /$courseID/instructor/add_users/
 instructor_set_assigner             /$courseID/instructor/assigner/
 instructor_file_transfer            /$courseID/instructor/files/
 instructor_file_manager             /$courseID/instructor/file_manager/
 instructor_set_maker                /$courseID/instructor/setmaker/
 
 instructor_problem_editor           /$courseID/instructor/pgProblemEditor/
 instructor_problem_editor_withset   /$courseID/instructor/pgProblemEditor/$setID/
 instructor_problem_editor_withset_withproblem
                                     /$courseID/instructor/pgProblemEditor/$setID/$problemID/
 
 instructor_scoring                  /$courseID/instructor/scoring/
 instructor_scoring_download         /$courseID/instructor/scoringDownload/
 instructor_mail_merge               /$courseID/instructor/send_mail/
 instructor_answer_log               /$courseID/instructor/show_answers/
 instructor_preflight               /$courseID/instructor/preflight/
 
 instructor_statistics               /$courseID/instructor/stats/
 instructor_set_statistics           /$courseID/instructor/stats/set/$setID/
 instructor_user_statistics          /$courseID/instructor/stats/student/$userID/
 
 instructor_progress                  /$courseID/instructor/StudentProgress/
 instructor_set_progress              /$courseID/instructor/StudentProgress/set/$setID/
 instructor_user_progress             /$courseID/instructor/StudentProgress/student/$userID/
 
 problem_list                        /$courseID/$setID/
 problem_detail                      /$courseID/$setID/$problemID/

a handy template:

        id => {
                name    => '',
                parent  => '',
                kids    => [ qw// ],
                match   => qr|^/|,
                capture => [ qw// ],
                produce => '',
                display => '',
        },

CONSTRUCTORS

new(%fields)

Creates a new WeBWorK::URLPath. %fields may contain the following:

 type => the internal path type associated with this 
 args => a reference to a hash associating path arguments with values

This constructor is used internally. Refer to newFromPath() and newFromModule() for more useful constructors.

newFromPath($path)

Creates a new WeBWorK::URLPath by parsing the path given in $path. It the path is invalid, an exception is thrown.

newFromModule($module, %args)

Creates a new WeBWorK::URLPath by finding a path type which matches the module and path arguments given. If no type matches, an exception is thrown.

METHODS

Methods that return information from the object itself

type()

Returns the path type of the WeBWorK::URLPath.

args()

Returns a hash of arguments derived from the WeBWorK::URLPath.

arg($name)

Returns the named argument, as derived from the WeBWorK::URLPath.

Methods that return information from path node associated with the object

name()

Returns the human-readable name of this WeBWorK::URLPath.

module()

Returns the name of the module that will handle this WeBWorK::URLPath.

Methods that search the virtual heirarchy

parent()

Returns a new WeBWorK::URLPath representing the parent of the current URLPath. Returns an undefined value if the URLPath has no parent.

child($module, %newArgs)

Returns a new WeBWorK::URLPath representing the child of the current URLPath whose module is $module. If no child matches, an undefined value is returned. Pass additional arguments needed by the child in %newArgs.

path()

Reconstructs the path string from a WeBWorK::URLPath.

UTILITY FUNCTIONS

interpolate($string, %symbols)

Replaces simple scalars (\$\w+) in $string with values in %symbols. If a scalar does not exist in %symbols, it is left alone.

getPathType($path)

Parse the string $path, determining the path type. Returns ($type, %args), where $type is the type of the path and %args contains any extracted path arguments. If conversion fails, a false value is returned.

getModuleType($module, @args)

Returns the path type matching the given module and argument names, or a false value if no type matches.

buildPathFromType($type)

Returns a string path for the given path type. Since arguments are not supplied, the string may contain scalar variables ripe for interpolation.

visitPathTypeNode($nodeID, $path, $argsRef, $indent)

Internal search function. See getPathType().

Returns the nodeID of the node that consumed the final characters in $path, or the following failure conditions:

Returns 0 if $nodeID doesn't match $path.

Returns -1 if $nodeID matched $path, but no children of $nodeID consumed the remaining path. In this case, the stack is unwound immediately.