| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork2/lib/WeBWorK/URLPath.pm,v 1.18 2004/10/10 20:53:19 sh002i Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/URLPath.pm,v 1.23 2005/06/20 22:40:34 jj Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 42 | set_list /$courseID/ |
42 | set_list /$courseID/ |
| 43 | |
43 | |
| 44 | equation_display /$courseID/equation/ |
44 | equation_display /$courseID/equation/ |
| 45 | feedback /$courseID/feedback/ |
45 | feedback /$courseID/feedback/ |
| 46 | gateway_quiz /$courseID/quiz_mode/$setID/ |
46 | gateway_quiz /$courseID/quiz_mode/$setID/ |
|
|
47 | proctored_gateway_quiz /$courseID/proctored_quiz_mode/$setID/ |
|
|
48 | proctored_gateway_proctor_login /$courseID/proctored_quiz_mode/$setID/proctor_login/ |
| 47 | grades /$courseID/grades/ |
49 | grades /$courseID/grades/ |
| 48 | hardcopy /$courseID/hardcopy/ |
50 | hardcopy /$courseID/hardcopy/ |
| 49 | hardcopy_preselect_set /$courseID/hardcopy/$setID/ |
51 | hardcopy_preselect_set /$courseID/hardcopy/$setID/ |
| 50 | logout /$courseID/logout/ |
52 | logout /$courseID/logout/ |
| 51 | options /$courseID/options/ |
53 | options /$courseID/options/ |
| … | |
… | |
| 61 | instructor_users_assigned_to_set /$courseID/instructor/sets/$setID/users/ |
63 | instructor_users_assigned_to_set /$courseID/instructor/sets/$setID/users/ |
| 62 | |
64 | |
| 63 | instructor_add_users /$courseID/instructor/add_users/ |
65 | instructor_add_users /$courseID/instructor/add_users/ |
| 64 | instructor_set_assigner /$courseID/instructor/assigner/ |
66 | instructor_set_assigner /$courseID/instructor/assigner/ |
| 65 | instructor_file_transfer /$courseID/instructor/files/ |
67 | instructor_file_transfer /$courseID/instructor/files/ |
|
|
68 | instructor_file_manager /$courseID/instructor/file_manager/ |
| 66 | instructor_set_maker /$courseID/instructor/setmaker/ |
69 | instructor_set_maker /$courseID/instructor/setmaker/ |
|
|
70 | instructor_compare /$courseID/instructor/compare/ |
| 67 | |
71 | |
| 68 | instructor_file_manager /$courseID/instructor/file_manager/ |
|
|
| 69 | instructor_problem_editor /$courseID/instructor/pgProblemEditor/ |
72 | instructor_problem_editor /$courseID/instructor/pgProblemEditor/ |
| 70 | instructor_problem_editor_withset /$courseID/instructor/pgProblemEditor/$setID/ |
73 | instructor_problem_editor_withset /$courseID/instructor/pgProblemEditor/$setID/ |
| 71 | instructor_problem_editor_withset_withproblem |
74 | instructor_problem_editor_withset_withproblem |
| 72 | /$courseID/instructor/pgProblemEditor/$setID/$problemID/ |
75 | /$courseID/instructor/pgProblemEditor/$setID/$problemID/ |
| 73 | |
76 | |
| … | |
… | |
| 85 | instructor_set_progress /$courseID/instructor/StudentProgress/set/$setID/ |
88 | instructor_set_progress /$courseID/instructor/StudentProgress/set/$setID/ |
| 86 | instructor_user_progress /$courseID/instructor/StudentProgress/student/$userID/ |
89 | instructor_user_progress /$courseID/instructor/StudentProgress/student/$userID/ |
| 87 | |
90 | |
| 88 | problem_list /$courseID/$setID/ |
91 | problem_list /$courseID/$setID/ |
| 89 | problem_detail /$courseID/$setID/$problemID/ |
92 | problem_detail /$courseID/$setID/$problemID/ |
| 90 | |
93 | |
| 91 | =cut |
94 | =cut |
| 92 | |
95 | |
| 93 | ################################################################################ |
96 | ################################################################################ |
| 94 | # tree of path types |
97 | # tree of path types |
| 95 | ################################################################################ |
98 | ################################################################################ |
| … | |
… | |
| 117 | ################################################################################ |
120 | ################################################################################ |
| 118 | |
121 | |
| 119 | set_list => { |
122 | set_list => { |
| 120 | name => '$courseID', |
123 | name => '$courseID', |
| 121 | parent => 'root', |
124 | parent => 'root', |
| 122 | kids => [ qw/equation_display feedback gateway_quiz grades hardcopy |
125 | kids => [ qw/equation_display feedback gateway_quiz proctored_gateway_quiz grades hardcopy |
| 123 | logout options instructor_tools problem_list |
126 | logout options instructor_tools problem_list |
| 124 | / ], |
127 | / ], |
| 125 | match => qr|^([^/]+)/|, |
128 | match => qr|^([^/]+)/|, |
| 126 | capture => [ qw/courseID/ ], |
129 | capture => [ qw/courseID/ ], |
| 127 | produce => '$courseID/', |
130 | produce => '$courseID/', |
| … | |
… | |
| 155 | match => qr|^quiz_mode/([^/]+)/|, |
158 | match => qr|^quiz_mode/([^/]+)/|, |
| 156 | capture => [ qw/setID/ ], |
159 | capture => [ qw/setID/ ], |
| 157 | produce => 'quiz_mode/$setID/', |
160 | produce => 'quiz_mode/$setID/', |
| 158 | display => 'WeBWorK::ContentGenerator::GatewayQuiz', |
161 | display => 'WeBWorK::ContentGenerator::GatewayQuiz', |
| 159 | }, |
162 | }, |
|
|
163 | proctored_gateway_quiz => { |
|
|
164 | name => 'Proctored Gateway Quiz $setID', |
|
|
165 | parent => 'set_list', |
|
|
166 | kids => [ qw/proctored_gateway_proctor_login/ ], |
|
|
167 | match => qr|^proctored_quiz_mode/([^/]+)/|, |
|
|
168 | capture => [ qw/setID/ ], |
|
|
169 | produce => 'proctored_quiz_mode/$setID/', |
|
|
170 | display => 'WeBWorK::ContentGenerator::GatewayQuiz', |
|
|
171 | }, |
|
|
172 | proctored_gateway_proctor_login => { |
|
|
173 | name => 'Proctored Gateway Quiz $setID Proctor Login', |
|
|
174 | parent => 'proctored_gateway_quiz', |
|
|
175 | kids => [ qw// ], |
|
|
176 | match => qr|^proctored_quiz_mode/([^/]+)/|, |
|
|
177 | capture => [ qw/setID/ ], |
|
|
178 | produce => 'proctored_quiz_mode/$setID/proctor_login', |
|
|
179 | display => 'WeBWorK::ContentGenerator::LoginProctor', |
|
|
180 | }, |
| 160 | grades => { |
181 | grades => { |
| 161 | name => 'Grades', |
182 | name => 'Grades', |
| 162 | parent => 'set_list', |
183 | parent => 'set_list', |
| 163 | kids => [ qw// ], |
184 | kids => [ qw// ], |
| 164 | match => qr|^grades/|, |
185 | match => qr|^grades/|, |
| … | |
… | |
| 208 | instructor_tools => { |
229 | instructor_tools => { |
| 209 | name => 'Instructor Tools', |
230 | name => 'Instructor Tools', |
| 210 | parent => 'set_list', |
231 | parent => 'set_list', |
| 211 | kids => [ qw/instructor_user_list instructor_set_list instructor_add_users |
232 | kids => [ qw/instructor_user_list instructor_set_list instructor_add_users |
| 212 | instructor_set_assigner instructor_file_transfer instructor_file_manager |
233 | instructor_set_assigner instructor_file_transfer instructor_file_manager |
| 213 | instructor_problem_editor instructor_set_maker |
234 | instructor_problem_editor instructor_set_maker instructor_compare |
| 214 | instructor_scoring instructor_scoring_download instructor_mail_merge |
235 | instructor_scoring instructor_scoring_download instructor_mail_merge |
| 215 | instructor_answer_log instructor_preflight instructor_statistics |
236 | instructor_answer_log instructor_preflight instructor_statistics |
| 216 | instructor_progress |
237 | instructor_progress |
| 217 | / ], |
238 | / ], |
| 218 | match => qr|^instructor/|, |
239 | match => qr|^instructor/|, |
| … | |
… | |
| 299 | match => qr|^assigner/|, |
320 | match => qr|^assigner/|, |
| 300 | capture => [ qw// ], |
321 | capture => [ qw// ], |
| 301 | produce => 'assigner/', |
322 | produce => 'assigner/', |
| 302 | display => 'WeBWorK::ContentGenerator::Instructor::Assigner', |
323 | display => 'WeBWorK::ContentGenerator::Instructor::Assigner', |
| 303 | }, |
324 | }, |
|
|
325 | instructor_compare => { |
|
|
326 | name => 'File Compare', |
|
|
327 | parent => 'instructor_tools', |
|
|
328 | kids => [ qw// ], |
|
|
329 | match => qr|^compare/|, |
|
|
330 | capture => [ qw// ], |
|
|
331 | produce => 'comp/', |
|
|
332 | display => 'WeBWorK::ContentGenerator::Instructor::Compare', |
|
|
333 | }, |
| 304 | instructor_set_maker => { |
334 | instructor_set_maker => { |
| 305 | name => 'Library Browser', |
335 | name => 'Library Browser', |
| 306 | parent => 'instructor_tools', |
336 | parent => 'instructor_tools', |
| 307 | kids => [ qw// ], |
337 | kids => [ qw// ], |
| 308 | match => qr|^setmaker/|, |
338 | match => qr|^setmaker/|, |
| … | |
… | |
| 312 | }, |
342 | }, |
| 313 | instructor_file_transfer => { |
343 | instructor_file_transfer => { |
| 314 | name => 'File Transfer', |
344 | name => 'File Transfer', |
| 315 | parent => 'instructor_tools', |
345 | parent => 'instructor_tools', |
| 316 | kids => [ qw// ], |
346 | kids => [ qw// ], |
| 317 | match => qr|^files/|, |
347 | match => qr|^file_xfer/|, |
| 318 | capture => [ qw// ], |
348 | capture => [ qw// ], |
| 319 | produce => 'files/', |
349 | produce => 'file_xfer/', |
| 320 | display => 'WeBWorK::ContentGenerator::Instructor::FileXfer', |
350 | display => 'WeBWorK::ContentGenerator::Instructor::FileXfer', |
|
|
351 | }, |
|
|
352 | instructor_file_manager => { |
|
|
353 | name => 'File Manager', |
|
|
354 | parent => 'instructor_tools', |
|
|
355 | kids => [ qw// ], |
|
|
356 | match => qr|^file_manager/|, |
|
|
357 | capture => [ qw// ], |
|
|
358 | produce => 'file_manager/', |
|
|
359 | display => 'WeBWorK::ContentGenerator::Instructor::FileManager', |
| 321 | }, |
360 | }, |
| 322 | instructor_problem_editor => { |
361 | instructor_problem_editor => { |
| 323 | name => 'Problem Editor', |
362 | name => 'Problem Editor', |
| 324 | parent => 'instructor_tools', |
363 | parent => 'instructor_tools', |
| 325 | kids => [ qw/instructor_problem_editor_withset/ ], |
364 | kids => [ qw/instructor_problem_editor_withset/ ], |
| 326 | match => qr|^pgProblemEditor/|, |
365 | match => qr|^pgProblemEditor/|, |
| 327 | capture => [ qw// ], |
366 | capture => [ qw// ], |
| 328 | produce => 'pgProblemEditor/', |
367 | produce => 'pgProblemEditor/', |
| 329 | display => 'WeBWorK::ContentGenerator::Instructor::PGProblemEditor', |
368 | display => 'WeBWorK::ContentGenerator::Instructor::PGProblemEditor', |
| 330 | }, |
|
|
| 331 | instructor_file_manager => { |
|
|
| 332 | name => 'File Manager', |
|
|
| 333 | parent => 'instructor_tools', |
|
|
| 334 | kids => [ qw// ], |
|
|
| 335 | match => qr|^file_manager/|, |
|
|
| 336 | capture => [ qw// ], |
|
|
| 337 | produce => 'file_manager/', |
|
|
| 338 | display => 'WeBWorK::ContentGenerator::Instructor::FileManager', |
|
|
| 339 | }, |
369 | }, |
| 340 | instructor_problem_editor_withset => { |
370 | instructor_problem_editor_withset => { |
| 341 | name => '$setID', |
371 | name => '$setID', |
| 342 | parent => 'instructor_problem_editor', |
372 | parent => 'instructor_problem_editor', |
| 343 | kids => [ qw/instructor_problem_editor_withset_withproblem/ ], |
373 | kids => [ qw/instructor_problem_editor_withset_withproblem/ ], |
| … | |
… | |
| 741 | |
771 | |
| 742 | ################################################################################ |
772 | ################################################################################ |
| 743 | |
773 | |
| 744 | =head1 UTILITY FUNCTIONS |
774 | =head1 UTILITY FUNCTIONS |
| 745 | |
775 | |
| 746 | =head2 |
|
|
| 747 | |
|
|
| 748 | =over |
776 | =over |
| 749 | |
777 | |
| 750 | =item interpolate($string, %symbols) |
778 | =item interpolate($string, %symbols) |
| 751 | |
779 | |
| 752 | Replaces simple scalars (\$\w+) in $string with values in %symbols. If a scalar |
780 | Replaces simple scalars (\$\w+) in $string with values in %symbols. If a scalar |
| … | |
… | |
| 765 | =back |
793 | =back |
| 766 | |
794 | |
| 767 | =cut |
795 | =cut |
| 768 | |
796 | |
| 769 | # ------------------------------------------------------------------------------ |
797 | # ------------------------------------------------------------------------------ |
| 770 | |
|
|
| 771 | =head2 |
|
|
| 772 | |
798 | |
| 773 | =over |
799 | =over |
| 774 | |
800 | |
| 775 | =item getPathType($path) |
801 | =item getPathType($path) |
| 776 | |
802 | |