--- loncom/homework/grades.pm 2004/11/06 01:22:11 1.204.2.8
+++ loncom/homework/grades.pm 2004/10/14 20:39:34 1.221
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.204.2.8 2004/11/06 01:22:11 albertel Exp $
+# $Id: grades.pm,v 1.221 2004/10/14 20:39:34 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,16 +25,6 @@
#
# http://www.lon-capa.org/
#
-# 2/9,2/13 Guy Albertelli
-# 6/8 Gerd Kortemeyer
-# 7/26 H.K. Ng
-# 8/20 Gerd Kortemeyer
-# Year 2002
-# June-August H.K. Ng
-# Year 2003
-# February, March H.K. Ng
-# July, H. K. Ng
-#
package Apache::grades;
use strict;
@@ -174,7 +164,6 @@ sub get_display_part {
if ($symb eq '') { $symb=&Apache::lonnet::symbread($url) }
}
my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',$symb);
- &Apache::lonnet::logthis("\nsymb $symb\n url $url\npartID $partID\ndisplay $display \n");
if (defined($display) and $display ne '') {
$display.= " (id $partID)";
} else {
@@ -365,27 +354,36 @@ sub getclasslist {
#
my %sections;
my %fullnames;
- foreach (keys(%$classlist)) {
- # the following undefs are for 'domain', and 'username' respectively.
- my (undef,undef,$end,$start,$id,$section,$fullname,$status)=
- @{$classlist->{$_}};
+ foreach my $student (keys(%$classlist)) {
+ my $end =
+ $classlist->{$student}->[&Apache::loncoursedata::CL_END()];
+ my $start =
+ $classlist->{$student}->[&Apache::loncoursedata::CL_START()];
+ my $id =
+ $classlist->{$student}->[&Apache::loncoursedata::CL_ID()];
+ my $section =
+ $classlist->{$student}->[&Apache::loncoursedata::CL_SECTION()];
+ my $fullname =
+ $classlist->{$student}->[&Apache::loncoursedata::CL_FULLNAME()];
+ my $status =
+ $classlist->{$student}->[&Apache::loncoursedata::CL_STATUS()];
# filter students according to status selected
if ($filterlist && $ENV{'form.Status'} ne 'Any') {
if ($ENV{'form.Status'} ne $status) {
- delete ($classlist->{$_});
+ delete ($classlist->{$student});
next;
}
}
- $section = ($section ne '' ? $section : 'no');
+ $section = ($section ne '' ? $section : 'none');
if (&canview($section)) {
if ($getsec eq 'all' || $getsec eq $section) {
$sections{$section}++;
- $fullnames{$_}=$fullname;
+ $fullnames{$student}=$fullname;
} else {
- delete($classlist->{$_});
+ delete($classlist->{$student});
}
} else {
- delete($classlist->{$_});
+ delete($classlist->{$student});
}
}
my %seen = ();
@@ -993,6 +991,7 @@ sub sub_page_kw_js {
my $request = shift;
my $iconpath = $request->dir_config('lonIconsURL');
&commonJSfunctions($request);
+ my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
$request->print(<
';
$studentTable.=&show_grading_menu_form($ENV{'form.symb'},$ENV{'form.url'});
my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' :
@@ -3470,10 +3457,11 @@ sub scantron_filenames {
}
sub scantron_uploads {
+ my ($file2grade) = @_;
my $result= '";
return $result;
@@ -3519,13 +3507,13 @@ sub scantron_CODEunique {
}
sub scantron_selectphase {
- my ($r) = @_;
+ my ($r,$file2grade) = @_;
my ($symb,$url)=&get_symb_and_url($r);
if (!$symb) {return '';}
my $sequence_selector=&getSequenceDropDown($r,$symb);
my $default_form_data=&defaultFormData($symb,$url);
my $grading_menu_button=&show_grading_menu_form($symb,$url);
- my $file_selector=&scantron_uploads();
+ my $file_selector=&scantron_uploads($file2grade);
my $format_selector=&scantron_scantab();
my $CODE_selector=&scantron_CODElist();
my $CODE_unique=&scantron_CODEunique();
@@ -4325,8 +4313,8 @@ sub scantron_get_correction {
} elsif ($error eq 'duplicateCODE') {
$r->print("'.
' '.
' ';
my ($version);
@@ -3237,9 +3229,6 @@ sub displaySubByDates {
for ($version=1;$version<=$$record{'version'};$version++) {
my $timestamp = scalar(localtime($$record{$version.':timestamp'}));
$studentTable.='Date/Time '.
- ($isCODE?'CODE ':'').
'Submission '.
'Status '.$timestamp.' ';
- if ($isCODE) {
- $studentTable.=''.$record->{$version.':resource.CODE'}.' ';
- }
my @versionKeys = split(/\:/,$$record{$version.':keys'});
my @displaySub = ();
foreach my $partid (@{$parts}) {
@@ -3408,8 +3397,6 @@ sub updateGradeByPage {
$curRes = $iterator->next();
}
- $navmap->untieHashes();
-
$studentTable.='
The encoded CODE has also been used by a previous paper ".join(', ',@{$arg}).", and CODEs are supposed to be unique
\n"); } - $r->print("The CODE on the form is '".
- $$scan_record{'scantron.CODE'}."'
\n");
+ $r->print("
The CODE on the form is ".
+ $$scan_record{'scantron.CODE'}."
\n");
$r->print("
The ID on the form is ".
$$scan_record{'scantron.ID'}."
\n");
$r->print("The name on the paper is ".
@@ -4472,14 +4460,8 @@ sub scantron_validate_CODE {
$scan_data);
my $CODE=$$scan_record{'scantron.CODE'};
my $error=0;
- if (!&Apache::lonnet::validCODE($CODE)) {
- &scantron_get_correction($r,$i,$scan_record,
- \%scantron_config,
- $line,'incorrectCODE',\%allcodes);
- return(1,$currentphase);
- }
if (%allcodes && !exists($allcodes{$CODE})
- && !$$scan_record{'scantron.useCODE'}) {
+ && !$$scan_record{'scantron.useCODE'}) {
&scantron_get_correction($r,$i,$scan_record,
\%scantron_config,
$line,'incorrectCODE',\%allcodes);
@@ -4651,8 +4633,6 @@ SCANTRONFORM
if (exists($scan_record->{'scantron.CODE'}) &&
$scan_record->{'scantron.CODE'}) {
$form{'CODE'}=$scan_record->{'scantron.CODE'};
- } else {
- $form{'CODE'}='';
}
my $result=&Apache::lonnet::ssi($resource->src(),%form);
if (&Apache::loncommon::connection_aborted($r)) { last; }
@@ -4667,7 +4647,6 @@ SCANTRONFORM
# my $lasttime = &Time::HiRes::time()-$start;
# $r->print("
took $lasttime
"); - $navmap->untieHashes(); $r->print(""); $r->print(&show_grading_menu_form($symb,$url)); return ''; @@ -4728,7 +4707,8 @@ sub scantron_upload_scantron_data_save { } return ''; } - $r->print("Doing upload to ".$ENV{'form.courseid'}."