--- loncom/homework/grades.pm 2003/03/14 17:46:31 1.72 +++ loncom/homework/grades.pm 2003/03/23 08:10:30 1.75 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.72 2003/03/14 17:46:31 ng Exp $ +# $Id: grades.pm,v 1.75 2003/03/23 08:10:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1343,7 +1343,7 @@ sub processHandGrade { foreach (@msgnum) { $message.=$ENV{'form.'.$_} if ($_ =~ /savemsg|newmsg/ && $_ ne ''); } - $message =~ s/\s+/ /g; + #$message =~ s/\s+/ /g; $msgstatus = &Apache::lonmsg::user_normal_msg ($uname,$udom, $ENV{'form.msgsub'},$message); } @@ -2036,7 +2036,7 @@ sub upcsvScores_form { } CSVFORMJS - $ENV{'form.probTitle'} = &Apache::lonnet::metadata($url,'title'); + $ENV{'form.probTitle'} = &Apache::lonnet::gettitle($symb); $result.='
'."\n"; $result.='
'."\n"; $result.=' Specify a file containing the class scores for problem - '.$ENV{'form.probTitle'}. @@ -2365,7 +2365,7 @@ LISTJAVASCRIPT $result.='
'."
\n"; $result.=' Problems from: '."\n"; + my ($titles,$symbx) = &getSymbMap($request); + my ($curpage,$type,$mapId) = ($symb =~ /(.*?\.(page|sequence))___(\d+)___/); + my $ctr=0; + foreach (@$titles) { + my ($minder,$showtitle) = ($_ =~ /(\d+)\.(.*)/); + $result.=''."\n"; + $ctr++; + } + $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 $result; + $result.= < + + + + + + + +
+ + + + + + + + + + +
+  Specify file location and which Folder/Sequence to grade +
+ Sequence to grade: $sequence_selector +
+ + Filename of scoring office file: + +
+
+ + +SCANTRONFORM + + return $result; +} + +sub scantron_configphase { + my ($r) = @_; + my $sequence=$ENV{'form.selectpage'}; + my $result; + $result.="got page $sequence"; + $Apache::lonxml::debug=1; + &Apache::lonhomework::showhash(%ENV); + $Apache::lonxml::debug=0; + #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; +} + +sub scantron_process_students { + #FIXME + # loop through students, { + # Check if studnet info valid, if not add line to delay queue + # foreach question 'submit' the students answer to the server + # through grade target { + # generate data to pass back that includes grade recevied + # } + # } + # loop through delay queue { + # print out each delayed student with interface to select how + # to repair student provided info + # Expected errors include + # 1 bad/no stuid/username + # 2 invalid bubblings + # } + # if delay queue exists 2 submits one to process delayed students one + # to ignore delayed students, possibly saving the delay queue for later + +} +#-------- end of section for handling grading scantron forms ------- +# +#------------------------------------------------------------------- + + #-------------------------- Menu interface ------------------------- # #--- Show a Grading Menu button - Calls the next routine --- @@ -2795,7 +2900,7 @@ sub gradingmenu { var cmd = formname.command; formname.lastCmd.value = radioSelection(formname.command); formname.lastSec.value = pullDownSelection(formname.section); - if (cmd[0].checked || cmd[1].checked || cmd[2].checked) { + if (cmd[0].checked || cmd[1].checked || cmd[2].checked || cmd[4].checked) { formname.submit(); } @@ -2808,7 +2913,7 @@ sub gradingmenu { newWin.focus(); } - if (cmd[4].checked) { + if (cmd[5].checked) { if (!checkReceiptNo(formname,'notOK')) { return false;} formname.submit(); } @@ -2850,7 +2955,7 @@ sub gradingmenu { GRADINGMENUJS - my $probTitle = &Apache::lonnet::metadata($ENV{'form.url'},'title'); + my $probTitle = &Apache::lonnet::gettitle($ENV{'form.url'}); my $result='

 Manual Grading/View Submission

'. ''. ''; @@ -2909,6 +3014,10 @@ GRADINGMENUJS ($lastCmd eq 'csvupload' ? 'checked' : '').'> '. 'Upload scores from file'."\n"; + $result.=''."\n"; + if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) { $result.='
Problem: '.$probTitle.'
'. + ' '. + 'Grade scantron forms
'. 'print(&csvuploadmap($request)); } + } elsif ($command eq 'scantron_selectphase') { + $request->print(&scantron_selectphase($request)); + } elsif ($command eq 'scantron_configphase') { + $request->print(&scantron_configphase($request)); } else { $request->print("Unknown action: $command:"); }