--- loncom/homework/grades.pm 2003/03/28 20:49:55 1.80 +++ loncom/homework/grades.pm 2003/03/28 23:44:31 1.81 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.80 2003/03/28 20:49:55 ng Exp $ +# $Id: grades.pm,v 1.81 2003/03/28 23:44:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2779,6 +2779,15 @@ sub updateGradeByPage { # #------ start of section for handling grading by page/sequence --------- +sub defaultFormData { + my ($symb,$url)=@_; + return ' + '."\n". + ''."\n". + ''."\n". + ''."\n"; +} + sub getSequenceDropDown { my ($request,$symb)=@_; my $result=''; + opendir(DIR,$Apache::lonnet::perlvar{'lonScansDir'}); + my @files=sort(readdir(DIR)); + foreach my $filename (@files) { + if ($filename eq '.' or $filename eq '..') { next; } + $result.="\n"; + } + closedir(DIR); + $result.=""; + return $result; +} + sub scantron_selectphase { my ($r) = @_; 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 $result; $result.= < - - + $default_form_data
@@ -2823,12 +2848,7 @@ sub scantron_selectphase {
- - Filename of scoring office file: - + Filename of scoring office file: $file_selector
@@ -2837,6 +2857,7 @@ sub scantron_selectphase { +$grading_menu_button SCANTRONFORM return $result; @@ -2844,12 +2865,44 @@ SCANTRONFORM sub scantron_configphase { my ($r) = @_; - my $sequence=$ENV{'form.selectpage'}; + my (undef,undef,$sequence)=split(/___/,$ENV{'form.selectpage'}); my $result; - $result.="got page $sequence"; - $Apache::lonxml::debug=1; - &Apache::lonhomework::showhash(%ENV); - $Apache::lonxml::debug=0; + my ($symb,$url)=&get_symb_and_url($r); + if (!$symb) {return '';} + my $default_form_data=&defaultFormData($symb,$url); + my $grading_menu_button=&show_grading_menu_form($symb,$url); + my $file_selector; + $result.= < + + $default_form_data + + + + +
+ + + + + + + + + + +
+  Select a format for the data file. +
+ Format of data file: +
+ Filename of scoring office file: $file_selector +
+
+ + +$grading_menu_button +SCANTRONFORM #FIXME Needs to present some lines from the file and allow the instructor to specify which columns represent what data, possibly have some nice defaults setup, probably should do a pass through all problems for a student to get an idea of how many questions there are, and homw many lines we'll have, return $result; } @@ -3088,7 +3141,8 @@ GRADINGMENUJS 'Upload scores from file'."\n"; $result.=''. - ' '. + ' '. 'Grade scantron forms'."\n"; if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) {