#!/usr/local/bin/webwork-perl
## This file is profScoring.pl
## It provides access to utilities for building, correcting and viewing problem sets
##
####################################################################
# Copyright @ 1995-1998 University of Rochester
# All Rights Reserved
####################################################################
use lib '.'; use webworkInit; # WeBWorKInitLine
use CGI qw(:standard);
use Global;
use Auth;
use strict;
# begin Timing code
use Benchmark;
my $beginTime = new Benchmark;
# end Timing code
&CGI::ReadParse;
my %inputs =%main::in;
# get information from CGI inputs (see also below for additional information)
my $Course = $inputs{'course'};
my $User = $inputs{'user'};
my $Session_key = $inputs{'key'};
# verify that information has been received
unless($Course && $User && $Session_key) {
&wwerror("$0","The script did not receive the proper input data.","","");
die "The script profLogin.pl did not receive the proper input data.";
}
# establish environment for this script
&Global::getCourseEnvironment($inputs{'course'});
my $cgiURL = getWebworkCgiURL;
my $courseScriptsDirectory = getCourseScriptsDirectory;
my $databaseDirectory = getCourseDatabaseDirectory;
my $htmlURL = getCourseHtmlURL;
my $scriptDirectory = getWebworkScriptDirectory;
my $scoringDirectory = getCourseScoringDirectory;
my $dat = getDat;
require "${scriptDirectory}$Global::DBglue_pl";
require "${scriptDirectory}$Global::classlist_DBglue_pl";
require "${scriptDirectory}$Global::FILE_pl";
require "${scriptDirectory}$Global::HTMLglue_pl";
# log access
&Global::log_info('', query_string);
my $permissionsFile = &Global::getCoursePermissionsFile($inputs{'course'});
my $permissions = &get_permissions($inputs{'user'}, $permissionsFile);
my $keyFile = &Global::getCourseKeyFile($inputs{'course'});
#verify session key
&verify_key($inputs{'user'}, $inputs{'key'}, $keyFile, $inputs{'course'});
# verify permissions are correct
if ($permissions != $Global::instructor_permissions ) {
print "permissions = $permissions instructor_permissions = $Global::instructor_permissions\n";
print &html_NO_PERMISSION;
exit(0);
}
# get the rest of the information from the submitted form
# nothing further to get in this case
# get information from the data base.
# a list of all of the currently created sets:
# Keys contains the set numbers and the value is a representative psvn
my %availableSets = &getAllProbSetNumbersHash;
my @sortedSetNames = &sortSetNamesByDueDate(\%availableSets);
# print HTML text
print &htmlTOP("Scoring Utilities");
# print navigation buttons
print qq!
!;
print <
EOF
## profScoring form -- allows you to score problem sets
print <
WeBWorK scoring programs for $Course
From this page, you can score problem sets, download and upload the scoring
spread sheet files, etc.
Select the set(s) you want to score.
EOF
print <
1. Score problem sets in $Course:
You can download files for editing or viewing in either cvs (i.e. comma delimited), html, text, or
tab (i.e. tab delimited) format.
2. Download (or view) $Course scoring files to your personal computer.
csv is a supported format for Excel and is the recommended format if you use Excel.
The totals file (${Course}_totals.csv) is the cummulative semester record of grades.
The scr files (e.g. s2scr.csv) give, for each problem set, the STATUS of individual problems.
The STATUS is a number between 0 and 1 depending on (partial) credit earned. "STATUS" times "PROB VAL" gives the score for the problem.
The ful files (e.g. s2ful.csv) give, for each problem set, the STATUS plus data on
the number of correct and incorrect attempts for each problem.
all files include backup files, etc.
EOF
print <
Use this for simple editing, e.g. changing a few scores or possibly adding a new column of exam grades.
For more complicated editing, download the file to a preadsheet program such as Excel by option 2 above.
EOF
print <
3. Simple editing of $Course scoring files.
You can upload scoring files from your personal computer in cvs (i.e. comma delimited),
tab (i.e. tab delimited), or html format. Usually you would do this after
downloading and editing a file in Excel or some other spreadsheet program. Only valid scoring files
with filenames ending in "_totals.ext", "scr.ext", and "ful.ext" can be uploaded where the extension
"ext" must be "csv", "txt" (for tab delimited), "html" or "htm". You can not upload backup files without
renaming them.
EOF
print <
4. Upload $Course scoring files from your personal computer.
Use this for sorting scoring files. Student records can be sorted by
one of six methods: (a) by student name, (b) by student ID, (c) by section then
by student name, (d) by section then by student ID, (e) by recitation then
by student name and (f) by recitation then by student ID.
EOF
print &htmlBOTTOM("profScoring.pl", \%inputs,'profScoringHelp.html');
# begin Timing code
my $endTime = new Benchmark;
&Global::logTimingInfo($beginTime,$endTime,"profScoring.pl",$inputs{'course'},$inputs{'user'});
# end Timing code
exit;
5. Sort $Course scoring files.