| 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/CourseAdmin.pm,v 1.17 2004/06/13 01:29:03 gage Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v 1.18 2004/06/16 01:58:03 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. |
| … | |
… | |
| 470 | my @errors; |
470 | my @errors; |
| 471 | |
471 | |
| 472 | if ($add_courseID eq "") { |
472 | if ($add_courseID eq "") { |
| 473 | push @errors, "You must specify a course name."; |
473 | push @errors, "You must specify a course name."; |
| 474 | } |
474 | } |
|
|
475 | if (grep { $add_courseID eq $_ } listCourses($ce)) { |
|
|
476 | push @errors, "A course named $add_courseID already exists." ; |
|
|
477 | } |
| 475 | if ($add_contact_institution eq "") { |
478 | if ($add_contact_institution eq "") { |
| 476 | push @errors, "You must specify a contact institution." ; |
479 | push @errors, "You must specify a contact institution." ; |
| 477 | } |
480 | } |
| 478 | if ($add_contact_last_name eq "") { |
481 | if ($add_contact_last_name eq "") { |
| 479 | push @errors, "You must specify a contact person."; |
482 | push @errors, "You must specify a contact person."; |
| … | |
… | |
| 509 | push @errors, "You must specify a professor password." if $add_initial_password eq ""; |
512 | push @errors, "You must specify a professor password." if $add_initial_password eq ""; |
| 510 | } |
513 | } |
| 511 | if ($add_admin_userID ne "") { |
514 | if ($add_admin_userID ne "") { |
| 512 | push @errors, "You must specify an admin password for $add_admin_userID." if $add_admin_password eq ""; |
515 | push @errors, "You must specify an admin password for $add_admin_userID." if $add_admin_password eq ""; |
| 513 | } |
516 | } |
| 514 | |
|
|
| 515 | |
517 | |
| 516 | return @errors; |
518 | return @errors; |
| 517 | } |
519 | } |
| 518 | |
520 | |
| 519 | sub do_add_course { |
521 | sub do_add_course { |