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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 840 - (view) (download) (as text)

1 : malsyned 805 package WeBWorK::ContentGenerator::Instructor;
2 : sh002i 818 use base qw(WeBWorK::ContentGenerator);
3 : malsyned 805
4 :     =head1 NAME
5 :    
6 : malsyned 831 WeBWorK::ContentGenerator::Instructor - Abstract superclass for the Instructor pages
7 : malsyned 805
8 :     =cut
9 :    
10 :     use strict;
11 :     use warnings;
12 :     use CGI qw();
13 :    
14 : gage 833 sub links {
15 :     my $self = shift;
16 :    
17 :     # keep the links from the parent
18 :     my $pathString = "";
19 :    
20 :    
21 :     my $ce = $self->{ce};
22 :     my $db = $self->{db};
23 :     my $userName = $self->{r}->param("user");
24 :     my $courseName = $ce->{courseName};
25 :     my $root = $ce->{webworkURLs}->{root};
26 :     my $permLevel = $db->getPermissionLevel($userName)->permission();
27 :     my $key = $db->getKey($userName)->key();
28 :     return "" unless defined $key;
29 :    
30 :     # new URLS
31 :     my $classList = "$root/$courseName/instructor/userList/?". $self->url_authen_args();
32 : gage 840 my $addStudent = "$root/$courseName/instructor/addStudent/?". $self->url_authen_args();
33 : gage 833 my $problemSetList = "$root/$courseName/instructor/problemSetList/?". $self->url_authen_args();
34 :    
35 : gage 840 if ($permLevel > 0 ) {
36 :     $pathString .="<hr>";
37 :     $pathString .= CGI::a({-href=>$classList}, "Class&nbsp;editor") . CGI::br();
38 :     $pathString .= '&nbsp;&nbsp;'.CGI::a({-href=>$addStudent}, "Add&nbsp;Student") . CGI::br();
39 :     $pathString .= CGI::a({-href=>$problemSetList}, "ProbSet&nbsp;editor") . CGI::br();
40 :     }
41 :     return $self->SUPER::links() . $pathString;
42 : gage 833 }
43 : malsyned 829
44 :     1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9