[system] / trunk / webwork2 / lib / WeBWorK / ContentGenerator / Instructor / Index.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Index.pm

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

Revision 2079 Revision 2080
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/Instructor/Index.pm,v 1.31 2004/03/23 01:55:14 sh002i Exp $ 4# $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/Index.pm,v 1.32 2004/05/06 22:17:36 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.
46 my $db = $r->db; 46 my $db = $r->db;
47 my $authz = $r->authz; 47 my $authz = $r->authz;
48 my $urlpath = $r->urlpath; 48 my $urlpath = $r->urlpath;
49 49
50 unless ($authz->hasPermissions($r->param("user"), "modify_student_data")) { 50 unless ($authz->hasPermissions($r->param("user"), "modify_student_data")) {
51 $self->{submitError} = "You are not authorized to modify student data"; 51 $self->addmessage("You are not authorized to modify student data");
52 return; 52 return;
53 } 53 }
54 54
55 my $courseID = $urlpath->arg("courseID"); 55 my $courseID = $urlpath->arg("courseID");
56 my $userID = $r->param("user"); 56 my $userID = $r->param("user");
182 }; 182 };
183 183
184 # handle errors, redirect to target page 184 # handle errors, redirect to target page
185 185
186 if (@error) { 186 if (@error) {
187 $self->{error} = \@error; 187 $self->addmessage(CGI::div({class=>"ResultsWithError"},
188 CGI::p("Your request could not be fulfilled. Please correct the following errors and try again:"),
189 CGI::ul(CGI::li(\@error)),
190 ));
191
188 } elsif ($module) { 192 } elsif ($module) {
189 my $page = $urlpath->newFromModule($module, %args); 193 my $page = $urlpath->newFromModule($module, %args);
190 my $url = $self->systemLink($page, params => \%params); 194 my $url = $self->systemLink($page, params => \%params);
191 $self->reply_with_redirect($url); 195 $self->reply_with_redirect($url);
192 } 196 }
204 print CGI::p("Use the interface below to quickly access commonly-used 208 print CGI::p("Use the interface below to quickly access commonly-used
205 instructor tools, or select a tool from the list to the left."); 209 instructor tools, or select a tool from the list to the left.");
206 210
207 print CGI::p("Select user(s) and/or set(s) below and click the action button 211 print CGI::p("Select user(s) and/or set(s) below and click the action button
208 of your choice."); 212 of your choice.");
209
210 if ($self->{error}) {
211 my @errors = @{ $self->{error} };
212 print CGI::div({class=>"ResultsWithError"},
213 CGI::p("Your request could not be fulfilled. Please correct the following errors and try again:"),
214 CGI::ul(CGI::li(\@errors)),
215 );
216 }
217 213
218 my @userIDs = $db->listUsers; 214 my @userIDs = $db->listUsers;
219 my @Users = $db->getUsers(@userIDs); 215 my @Users = $db->getUsers(@userIDs);
220 216
221 my @globalSetIDs = $db->listGlobalSets; 217 my @globalSetIDs = $db->listGlobalSets;

Legend:
Removed from v.2079  
changed lines
  Added in v.2080

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9