--- loncom/homework/grades.pm 2003/03/11 19:32:02 1.71 +++ loncom/homework/grades.pm 2003/03/17 19:08:50 1.73 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.71 2003/03/11 19:32:02 ng Exp $ +# $Id: grades.pm,v 1.73 2003/03/17 19:08:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -209,6 +209,9 @@ sub jscriptNform { $jscript.= '
'."\n". ''."\n". ''."\n". + ''."\n". + ''."\n". + ''."\n". ''."\n". ''."\n". ''."\n". @@ -237,8 +240,7 @@ sub verifyreceipt { my $title.='

Verifying Submission Receipt '. $receipt.'

'."\n". - 'Problem: '. - &Apache::lonnet::metadata($ENV{'form.url'},'title').'

'."\n"; + 'Problem: '.$ENV{'form.probTitle'}.'

'."\n"; my ($string,$contents,$matches) = ('','',0); my (undef,undef,$fullname) = &getclasslist('all','0'); @@ -273,10 +275,6 @@ sub verifyreceipt { return $string.&show_grading_menu_form($symb,$url); } -# -# Pick student and page/sequence for manual grading - - #--- This is called by a number of programs. #--- Called from the Grading Menu - View/Grade an individual student #--- Also called directly when one clicks on the subm button @@ -284,7 +282,7 @@ sub verifyreceipt { sub listStudents { my ($request) = shift; - my ($symb,$url) = &get_symb_and_url(); + my ($symb,$url) = &get_symb_and_url($request); my $cdom = $ENV{"course.$ENV{'request.course.id'}.domain"}; my $cnum = $ENV{"course.$ENV{'request.course.id'}.num"}; my $getsec = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'}; @@ -306,8 +304,8 @@ sub listStudents { $result='

 '. $viewgrade. ' Submissions for a Student or a Group of Students

'. - ''.$result; + '
'. - 'Problem: '.&Apache::lonnet::metadata($url,'title').'
'.$result; $request->print(< @@ -357,6 +355,9 @@ LISTJAVASCRIPT ''."\n". '
'."\n". '
'."\n". + ''."\n". + ''."\n". + ''."\n". ''."\n". ''."\n". 'To '.lc($viewgrade).' a submission, click on the check box next to the student\'s name. Then '."\n". @@ -459,7 +460,8 @@ sub sub_page_js { function updateRadio(formname,id,weight) { var gradeBox = eval("formname.GD_BOX"+id); var radioButton = eval("formname.RADVAL"+id); - var pts = checkSolved(formname,id) == 'update' ? gradeBox.value : weight; + var oldpts = eval("formname.oldpts"+id+".value"); + var pts = checkSolved(formname,id) == 'update' ? gradeBox.value : oldpts; gradeBox.value = pts; var resetbox = false; if (isNaN(pts) || pts < 0) { @@ -496,16 +498,17 @@ sub sub_page_js { stores.value = "0"; } - function writeBox(formname,id,pts,weight) { + function writeBox(formname,id,pts) { var gradeBox = eval("formname.GD_BOX"+id); if (checkSolved(formname,id) == 'update') { gradeBox.value = pts; } else { - gradeBox.value = weight; + var oldpts = eval("formname.oldpts"+id+".value"); + gradeBox.value = oldpts; var radioButton = eval("formname.RADVAL"+id); for (var i=0; i 600) { height = 600; @@ -762,18 +765,18 @@ sub sub_page_kw_js { pWin.document.write("
"); } -function displaySavedMsg(ctr,msg,shwsel) { + function displaySavedMsg(ctr,msg,shwsel) { pWin.document.write(""); pWin.document.write(""); pWin.document.write(""); - pWin.document.write(""); + pWin.document.write(""); } function newMsg(newmsg,shwsel) { pWin.document.write(""); pWin.document.write(""); pWin.document.write(""); - pWin.document.write(""); + pWin.document.write(""); } function msgTail() { @@ -871,7 +874,6 @@ function displaySavedMsg(ctr,msg,shwsel) function highlightend() { hwdWin.document.write("
'. + 'Problem: '.$ENV{'form.probTitle'}.'
"+ctr+"
New
"); hwdWin.document.write(" "); -// hwdWin.document.write("  "); hwdWin.document.write("  "); hwdWin.document.write("

"); hwdWin.document.write("
"); @@ -905,7 +907,7 @@ sub gradeBox { while ($ctr<=$wgt) { $result.= ' '.$ctr."\n"; $result.=(($ctr+1)%10 == 0 ? '' : ''); $ctr++; @@ -964,7 +966,6 @@ sub show_problem { $result.=''; $result.='
'; return $result; -# $request->print($result); } # --------------------------- show submissions of a student, option to grade @@ -972,24 +973,20 @@ sub submission { my ($request,$counter,$total) = @_; (my $url=$ENV{'form.url'})=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; -# if ($ENV{'form.student'} eq '') { &moreinfo($request,'Need student login id'); return ''; } my ($uname,$udom) = ($ENV{'form.student'},$ENV{'form.userdom'}); ($uname,$udom) = &finduser($uname) if $udom eq ''; $ENV{'form.fullname'} = &get_fullname ($uname,$udom) if $ENV{'form.fullname'} eq ''; -# if ($uname eq '') { &moreinfo($request,'Unable to find student'); return ''; } my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))); if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; } my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : ''); -# $ENV{'form.vProb'} = $ENV{'form.vProb'} ne '' ? $ENV{'form.vProb'} : 'yes'; # header info if ($counter == 0) { &sub_page_js($request); &sub_page_kw_js($request); $request->print('

 Submission Record

'."\n". - ' Problem: '. - &Apache::lonnet::metadata($url,'title').''."\n"); + ' Problem: '.$ENV{'form.probTitle'}.''."\n"); # option to display problem, only once else it cause problems # with the form later since the problem has a form. @@ -1011,13 +1008,16 @@ sub submission { $ENV{'form.kwsize'} = $keyhash{$loginuser.'_kwsize'} ne '' ? $keyhash{$loginuser.'_kwsize'} : '0'; $ENV{'form.kwstyle'} = $keyhash{$loginuser.'_kwstyle'} ne '' ? $keyhash{$loginuser.'_kwstyle'} : ''; $ENV{'form.msgsub'} = $keyhash{$symb.'_subject'} ne '' ? - $keyhash{$symb.'_subject'} : &Apache::lonnet::metadata($url,'title'); + $keyhash{$symb.'_subject'} : $ENV{'form.probTitle'}; $ENV{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0'; } $request->print('
'."\n". ''."\n". + ''."\n". + ''."\n". + ''."\n". ''."\n". ''."\n". ''."\n". @@ -1195,6 +1195,9 @@ KEYWORDS # return if view submission with no grading option if ($ENV{'form.showgrading'} eq '') { $request->print('
'."\n"); + $request->print(&show_grading_menu_form($symb,$url)) + if (($ENV{'form.command'} eq 'submission') || + ($ENV{'form.command'} eq 'processGroup' && $counter == $total)); return; } @@ -1227,8 +1230,6 @@ KEYWORDS push @partlist,$partid; $request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record)); - -# $request->print($result); } $result=''."\n"; @@ -1281,9 +1282,7 @@ sub get_last_submission { for ($version=1;$version<=$returnhash{'version'};$version++) { foreach (sort(split(/\:/,$returnhash{$version.':keys'}))) { $lasthash{$_}=$returnhash{$version.':'.$_}; -# if ($returnhash{$version.':'.$_} =~ /(SUBMITTED|DRAFT)$/) { $timestamp = scalar(localtime($returnhash{$version.':timestamp'})); -# } } } foreach ((keys %lasthash)) { @@ -1344,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); } @@ -1466,8 +1465,6 @@ sub processHandGrade { $ENV{'form.student'} = $uname; $ENV{'form.userdom'} = $udom; $ENV{'form.fullname'} = $$fullname{$_}; -# $ENV{'form.'.$_.':submitted_by'} = $submitter; -# print "submitter=$ENV{'form.'.$_.':submitted_by'}= $submitter:
"; &submission($request,$ctr,$total); $ctr++; } @@ -1514,11 +1511,11 @@ sub saveHandGrade { } $newrecord{'resource.'.$_.'.submitted_by'} = $submitter if ($submitter && ($record{'resource.'.$_.'.submitted_by'} ne $submitter)); + $newrecord{'resource.'.$_.'regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; } } if (scalar(keys(%newrecord)) > 0) { - $newrecord{'resource.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; &Apache::lonnet::cstore(\%newrecord,$symb, $ENV{'request.course.id'},$domain,$stuname); } @@ -1707,8 +1704,7 @@ sub viewgrades { my ($symb,$url) = ($ENV{'form.symb'},$ENV{'form.url'}); my $result='

Manual Grading

'; - $result.='Problem: '.&Apache::lonnet::metadata($ENV{'form.url'},'title') - .''."\n"; + $result.='Problem: '.$ENV{'form.probTitle'}.''."\n"; #view individual student submission form - called using Javascript viewOneStudent $result.=&jscriptNform($url,$symb); @@ -1718,7 +1714,11 @@ sub viewgrades { ''."\n". ''."\n". ''."\n". - ''."\n"; + ''."\n". + ''."\n". + ''."\n". + ''."\n"; + $result.='

Assign Common Grade To '; if ($ENV{'form.section'} eq 'all') { $result.='Class

'; @@ -1729,12 +1729,6 @@ sub viewgrades { } $result.= '
'."\n". '
'; -# $result.='To assign the same score for all the students use the radio buttons or '. -# 'text box below. To assign scores individually fill in the score boxes for '. -# 'each student in the table below. A part that has already '. -# 'been graded does not get changed using the radio buttons or text box. '. -# 'If needed, it has to be changed individually.'; -# $result.='
'; #radio buttons/text box for assigning points for a section or class. #handles different parts of a problem my ($partlist,$handgrade) = &response_type($ENV{'form.url'}); @@ -1884,10 +1878,8 @@ sub editgrades { my $symb=$ENV{'form.symb'}; my $url =$ENV{'form.url'}; my $title='

Current Grade Status

'; - $title.='Problem: '. - &Apache::lonnet::metadata($ENV{'form.url'},'title').'
'."\n"; + $title.='Problem: '.$ENV{'form.probTitle'}.'
'."\n"; $title.='Section: '.$ENV{'form.section'}.''."\n"; - $title.= &show_grading_menu_form ($symb,$url); my $result= '
'."\n"; $result.= ''. ''."\n"; @@ -1987,6 +1979,7 @@ sub editgrades { my $awarded = $ENV{'form.GD_'.$user.'_'.$part.'_'.$type}; if ($awarded ne '' && $awarded ne $old_aw) { $newrecord{'resource.'.$part.'.'.$type}= $awarded; + $newrecord{'resource.'.$part.'regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; $updateflag=1; } $result .= ''. @@ -1996,12 +1989,12 @@ sub editgrades { $result .= ''."\n"; if ($updateflag) { $count++; - $newrecord{'resource.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; &Apache::lonnet::cstore(\%newrecord,$symb,$ENV{'request.course.id'}, $udom,$user); } } - $result .= '
UsernameFullname'.$old_aw.' 
'."\n"; + $result .= '
'."\n". + &show_grading_menu_form ($symb,$url); my $msg = 'Number of records updated = '.$rec_update. ' for '.$count.' student'.($count <= 1 ? '' : 's').'.
'. 'Total number of students = '.$ENV{'form.total'}.'
'; @@ -2025,6 +2018,48 @@ sub split_part_type { # #-------------------------- Next few routines handles grading by csv upload # +#--- Menu to upload a csv scores --- +sub upcsvScores_form { + my ($request) = shift; + my ($symb,$url)=&get_symb_and_url($request); + if (!$symb) {return '';} + my $result =< + function checkUpload(formname) { + if (formname.upfile.value == "") { + alert("Please use the browse button to select a file from your local directory."); + return false; + } + formname.submit(); + if (navigator.appName !="Netscape") {self.close()}; //if netscape if appears to close before submit!!! + // any suggestion how to get around this?? + } + +CSVFORMJS + $ENV{'form.probTitle'} = &Apache::lonnet::metadata($url,'title'); + $result.='
'."\n"; + $result.=''."\n"; + $result.='
'."\n"; + $result.=' Specify a file containing the class scores for problem - '.$ENV{'form.probTitle'}. + '.
'."\n"; + my $upfile_select=&Apache::loncommon::upfile_select_html(); + $result.=< + + + + +$upfile_select +
  + + + +ENDUPFORM + $result.='
'."\n"; + $result.='
'."\n"; + return $result; +} + #--- Javascript to handle csv upload sub csvupload_javascript_reverse_associate { return(<'; + $result.='Problem: '.$ENV{'form.probTitle'}.''; my ($partlist,$handgrade) = &response_type($url); my ($resptype,$hdgrade)=('','no'); for (sort keys(%$handgrade)) { @@ -2141,6 +2175,9 @@ to this page if the data selected is ins value="$ENV{'form.upfile_associate'}" /> + + +
'."\n"; - - $result.='
'."\n"; - $result.=''."\n"; - $result.='
'."\n"; - $result.=' Specify a file containing the class scores for above resource
'."\n"; - my $upfile_select=&Apache::loncommon::upfile_select_html(); - $result.=< - - - -$upfile_select -
  - -ENDUPFORM - $result.='
'."\n"; - $result.='
'."\n"; - return $result; -} - -#--- Handgrading problems --- -sub viewGradeaStu_form { - my ($symb,$url,$response,$handgrade) = @_; - my ($classlist,$sections) = &getclasslist('all','0'); - my $result.='
'."\n"; - $result.=''."\n"; - $result.='
'."\n"; - $result.=' '; - $result.=($handgrade eq 'yes' ? 'View/Grade' : 'View').' an Individual Student\'s Submission
'."\n"; - $result.='
'."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n"; - - $result.=' Select section: '."\n"; - $result.='  Display students who has: '. - ' submitted'. - ' everybody
'; - if (ref($sections)) { - $result.=' (Section "no" implies the students were not assigned a section.)
' - if (grep /no/,@$sections); - } - - - $result.='
 '."\n"; - $result.='
'."\n"; - $result.='
'."\n"; - return $result; -} - -#--- Handgrading problems by page/sequence for each student --- -sub gradeByPage_form { - my ($symb,$url,$response,$handgrade) = @_; - my ($classlist,$sections) = &getclasslist('all','0'); - my $result.='
'."\n"; - $result.=''."\n"; - $result.='
'."\n"; - $result.=' '; - $result.='Handgrade an Individual Student\'s by Page/Sequence
'."\n"; - $result.=''."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n"; - - $result.=' Select section: '."\n"; - - $result.='
 '."\n".''."\n"; - $result.='
'."\n"; - $result.='
'."\n"; - return $result; -} - +#-------------- Next few routines handles grading by page/sequence +# +#--- Select a page/sequence and a student to grade sub pickStudentPage { my ($request) = shift; @@ -2470,8 +2338,7 @@ function radioSelection(radioButton) { var selection=null; for (var i=0; i LISTJAVASCRIPT - my ($symb,$url) = &get_symb_and_url(); + my ($symb,$url) = &get_symb_and_url($request); my $cdom = $ENV{"course.$ENV{'request.course.id'}.domain"}; my $cnum = $ENV{"course.$ENV{'request.course.id'}.num"}; my $getsec = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'}; @@ -2517,19 +2383,27 @@ LISTJAVASCRIPT $result.=''."\n"; $ctr++; } - $result.=''."\n"; - $result.=''."\n"; + $result.=''."\n". + ''."\n"; $result.=' View Problems: no '."\n". ' yes '."
\n"; + $result.=' Submission Details: '. ' none'."\n". ' dates and submissions'."\n". ' all details'."\n"; + $result.=''."\n". - ''."\n". - ''."\n". - ''."

\n"; + ''."\n". + ''."\n". + ''."

\n". + ''."\n". + ''."\n"; + + $result.='
 
'."\n"; + $request->print($result); my $studentTable.=' Select a Student you wish to grade
'. @@ -2620,10 +2494,12 @@ sub getSymbMap { return \@titles,\%symbx; } +# +#--- Displays a page/sequence w/wo problems, w/wo submissions sub displayPage { my ($request) = shift; - my ($symb,$url) = &get_symb_and_url(); + my ($symb,$url) = &get_symb_and_url($request); my $cdom = $ENV{"course.$ENV{'request.course.id'}.domain"}; my $cnum = $ENV{"course.$ENV{'request.course.id'}.num"}; my $getsec = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'}; @@ -2648,12 +2524,14 @@ sub displayPage { $map->map_finish()); my $studentTable='
'."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n"; + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n"; my $checkIcon = ''; @@ -2674,7 +2552,7 @@ sub displayPage { if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) { my $parts = $curRes->parts(); - if (scalar(@{$parts}) > 1) { shift @{$parts}; } + $parts = &temp_parts_fix($parts); # remove line when lonnavmap is fixed my $title = $curRes->compTitle(); my $symbx = $curRes->symb(); $studentTable.=''.$question. @@ -2722,10 +2600,13 @@ sub displayPage { 'Part: '.$partid.' '. $record{"$version:resource.$partid.award"}.'/'. $record{"$version:resource.$partid.solved"}.'
' : ''; + $displaySub[2].=(exists $record{"$version:resource.$partid.regrader"}) ? + $record{"$version:resource.$partid.regrader"}.' (Part: '.$partid.')' : ''; } - $displaySub[1].=(exists $record{"$version:resource.regrader"}) ? - 'Manually graded by '.$record{"$version:resource.regrader"} : ''; - $studentTable.=''.$displaySub[0].' '.$displaySub[1].' '; + $displaySub[2].=(exists $record{"$version:resource.regrader"}) ? + $record{"$version:resource.regrader"} : ''; + $studentTable.=''.$displaySub[0].' '.$displaySub[1]. + ($displaySub[2] eq '' ? '' : 'Manually graded by '.$displaySub[2]).' '; } $studentTable.=''; } @@ -2748,7 +2629,6 @@ sub displayPage { $curRes = $iterator->next(); $ctr++; } - $navmap->init(); $studentTable.=''."\n". '   0); + $seen{$_}++; + push @correctParts,$_; + } + return \@correctParts; +} + sub updateGradeByPage { my ($request) = shift; @@ -2801,7 +2693,7 @@ sub updateGradeByPage { if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) { my $parts = $curRes->parts(); - if (scalar(@{$parts}) > 1) { shift @{$parts}; } + $parts = &temp_parts_fix($parts); # remove line when lonnavmap is fixed my $title = $curRes->compTitle(); my $symbx = $curRes->symb(); $studentTable.=''.$question. @@ -2844,11 +2736,11 @@ sub updateGradeByPage { } $newrecord{'resource.'.$partid.'.awarded'} = $partial if $partial ne ''; $newrecord{'resource.'.$partid.'.solved'} = $score; + $newrecord{'resource.'.$partid.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; $changeflag++; } if (scalar(keys(%newrecord)) > 0) { - $newrecord{'resource.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; &Apache::lonnet::cstore(\%newrecord,$symbx,$ENV{'request.course.id'}, $udom,$uname); } @@ -2860,7 +2752,6 @@ sub updateGradeByPage { $curRes = $iterator->next(); $ctr++; } - $navmap->init(); $studentTable.=''; $studentTable.=($changeflag == 0 ? 'No score was changed or updated.' : @@ -2872,41 +2763,181 @@ sub updateGradeByPage { return ''; } +#-------- end of section for handling grading by page/sequence --------- +# +#------------------------------------------------------------------- -#--- Form to input a receipt number --- -sub verifyReceipt_form { - my ($symb,$url) = @_; - my $result = ''."\n"; +#-------------------------- Menu interface ------------------------- +# +#--- Show a Grading Menu button - Calls the next routine --- +sub show_grading_menu_form { + my ($symb,$url)=@_; + my $result.=''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + '
'."\n"; + return $result; +} - my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}); +#--- Displays the main menu page ------- +sub gradingmenu { + my ($request) = @_; + my ($symb,$url)=&get_symb_and_url($request); + if (!$symb) {return '';} - $result.='
'."\n"; - $result.=''."\n"; - $result.='
'."\n"; - $result.=' Verify a Submission Receipt Issued by this Server
'."\n"; - $result.='
'."\n"; - $result.=' '.$hostver.'-
'."\n"; - $result.=' '."\n"; - $result.=''."\n"; - if ($ENV{'form.url'}) { - $result.=''; + $request->print(< + function checkChoice(formname) { + 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) { + formname.submit(); + } + + if (cmd[3].checked) { + var url = "/adm/grades?command=csvform&symb="+formname.symb.value+"&url="+formname.url.value; + var options = "width=620,height=340,screenx=70,screeny=75,"; + options += "resizable=no,scrollbars=no,status=no,"; + options += "menubar=no,toolbar=no,location=no,directories=no"; + var newWin = window.open(url, "CSVFile", options); + newWin.focus(); + } + + if (cmd[4].checked) { + if (!checkReceiptNo(formname,'notOK')) { return false;} + formname.submit(); + } } - if ($ENV{'form.symb'}) { - $result.=''; + + function checkReceiptNo(formname,nospace) { + var receiptNo = formname.receipt.value; + var checkOpt = false; + if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;} + if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;} + if (checkOpt) { + alert("Please enter a receipt number given by a student in the receipt box."); + formname.receipt.value = ""; + formname.receipt.focus(); + return false; + } + formname.command[4].checked = true; + return true; } - $result.=''; - $result.='
'."\n"; - $result.='
'."\n"; + + function radioSelection(radioButton) { + var selection=null; + for (var i=0; i +GRADINGMENUJS + + my $probTitle = &Apache::lonnet::metadata($ENV{'form.url'},'title'); + my $result='

 Manual Grading/View Submission

'. + ''. + ''; + my ($partlist,$handgrade) = &response_type($url); + my ($resptype,$hdgrade)=('','no'); + for (sort keys(%$handgrade)) { + my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_}); + $resptype = $responsetype; + $hdgrade = $handgrade if ($handgrade eq 'yes'); + $result.=''. + ''. + ''; + } + $result.='
Problem: '.$probTitle.'
Part '.(split(/_/))[0].'Type: '.$responsetype.'Handgrade: '.$handgrade.'
'; + + my ($classlist,$sections) = &getclasslist('all','0'); + my $lastCmd = ($ENV{'form.lastCmd'} eq '' ? 'pickStudentPage' : $ENV{'form.lastCmd'}); + my $lastSec = ($ENV{'form.lastSec'} eq '' ? 'all' : $ENV{'form.lastSec'}); + + $result.='
'."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n"; + + $result.='
'."\n". + ''."\n". + '
'."\n". + ' Select a Grading/Viewing Option
'."\n"; + + $result.=''. + ''."\n". + + ''."\n". + + ''."\n". + ''."\n". + + ''."\n"; + + if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) { + $result.=''. + ''."\n"; + } + + $result.=''; + + $result.='
'. + ' '. + 'Handgrade/View Submission for a student by page/sequence
'. + ' '. + 'Grade by section or class
'. + ($hdgrade eq 'yes' ? 'View/Grade essay response of' : 'View'). + ' an individual student --> For students who has: '. + ' submitted'. + ' everybody
'. + ' '. + 'Upload scores from file
'. + ' '. + 'Verify a submission receipt issued by this server--> Receipt no: '.unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}). + '-'. + '

'."\n". + ' Select section:   '. + '(Applies to the first three options only.)'."\n"; + if (ref($sections)) { + $result.=' (Section "no" implies the students were not assigned a section.)
' + if (grep /no/,@$sections); + } + $result.='

'. + ''."\n". + '
'."\n". + '
'."\n". + '
'."\n"; return $result; } @@ -2961,9 +2992,6 @@ sub handler { $Apache::grades::viewgrades=&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'}); if ($command eq 'submission') { ($ENV{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0)); -# if ($command eq 'submission') { -# &listStudents($request) if ($ENV{'form.student'} eq ''); -# &submission($request,0,0) if ($ENV{'form.student'} ne ''); } elsif ($command eq 'pickStudentPage') { &pickStudentPage($request); } elsif ($command eq 'displayPage') { @@ -2982,6 +3010,8 @@ sub handler { $request->print(&editgrades($request)); } elsif ($command eq 'verify') { $request->print(&verifyreceipt($request)); + } elsif ($command eq 'csvform') { + $request->print(&upcsvScores_form($request)); } elsif ($command eq 'csvupload') { $request->print(&csvupload($request)); } elsif ($command eq 'viewclasslist') {