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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1433 - (download) (as text) (annotate)
Fri Jul 25 12:38:17 2003 UTC (9 years, 9 months ago) by gage
File size: 2739 byte(s)
Cosmetic modifications to the index pages of Stats and
the instructor pages
--MIke

    1 ################################################################################
    2 # WeBWorK mod_perl (c) 2000-2002 WeBWorK Project
    3 # $Id$
    4 ################################################################################
    5 
    6 package WeBWorK::ContentGenerator::Instructor::Index;
    7 use base qw(WeBWorK::ContentGenerator::Instructor);
    8 
    9 =head1 NAME
   10 
   11 WeBWorK::ContentGenerator::Instructor::Index - Menu interface to the Instructor pages
   12 
   13 =cut
   14 
   15 use strict;
   16 use warnings;
   17 use CGI qw();
   18 
   19 sub path {
   20   my $self          = shift;
   21   my $args          = $_[-1];
   22 
   23   my $ce = $self->{ce};
   24   my $root = $ce->{webworkURLs}->{root};
   25   my $courseName = $ce->{courseName};
   26   return $self->pathMacro($args,
   27     "Home"          => "$root",
   28     $courseName     => "$root/$courseName",
   29     'instructor'    => '',
   30   );
   31 }
   32 
   33 sub title {
   34   my $self = shift;
   35   return "Instructor tools for ".$self->{ce}->{courseName};
   36 }
   37 
   38 sub body {
   39   my $self = shift;
   40   my $r = $self->{r};
   41   my $ce = $self->{ce};
   42   my $db = $self->{db};
   43   my $authz = $self->{authz};
   44   my $courseName = $ce->{courseName};
   45   my $authen_args = $self->url_authen_args();
   46   my $user = $r->param('user');
   47   my $prof_url = $ce->{webworkURLs}->{oldProf};
   48   my $full_url = "$prof_url?course=$courseName&$authen_args";
   49   my $userEditorURL = "users/?" . $self->url_args;
   50   my $problemSetEditorURL = "sets/?" . $self->url_args;
   51   my $statsURL       = "stats/?" . $self->url_args;
   52   my $emailURL       = "send_mail/?" . $self->url_args;
   53   ################### debug code
   54 #     my $permissonLevel =  $self->{db}->getPermissionLevel($user)->permission();
   55 #
   56 #     my $courseEnvironmentLevels = $self->{ce}->{permissionLevels};
   57 #     return CGI::em(" user $permissonLevel permlevels ".join("<>",%$courseEnvironmentLevels));
   58     ################### debug code
   59   return CGI::em('You are not authorized to access the Instructor tools.') unless $authz->hasPermissions($user, 'access_instructor_tools');
   60 
   61   return join("",
   62     CGI::start_table({-border=>2,-cellpadding=>10}),
   63     CGI::Tr({-align=>'center'},
   64       CGI::td(
   65         CGI::a({href=>$userEditorURL}, "Edit $courseName class list")  ,
   66       ),
   67       CGI::td(
   68         CGI::a({href=>$problemSetEditorURL}, "Edit $courseName problem sets"),
   69 
   70       ),"\n",
   71     ),
   72     CGI::Tr({ -align=>'center'},
   73       CGI::td([
   74         CGI::a({-href=>$emailURL}, "Send e-mail to $courseName"),
   75         CGI::a({-href=>$statsURL}, "Statistics for $courseName"),
   76       ]),
   77       "\n",
   78     ),
   79     CGI::Tr({ -align=>'center'},
   80       CGI::td([
   81         'WeBWorK 1.9 Instructor '.CGI::a({-href=>$full_url}, 'Tools'),
   82         'Open WeBWorK 1.0 Instructor '.CGI::a({-href=>$full_url, -target=>'_new'}, 'Tools').' in new window',
   83       ]),
   84       "\n",
   85     ),
   86 
   87     CGI::end_table(),
   88   );
   89 }
   90 
   91 1;
   92 
   93 __END__
   94 
   95 =head1 AUTHOR
   96 
   97 Written by Dennis Lambe Jr., malsyned (at) math.rochester.edu
   98 
   99 =cut

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9