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

View of /trunk/webwork2/lib/WeBWorK/ContentGenerator/Professor.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 670 - (download) (as text) (annotate)
Fri Dec 6 17:50:24 2002 UTC (10 years, 5 months ago) by malsyned
File size: 1673 byte(s)
Added a Professor Tools stub module that provides redirection links to
the WeBWorK 1.8 system
-Dennis

    1 ################################################################################
    2 # WeBWorK mod_perl (c) 2000-2002 WeBWorK Project
    3 # $Id$
    4 ################################################################################
    5 
    6 package WeBWorK::ContentGenerator::Professor;
    7 
    8 =head1 NAME
    9 
   10 WeBWorK::ContentGenerator::Professor - Provide Professor tools
   11 
   12 =cut
   13 
   14 use strict;
   15 use warnings;
   16 use base qw(WeBWorK::ContentGenerator);
   17 use Apache::Constants qw(:common);
   18 use CGI qw();
   19 use WeBWorK::ContentGenerator;
   20 use WeBWorK::Utils qw(formatDateTime dequoteHere);
   21 
   22 sub path {
   23   my ($self, $args) = @_;
   24 
   25   my $ce = $self->{courseEnvironment};
   26   my $root = $ce->{webworkURLs}->{root};
   27   my $courseName = $ce->{courseName};
   28   return $self->pathMacro($args,
   29     "Home" => "$root",
   30     $courseName => "$root/$courseName",
   31     "Professor" => "",
   32   );
   33 }
   34 
   35 sub title {
   36   my $self = shift;
   37 
   38   return "Professor Tools";
   39 }
   40 
   41 sub body {
   42   my $self = shift;
   43   my $r = $self->{r};
   44   my $course_env = $self->{courseEnvironment};
   45   my $course_name = $course_env->{courseName};
   46   my $authen_args = $self->url_authen_args();
   47   my $prof_url = $course_env->{webworkURLs}->{oldProf};
   48   my $full_url = "$prof_url?course=$course_name&$authen_args";
   49 
   50   print CGI::p(<<EOF), "\n";
   51 This preview release of WeBWorK 2.0 does not include Professor Tools.
   52 You will need to use the professor tools from WeBWorK 1.8 or earlier.
   53 Use the links below to go to the Professor pages of your system's
   54 WeBWorK 1.x installation.
   55 EOF
   56   print CGI::ul(
   57     CGI::li(
   58       CGI::a({-href=>$full_url}, "Go to Professor pages")
   59     ),
   60     CGI::li(
   61       CGI::a({-href=>$full_url, -target=>"_new"}, "Open Professor pages in new window")
   62     )
   63   ), "\n";
   64 
   65   return "";
   66 }
   67 
   68 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9