--- loncom/homework/grades.pm 2003/10/16 03:51:52 1.130.2.1.2.11
+++ loncom/homework/grades.pm 2003/08/07 14:33:15 1.131
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.130.2.1.2.11 2003/10/16 03:51:52 albertel Exp $
+# $Id: grades.pm,v 1.131 2003/08/07 14:33:15 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2510,6 +2510,7 @@ to this page if the data selected is ins
$javascript
ENDPICK
+ $request->print(&show_grading_menu_form($symb,$url));
return '';
}
@@ -2800,7 +2801,7 @@ sub getSymbMap {
my ($request) = @_;
my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db',
$ENV{'request.course.fn'}.'_parms.db');
-# $navmap->init();
+ $navmap->init();
my %symbx = ();
my @titles = ();
@@ -3145,30 +3146,16 @@ sub getSequenceDropDown {
return $result;
}
-#FIXME, I am in loncreatecourse, use that one instead
-sub propath {
- my ($udom,$uname)=@_;
- $udom=~s/\W//g;
- $uname=~s/\W//g;
- my $subdir=$uname.'__';
- $subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/;
- my $proname="$Apache::lonnet::perlvar{'lonUsersDir'}/$udom/$subdir/$uname";
- return $proname;
-}
-
sub scantron_uploads {
if (!-e $Apache::lonnet::perlvar{'lonScansDir'}) { return ''};
my $result= '";
return $result;
}
@@ -3196,11 +3183,9 @@ sub scantron_selectphase {
my $file_selector=&scantron_uploads();
my $format_selector=&scantron_scantab();
my $result;
- #FIXME allow instructor to be able to download the scantron file
- # and to upload it,
$result.= <
-
+
$default_form_data
@@ -3226,18 +3211,11 @@ sub scantron_selectphase {
Format of data file: $format_selector
-
-
-
- Last line to expect an answer on:
-
-
-
-
+
$grading_menu_button
SCANTRONFORM
@@ -3249,7 +3227,6 @@ sub get_scantron_config {
my ($which) = @_;
my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab');
my %config;
- #FIXME probably should move to XML it has already gotten a bit much now
foreach my $line (<$fh>) {
my ($name,$descrip)=split(/:/,$line);
if ($name ne $which ) { next; }
@@ -3266,12 +3243,6 @@ sub get_scantron_config {
$config{'Qlength'}=$config[8];
$config{'Qoff'}=$config[9];
$config{'Qon'}=$config[10];
- $config{'PaperID'}=$config[11];
- $config{'PaperIDlength'}=$config[12];
- $config{'FirstName'}=$config[13];
- $config{'FirstNamelength'}=$config[14];
- $config{'LastName'}=$config[15];
- $config{'LastNamelength'}=$config[16];
last;
}
return %config;
@@ -3287,53 +3258,8 @@ sub username_to_idmap {
return %idmap;
}
-sub scantron_fixup_scanline {
- my ($scantron_config,$scan_data,$line,$whichline,$field,$args)=@_;
- if ($field eq 'ID') {
- if (length($args->{'newid'}) > $$scantron_config{'IDlength'}) {
- return ($line,1,'New value to large');
- }
- if (length($args->{'newid'}) < $$scantron_config{'IDlength'}) {
- $args->{'newid'}=sprintf('%-'.$$scantron_config{'IDlength'}.'s',
- $args->{'newid'});
- }
- substr($line,$$scantron_config{'IDstart'}-1,
- $$scantron_config{'IDlength'})=$args->{'newid'};
- if ($args->{'newid'}=~/^\s*$/) {
- &scan_data($scan_data,"$whichline.user",
- $args->{'username'}.':'.$args->{'domain'});
- }
- } elsif ($field eq 'answer') {
- my $length=$scantron_config->{'Qlength'};
- my $off=$scantron_config->{'Qoff'};
- my $on=$scantron_config->{'Qon'};
- my $answer=${off}x$length;
- if ($args->{'response'} eq 'none') {
- &scan_data($scan_data,
- "$whichline.no_bubble.".$args->{'question'},'1');
- } else {
- substr($answer,$args->{'response'},1)=$on;
- &scan_data($scan_data,
- "$whichline.no_bubble.".$args->{'question'},undef,'1');
- }
- my $where=$length*($args->{'question'}-1)+$scantron_config->{'Qstart'};
- substr($line,$where-1,$length)=$answer;
- }
- return $line;
-}
-
-sub scan_data {
- my ($scan_data,$key,$value,$delete)=@_;
- my $filename=$ENV{'form.scantron_selectfile'};
- if (defined($value)) {
- $scan_data->{$filename.'_'.$key} = $value;
- }
- if ($delete) { delete($scan_data->{$filename.'_'.$key}); }
- return $scan_data->{$filename.'_'.$key};
-}
-
sub scantron_parse_scanline {
- my ($line,$whichline,$scantron_config,$scan_data)=@_;
+ my ($line,$scantron_config)=@_;
my %record;
my $questions=substr($line,$$scantron_config{'Qstart'}-1);
my $data=substr($line,0,$$scantron_config{'Qstart'}-1);
@@ -3347,15 +3273,6 @@ sub scantron_parse_scanline {
}
$record{'scantron.ID'}=substr($data,$$scantron_config{'IDstart'}-1,
$$scantron_config{'IDlength'});
- $record{'scantron.PaperID'}=
- substr($data,$$scantron_config{'PaperID'}-1,
- $$scantron_config{'PaperIDlength'});
- $record{'scantron.FirstName'}=
- substr($data,$$scantron_config{'FirstName'}-1,
- $$scantron_config{'FirstNamelength'});
- $record{'scantron.LastName'}=
- substr($data,$$scantron_config{'LastName'}-1,
- $$scantron_config{'LastNamelength'});
my @alphabet=('A'..'Z');
my $questnum=0;
while ($questions) {
@@ -3363,48 +3280,31 @@ sub scantron_parse_scanline {
my $currentquest=substr($questions,0,$$scantron_config{'Qlength'});
substr($questions,0,$$scantron_config{'Qlength'})='';
if (length($currentquest) < $$scantron_config{'Qlength'}) { next; }
- my @array=split($$scantron_config{'Qon'},$currentquest,-1);
+ my (@array)=split(/$$scantron_config{'Qon'}/,$currentquest);
+ if (scalar(@array) gt 2) {
+ #FIXME do something intelligent with double bubbles
+ Apache->request->print(" Wha!!!