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

Annotation of /trunk/webwork2/lib/WeBWorK/ContentGenerator/Instructor.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 833 - (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 :     my $problemSetList = "$root/$courseName/instructor/problemSetList/?". $self->url_authen_args();
33 :    
34 :     $pathString .="<hr>";
35 :     $pathString .= ($permLevel > 0
36 :     ? CGI::a({-href=>$classList}, "Class List editor") . CGI::br()
37 :     : "");
38 :     $pathString .= ($permLevel > 0
39 :     ? CGI::a({-href=>$problemSetList}, "Problem Set editor") . CGI::br()
40 :     : "");
41 :     return $self->SUPER::links(), $pathString;
42 :     }
43 : malsyned 829
44 :     1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9