| 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: webwork-modperl/lib/WeBWorK/ContentGenerator/ProblemSets.pm,v 1.38 2004/01/21 19:55:54 sh002i Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/ProblemSets.pm,v 1.39 2004/01/25 15:53:07 gage 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. |
| … | |
… | |
| 208 | if (defined $ce->{courseFiles}->{course_info} |
208 | if (defined $ce->{courseFiles}->{course_info} |
| 209 | and $ce->{courseFiles}->{course_info}) { |
209 | and $ce->{courseFiles}->{course_info}) { |
| 210 | my $course_info_path = $ce->{courseDirs}->{templates} |
210 | my $course_info_path = $ce->{courseDirs}->{templates} |
| 211 | .'/'. $ce->{courseFiles}->{course_info}; |
211 | .'/'. $ce->{courseFiles}->{course_info}; |
| 212 | my $editFileSuffix = $user.'.tmp'; #FIXME -- this could be moved to Instructor.pm |
212 | my $editFileSuffix = $user.'.tmp'; #FIXME -- this could be moved to Instructor.pm |
| 213 | $course_info_path .= ".$editFileSuffix" if $r->param("editMode") eq 'temporaryFile'; |
213 | $course_info_path .= ".$editFileSuffix" if defined($r->param("editMode")) and $r->param("editMode") eq 'temporaryFile'; |
| 214 | warn "course info $course_info_path"; |
214 | |
| 215 | my $course_info = eval { readFile($course_info_path) }; |
215 | my $course_info = eval { readFile($course_info_path) }; |
| 216 | $@ or print $course_info; |
216 | $@ or print $course_info; |
| 217 | my $user = $r->param("user"); |
217 | my $user = $r->param("user"); |
| 218 | my $permissionLevel = $db->getPermissionLevel($user)->permission(); # checked??? |
218 | my $permissionLevel = $db->getPermissionLevel($user)->permission(); # checked??? |
| 219 | $permissionLevel = 0 unless defined $permissionLevel; |
219 | $permissionLevel = 0 unless defined $permissionLevel; |