From: Mike G. v. a. <we...@ma...> - 2005-07-31 15:24:12
|
Log Message: ----------- User interface changes added. All courses are sorted without regard to case. The main page now lists all available courses and their database type -- finding the database type slows things down a bit, so this might not be a desirable feature when there are many courses. It also discovers missing course.conf files. If the course.conf file is missing then it's more likely that the database type is not accurate. Modified Files: -------------- webwork-modperl/lib/WeBWorK/ContentGenerator: CourseAdmin.pm Revision Data ------------- Index: CourseAdmin.pm =================================================================== RCS file: /webwork/cvs/system/webwork-modperl/lib/WeBWorK/ContentGenerator/CourseAdmin.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -Llib/WeBWorK/ContentGenerator/CourseAdmin.pm -u -r1.36 -r1.37 --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -269,8 +269,34 @@ if (defined $method_to_call and $method_to_call ne "") { $self->$method_to_call; - } + } else { + + print CGI::h2("Courses"); + print CGI::start_ul(); + + my @courseIDs = listCourses($ce); + foreach my $courseID (sort {lc($a) cmp lc($b) } @courseIDs) { + next if $courseID eq "admin"; # done already above + my $urlpath = $r->urlpath->newFromModule("WeBWorK::ContentGenerator::ProblemSets", courseID => $courseID); + my $tempCE = WeBWorK::CourseEnvironment->new( + $ce->{webworkDirs}->{root}, + $ce->{webworkURLs}->{root}, + $ce->{pg}->{directories}->{root}, + $courseID, + ); + print CGI::li(CGI::a({href=>$self->systemLink($urlpath, authen => 0)}, $courseID), + CGI::code( + $tempCE->{dbLayoutName}, + ), + (-r $tempCE->{courseFiles}->{environment}) ? "" : CGI::i(", missing course.conf"), + + ); + + } + + print CGI::end_ul(); + } return ""; } @@ -353,7 +379,7 @@ }; my @existingCourses = listCourses($ce); - @existingCourses = sort @existingCourses; + @existingCourses = sort { lc($a) cmp lc ($b) } @existingCourses; #make sort case insensitive print CGI::h2("Add Course"); @@ -806,7 +832,7 @@ my $rename_sql_wwhost = $r->param("rename_sql_wwhost") || ""; my @courseIDs = listCourses($ce); - @courseIDs = sort @courseIDs; + @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; my %courseLabels; # records... heh. foreach my $courseID (@courseIDs) { @@ -1052,7 +1078,7 @@ my $delete_sql_database = $r->param("delete_sql_database") || ""; my @courseIDs = listCourses($ce); - @courseIDs = sort @courseIDs; + @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive my %courseLabels; # records... heh. foreach my $courseID (@courseIDs) { @@ -1328,7 +1354,7 @@ @export_tables = @tables unless @export_tables; my @courseIDs = listCourses($ce); - @courseIDs = sort @courseIDs; + @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive my %courseLabels; # records... heh. foreach my $courseID (@courseIDs) { @@ -1512,7 +1538,7 @@ @import_tables = @tables unless @import_tables; my @courseIDs = listCourses($ce); - @courseIDs = sort @courseIDs; + @courseIDs = sort {lc($a) cmp lc ($b) } @courseIDs; #make sort case insensitive my %courseLabels; # records... heh. |