| 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/ContentGenerator/CourseAdmin.pm,v 1.35 2005/06/10 15:59:52 gage Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v 1.36 2005/07/14 13:15:25 glarose 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. |
| … | |
… | |
| 267 | ); |
267 | ); |
| 268 | } |
268 | } |
| 269 | |
269 | |
| 270 | if (defined $method_to_call and $method_to_call ne "") { |
270 | if (defined $method_to_call and $method_to_call ne "") { |
| 271 | $self->$method_to_call; |
271 | $self->$method_to_call; |
|
|
272 | } else { |
|
|
273 | |
|
|
274 | print CGI::h2("Courses"); |
|
|
275 | |
|
|
276 | print CGI::start_ul(); |
|
|
277 | |
|
|
278 | my @courseIDs = listCourses($ce); |
|
|
279 | foreach my $courseID (sort {lc($a) cmp lc($b) } @courseIDs) { |
|
|
280 | next if $courseID eq "admin"; # done already above |
|
|
281 | my $urlpath = $r->urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSets", courseID => $courseID); |
|
|
282 | my $tempCE = WeBWorK::CourseEnvironment->new( |
|
|
283 | $ce->{webworkDirs}->{root}, |
|
|
284 | $ce->{webworkURLs}->{root}, |
|
|
285 | $ce->{pg}->{directories}->{root}, |
|
|
286 | $courseID, |
|
|
287 | ); |
|
|
288 | print CGI::li(CGI::a({href=>$self->systemLink($urlpath, authen => 0)}, $courseID), |
|
|
289 | CGI::code( |
|
|
290 | $tempCE->{dbLayoutName}, |
|
|
291 | ), |
|
|
292 | (-r $tempCE->{courseFiles}->{environment}) ? "" : CGI::i(", missing course.conf"), |
|
|
293 | |
|
|
294 | ); |
|
|
295 | |
| 272 | } |
296 | } |
| 273 | |
297 | |
|
|
298 | print CGI::end_ul(); |
|
|
299 | } |
| 274 | return ""; |
300 | return ""; |
| 275 | } |
301 | } |
| 276 | |
302 | |
| 277 | ################################################################################ |
303 | ################################################################################ |
| 278 | |
304 | |
| … | |
… | |
| 351 | } |
377 | } |
| 352 | $source; |
378 | $source; |
| 353 | }; |
379 | }; |
| 354 | |
380 | |
| 355 | my @existingCourses = listCourses($ce); |
381 | my @existingCourses = listCourses($ce); |
| 356 | @existingCourses = sort @existingCourses; |
382 | @existingCourses = sort { lc($a) cmp lc ($b) } @existingCourses; #make sort case insensitive |
| 357 | |
383 | |
| 358 | print CGI::h2("Add Course"); |
384 | print CGI::h2("Add Course"); |
| 359 | |
385 | |
| 360 | print CGI::start_form("POST", $r->uri); |
386 | print CGI::start_form("POST", $r->uri); |
| 361 | print $self->hidden_authen_fields; |
387 | print $self->hidden_authen_fields; |
| … | |
… | |
| 804 | my $rename_sql_oldDatabase = $r->param("rename_sql_oldDatabase") || ""; |
830 | my $rename_sql_oldDatabase = $r->param("rename_sql_oldDatabase") || ""; |
| 805 | my $rename_sql_newDatabase = $r->param("rename_sql_newDatabase") || ""; |
831 | my $rename_sql_newDatabase = $r->param("rename_sql_newDatabase") || ""; |
| 806 | my $rename_sql_wwhost = $r->param("rename_sql_wwhost") || ""; |
832 | my $rename_sql_wwhost = $r->param("rename_sql_wwhost") || ""; |
| 807 | |
833 | |
| 808 | my @courseIDs = listCourses($ce); |
834 | my @courseIDs = listCourses($ce); |
| 809 | @courseIDs = sort @courseIDs; |
835 | @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; |
| 810 | |
836 | |
| 811 | my %courseLabels; # records... heh. |
837 | my %courseLabels; # records... heh. |
| 812 | foreach my $courseID (@courseIDs) { |
838 | foreach my $courseID (@courseIDs) { |
| 813 | my $tempCE = WeBWorK::CourseEnvironment->new( |
839 | my $tempCE = WeBWorK::CourseEnvironment->new( |
| 814 | $ce->{webworkDirs}->{root}, |
840 | $ce->{webworkDirs}->{root}, |
| … | |
… | |
| 1050 | my $delete_sql_username = $r->param("delete_sql_username") || ""; |
1076 | my $delete_sql_username = $r->param("delete_sql_username") || ""; |
| 1051 | my $delete_sql_password = $r->param("delete_sql_password") || ""; |
1077 | my $delete_sql_password = $r->param("delete_sql_password") || ""; |
| 1052 | my $delete_sql_database = $r->param("delete_sql_database") || ""; |
1078 | my $delete_sql_database = $r->param("delete_sql_database") || ""; |
| 1053 | |
1079 | |
| 1054 | my @courseIDs = listCourses($ce); |
1080 | my @courseIDs = listCourses($ce); |
| 1055 | @courseIDs = sort @courseIDs; |
1081 | @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive |
| 1056 | |
1082 | |
| 1057 | my %courseLabels; # records... heh. |
1083 | my %courseLabels; # records... heh. |
| 1058 | foreach my $courseID (@courseIDs) { |
1084 | foreach my $courseID (@courseIDs) { |
| 1059 | my $tempCE = WeBWorK::CourseEnvironment->new( |
1085 | my $tempCE = WeBWorK::CourseEnvironment->new( |
| 1060 | $ce->{webworkDirs}->{root}, |
1086 | $ce->{webworkDirs}->{root}, |
| … | |
… | |
| 1326 | my @export_tables = $r->param("export_tables"); |
1352 | my @export_tables = $r->param("export_tables"); |
| 1327 | |
1353 | |
| 1328 | @export_tables = @tables unless @export_tables; |
1354 | @export_tables = @tables unless @export_tables; |
| 1329 | |
1355 | |
| 1330 | my @courseIDs = listCourses($ce); |
1356 | my @courseIDs = listCourses($ce); |
| 1331 | @courseIDs = sort @courseIDs; |
1357 | @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive |
| 1332 | |
1358 | |
| 1333 | my %courseLabels; # records... heh. |
1359 | my %courseLabels; # records... heh. |
| 1334 | foreach my $courseID (@courseIDs) { |
1360 | foreach my $courseID (@courseIDs) { |
| 1335 | my $tempCE = WeBWorK::CourseEnvironment->new( |
1361 | my $tempCE = WeBWorK::CourseEnvironment->new( |
| 1336 | $ce->{webworkDirs}->{root}, |
1362 | $ce->{webworkDirs}->{root}, |
| … | |
… | |
| 1510 | my $import_conflict = $r->param("import_conflict") || "skip"; |
1536 | my $import_conflict = $r->param("import_conflict") || "skip"; |
| 1511 | |
1537 | |
| 1512 | @import_tables = @tables unless @import_tables; |
1538 | @import_tables = @tables unless @import_tables; |
| 1513 | |
1539 | |
| 1514 | my @courseIDs = listCourses($ce); |
1540 | my @courseIDs = listCourses($ce); |
| 1515 | @courseIDs = sort @courseIDs; |
1541 | @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive |
| 1516 | |
1542 | |
| 1517 | |
1543 | |
| 1518 | my %courseLabels; # records... heh. |
1544 | my %courseLabels; # records... heh. |
| 1519 | foreach my $courseID (@courseIDs) { |
1545 | foreach my $courseID (@courseIDs) { |
| 1520 | my $tempCE = WeBWorK::CourseEnvironment->new( |
1546 | my $tempCE = WeBWorK::CourseEnvironment->new( |