#!/usr/local/bin/perl ## $Id$ #strings for HTML display in webwork use lib '.'; use webworkInit; # WeBWorKInitLine use strict; use Global; sub htmlTOP { my ($title, $bg_url, @headers) = @_; my $background_url = $bg_url || $Global::background_plain_url; my $out = < $title

WeBWorK

ENDhtmlTOP $out; } sub sessionKeyInputs { my($inputsref) = @_; # Argument is a pointer to the hash %inputs my $out = qq! !; $out; } sub htmlBOTTOM { my ($scriptName,$inputsref, $helpFile) = @_; my ($studentLogin, $studentID, $studentName, $studentEmail, $setNumber, $sectionName,$recitationName) = ('','','','','','',''); my ($psvn,$probNum); $psvn = ( defined($$inputsref{'probSetKey'}) ) ? $$inputsref{'probSetKey'}: ""; $probNum = ( defined($$inputsref{'probNum'} ) ) ? $$inputsref{'probNum'} : ""; my $mode = $$inputsref{'Mode'}; $mode = $Global::htmlModeDefault unless $mode; if ($psvn) { attachProbSetRecord($psvn); $studentLogin = getStudentLogin($psvn); attachCLRecord($studentLogin); $studentID = CL_getStudentID($studentLogin); $studentEmail = CL_getStudentEmailAddress($studentLogin); $studentName = CL_getStudentName($studentLogin); $setNumber = getSetNumber($psvn); $sectionName = CL_getClassSection($studentLogin); $sectionName = '' unless defined($sectionName); $recitationName = CL_getClassRecitation($studentLogin); $recitationName = '' unless defined($recitationName); } #This put in to work with the old stuff (before EmailAddress was added to DB) # unless (defined($studentEmail)) { # $studentEmail = $$inputsref{'user'} . '@uhura.cc.rochester.edu'; #} my $out = '


'; $out .= '' if $$inputsref{user} && $$inputsref{key} && $$inputsref{course}; my $To = $Global::feedbackAddress; $To =~ s/\s//g; $out .= '\n"; $out .= qq{ } if (defined $helpFile); $out .= qq{ } unless($0 =~ /welcome.pl/) ; # don't put this on the probSet.pl page # # removed the above line from 7 lines up. It's not needed and is sometimes undefined # giving a warning message. # put link to Professor's page if user is a professor my $User = $$inputsref{user} if defined $$inputsref{user}; my $Course = $$inputsref{course} if defined $$inputsref{course}; my $permissions = 0; if (defined $User and defined $Course) { my $permissionsFile = &Global::getCoursePermissionsFile($Course); $permissions = &get_permissions($User, $permissionsFile); } if ($permissions == $Global::instructor_permissions) { $out .= qq{ }; }; $out .= '
' . qq{
} . '
' . qq{
}; $out .= &sessionKeyInputs($inputsref) . "
[Help]

'; $out .= qq!Problem Set Version Number: $$inputsref{'probSetKey'}\n! if $$inputsref{'probSetKey'}; $out .= qq{
Page produced by script: $scriptName } if $scriptName; $out .= qq{

Compiler warnings:

$Global::WARNINGS} if $Global::WARNINGS; $out .= ''; } sub html_NO_PERMISSION { my $out = &htmlTOP; $out .=qq~

NO PERMISSION

Sorry, you do not have permission to use this script! ~; $out .= &htmlBOTTOM; $out; } 1;