[system] / trunk / webwork-modperl / lib / WeBWorK / ContentGenerator / Instructor / ProblemSetList.pm Repository:
ViewVC logotype

Diff of /trunk/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 954 Revision 955
33 my $importURL = "$instructorBaseURL/problemSetImport/"; 33 my $importURL = "$instructorBaseURL/problemSetImport/";
34 my $addURL = "$instructorBaseURL/problemSetAdd/"; 34 my $addURL = "$instructorBaseURL/problemSetAdd/";
35 my $sort = $r->param('sort') ? $r->param('sort') : "due_date"; 35 my $sort = $r->param('sort') ? $r->param('sort') : "due_date";
36 36
37 # Slurp each set record for this course in @sets 37 # Slurp each set record for this course in @sets
38 my @sets;
39 push @sets, $db->getGlobalSet($_)
40 foreach ($db->listGlobalSets);
41
42 # Gather data from the database 38 # Gather data from the database
43 my @users = $db->listUsers; 39 my @users = $db->listUsers;
40 my @sets;
44 my %counts; 41 my %counts;
45 my %problemCounts; 42 my %problemCounts;
46 foreach my $set (@sets) { 43 foreach my $set_id ($db->listGlobalSets) {
44 my $set = $db->getGlobalSet($set_id);
45 push @sets, $set;
47 $problemCounts{$set} = scalar($db->listGlobalProblems($set->set_id)); 46 $problemCounts{$set_id} = scalar($db->listGlobalProblems($set_id));
48 my $count = 0; 47 my $count = 0;
49 $counts{$set->set_id} = $db->listSetUsers($set->set_id); 48 $counts{$set_id} = $db->listSetUsers($set_id);
50 } 49 }
51 50
52 # Sort @sets based on the sort parameter 51 # Sort @sets based on the sort parameter
53 # Invalid sort types will just cause an unpredictable ordering, which is no big deal. 52 # Invalid sort types will just cause an unpredictable ordering, which is no big deal.
54 @sets = sort { 53 @sets = sort {
100 ) 99 )
101 . CGI::td({}, CGI::a({href=>"$setEditorURL".$set->set_id."/?".$self->url_authen_args}, $set->set_id)) 100 . CGI::td({}, CGI::a({href=>"$setEditorURL".$set->set_id."/?".$self->url_authen_args}, $set->set_id))
102 . CGI::td({}, formatDateTime($set->open_date)) 101 . CGI::td({}, formatDateTime($set->open_date))
103 . CGI::td({}, formatDateTime($set->due_date)) 102 . CGI::td({}, formatDateTime($set->due_date))
104 . CGI::td({}, formatDateTime($set->answer_date)) 103 . CGI::td({}, formatDateTime($set->answer_date))
105 . CGI::td({}, $problemCounts{$set}) 104 . CGI::td({}, $problemCounts{$set->set_id})
106 . CGI::td({}, $userCountMessage) 105 . CGI::td({}, $userCountMessage)
107 ) . "\n" 106 ) . "\n"
108 } 107 }
109 $table = CGI::table({"border"=>"1"}, "\n".$table."\n"); 108 $table = CGI::table({"border"=>"1"}, "\n".$table."\n");
110 109

Legend:
Removed from v.954  
changed lines
  Added in v.955

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9