--- loncom/homework/grades.pm 2003/03/23 08:10:30 1.75 +++ 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.75 2003/03/23 08:10:30 albertel Exp $ +# $Id: grades.pm,v 1.81 2003/03/28 23:44:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -113,7 +113,7 @@ sub response_type { #--- Dumps the class list with usernames,list of sections, #--- section, ids and fullnames for each user. sub getclasslist { - my ($getsec,$hideexpired) = @_; + my ($getsec,$filterlist) = @_; my $classlist=&Apache::loncoursedata::get_classlist(); # Bail out if we were unable to get the classlist return if (! defined($classlist)); @@ -124,11 +124,13 @@ sub getclasslist { # the following undefs are for 'domain', and 'username' respectively. my (undef,undef,$end,$start,$id,$section,$fullname,$status)= @{$classlist->{$_}}; - # still a student? - if (($hideexpired) && ($status ne 'Active')) { - delete ($classlist->{$_}); - next; - } + # filter students according to status selected + if ($filterlist && $ENV{'form.status'} ne 'Any') { + if ($ENV{'form.status'} ne $status) { + delete ($classlist->{$_}); + next; + } + } $section = ($section ne '' ? $section : 'no'); if ($getsec eq 'all' || $getsec eq $section) { $sections{$section}++; @@ -209,8 +211,7 @@ sub jscriptNform { $jscript.= '
'."\n". ''."\n". ''."\n". - ''."\n". - ''."\n". + ''."\n". ''."\n". ''."\n". ''."\n". @@ -297,9 +298,11 @@ sub listStudents { 'Type: '.$responsetype.''. 'Handgrade: '.$handgrade.''; } - $result.=''; + $result.=''."\n"; my $viewgrade = $ENV{'form.handgrade'} eq 'yes' ? 'View/Grade' : 'View'; + $ENV{'form.probTitle'} = $ENV{'form.probTitle'} eq '' ? + &Apache::lonnet::gettitle($symb) : $ENV{'form.probTitle'}; $result='

 '. $viewgrade. @@ -340,8 +343,8 @@ LISTJAVASCRIPT my $checklastsub = $ENV{'form.handgrade'} eq 'yes' ? '' : 'checked'; my $gradeTable=''."\n". - ' View Problem: no '."\n". - ' one student '."\n". + ' View Problem: no '."\n". + ' one student '."\n". ' all students
'."\n". ' Submissions: '."\n"; if ($ENV{'form.handgrade'} eq 'yes') { @@ -355,8 +358,7 @@ LISTJAVASCRIPT ''."\n". '
'."\n". '
'."\n". - ''."\n". - ''."\n". + ''."\n". ''."\n". ''."\n". ''."\n". @@ -368,7 +370,7 @@ LISTJAVASCRIPT 'onClick="javascript:checkSelect(this.form.stuinfo);" '."\n". 'value="'.$viewgrade.'" />'."\n"; - my (undef,undef,$fullname) = &getclasslist($getsec,'0'); + my (undef,undef,$fullname) = &getclasslist($getsec,$ENV{'form.showgrading'} eq 'yes' ? '1' : '0'); $gradeTable.='
'. ''. @@ -626,13 +628,13 @@ SUBJAVASCRIPT #--- javascript for essay type problem -- sub sub_page_kw_js { my $request = shift; + my $iconpath = $request->dir_config('lonIconsURL'); $request->print(< //===================== Show list of keywords ==================== function keywords(keyform) { - var keywds = keyform.value; - var nret = prompt("Keywords list, separated by a space. Add/delete to list if desired.",keywds); + var nret = prompt("Keywords list, separated by a space. Add/delete to list if desired.",keyform.value); if (nret==null) return; keyform.value = nret; @@ -674,6 +676,12 @@ sub sub_page_kw_js { } //====================== Script for composing message ============== + // preload images + img1 = new Image(); + img1.src = "$iconpath/mailbkgrd.gif"; + img2 = new Image(); + img2.src = "$iconpath/mailto.gif"; + function msgCenter(msgform,usrctr,fullname) { var Nmsg = msgform.savemsgN.value; savedMsgHeader(Nmsg,usrctr,fullname); @@ -701,91 +709,106 @@ sub sub_page_kw_js { return; } +// var pWin = null; function savedMsgHeader(Nmsg,usrctr,fullname) { - var height = 50*Nmsg+250; + var height = 70*Nmsg+250; var scrollbar = "no"; if (height > 600) { height = 600; scrollbar = "yes"; } -/* if (window.pWin) - window.pWin.close(); */ +// if (window.pWin) window.pWin.close(); pWin = window.open('', 'MessageCenter', 'toolbar=no,location=no,scrollbars='+scrollbar+',screenx=70,screeny=75,width=600,height='+height); - pWin.document.write(""); - pWin.document.write("Message Central"); - - pWin.document.write(" @@ -985,6 +1013,9 @@ sub submission { if ($counter == 0) { &sub_page_js($request); &sub_page_kw_js($request); + $ENV{'form.probTitle'} = $ENV{'form.probTitle'} eq '' ? + &Apache::lonnet::gettitle($symb) : $ENV{'form.probTitle'}; + $request->print('

 Submission Record

'."\n". ' Problem: '.$ENV{'form.probTitle'}.''."\n"); @@ -1015,8 +1046,7 @@ sub submission { $request->print(''."\n". ''."\n". - ''."\n". - ''."\n". + ''."\n". ''."\n". ''."\n". ''."\n". @@ -1040,7 +1070,9 @@ sub submission { my ($cts,$prnmsg) = (1,''); while ($cts <= $ENV{'form.savemsgN'}) { $prnmsg.=''."\n"; $cts++; } @@ -1089,20 +1121,26 @@ KEYWORDS next if ($ncol <= 0); s/\_/\./g; next if ($record{'resource.'.$_.'.collaborators'} eq ''); - my (@collaborators) = split(/,?\s+/, + my (@colList) = split(/,?\s+/, $record{'resource.'.$_.'.collaborators'}); + my @collaborators = (); + foreach (@colList) { #pre-filter list - throw out submitter + my ($co_name,$co_dom) = split /\@|:/,$_; + $co_dom = $udom if (! defined($co_dom)); + next if ($co_name eq $uname && $co_dom eq $udom); + push @collaborators, $_; + } my (@badcollaborators); if (scalar(@collaborators) != 0) { $result.='Collaborators: '; foreach my $collaborator (@collaborators) { my ($co_name,$co_dom) = split /\@|:/,$collaborator; $co_dom = $udom if (! defined($co_dom)); - next if ($co_name eq $uname && $co_dom eq $udom); # Doing this grep allows 'fuzzy' specification - my @Matches = grep /^$co_name:$co_dom/i, + my @Matches = grep /^$co_name:$co_dom$/i, keys %$classlist; - if (! scalar(@Matches)) { - push @badcollaborators,$collaborator; + if (! scalar(@Matches)) { + push @badcollaborators,':'.$collaborator.':'; next; } push @col_list, @Matches; @@ -1122,11 +1160,11 @@ KEYWORDS $result .= 'invalid collaborators'; } $result .= ': '.join(', ',@badcollaborators); - + $result .= '
'; } if (scalar(@collaborators > $ncol)) { $result .= '
'; - $result .= 'This student has sumbitted too many '. + $result .= 'This student has submitted too many '. 'collaborators. Maximum is '.$ncol; $result .= '
'; } @@ -1215,7 +1253,9 @@ KEYWORDS $result.='
'."\n". ' '. - 'Compose Message to student'.(scalar(@col_fullnames) >= 1 ? 's' : '').''. + 'Compose Message to student'.(scalar(@col_fullnames) >= 1 ? 's' : '').'  '. + ''."\n". '
 (Message will be sent when you click on Save & Next below.)'."\n" if ($ENV{'form.handgrade'} eq 'yes'); $request->print($result); @@ -1329,12 +1369,11 @@ sub processHandGrade { my $ctr = 0; while ($ctr < $ngrade) { my ($uname,$udom) = split(/:/,$ENV{'form.unamedom'.$ctr}); - my ($errorflag) = &saveHandGrade($request,$url,$symb,$uname,$udom,$ctr); + my ($errorflag,$pts,$wgt) = &saveHandGrade($request,$url,$symb,$uname,$udom,$ctr); if ($errorflag eq 'no_score') { $ctr++; next; } - my $includemsg = $ENV{'form.includemsg'.$ctr}; my ($subject,$message,$msgstatus) = ('','',''); if ($includemsg =~ /savemsg|newmsg\Q$ctr\E/) { @@ -1343,7 +1382,11 @@ sub processHandGrade { foreach (@msgnum) { $message.=$ENV{'form.'.$_} if ($_ =~ /savemsg|newmsg/ && $_ ne ''); } - #$message =~ s/\s+/ /g; + $message =&Apache::lonfeedback::clear_out_html($message); + $message.="\n\nPoint".($pts > 1 ? 's':'').' awarded = '.$pts.' out of '.$wgt; + $message.=" for $ENV{'form.probTitle'}"; $msgstatus = &Apache::lonmsg::user_normal_msg ($uname,$udom, $ENV{'form.msgsub'},$message); } @@ -1481,8 +1524,9 @@ sub processHandGrade { #---- Save the score and award for each student, if changed sub saveHandGrade { my ($request,$url,$symb,$stuname,$domain,$newflg,$submitter) = @_; - my %record=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},$domain,$stuname); - my %newrecord; + my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$domain,$stuname); + my %newrecord = (); + my ($pts,$wgt) = ('',''); foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { if ($ENV{'form.GD_SEL'.$newflg.'_'.$_} eq 'excused') { if ($record{'resource.'.$_.'.solved'} ne 'excused') { @@ -1492,11 +1536,11 @@ sub saveHandGrade { } } } else { - my $pts = ($ENV{'form.GD_BOX'.$newflg.'_'.$_} ne '' ? - $ENV{'form.GD_BOX'.$newflg.'_'.$_} : - $ENV{'form.RADVAL'.$newflg.'_'.$_}); + $pts = ($ENV{'form.GD_BOX'.$newflg.'_'.$_} ne '' ? + $ENV{'form.GD_BOX'.$newflg.'_'.$_} : + $ENV{'form.RADVAL'.$newflg.'_'.$_}); return 'no_score' if ($pts eq '' && $ENV{'form.GD_SEL'.$newflg.'_'.$_} eq ''); - my $wgt = $ENV{'form.WGT'.$newflg.'_'.$_} eq '' ? 1 : + $wgt = $ENV{'form.WGT'.$newflg.'_'.$_} eq '' ? 1 : $ENV{'form.WGT'.$newflg.'_'.$_}; my $partial= $pts/$wgt; $newrecord{'resource.'.$_.'.awarded'} = $partial @@ -1519,7 +1563,7 @@ sub saveHandGrade { &Apache::lonnet::cstore(\%newrecord,$symb, $ENV{'request.course.id'},$domain,$stuname); } - return ''; + return '',$pts,$wgt; } #-------------------------------------------------------------------------------------- @@ -1715,8 +1759,7 @@ sub viewgrades { ''."\n". ''."\n". ''."\n". - ''."\n". - ''."\n". + ''."\n". ''."\n"; $result.='

Assign Common Grade To '; @@ -1807,7 +1850,7 @@ sub viewgrades { #get info for each student #list all the students - with points and grade status - my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'0'); + my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1'); my $ctr = 0; foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { my ($uname,$udom) = split(/:/); @@ -2018,48 +2061,6 @@ 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::gettitle($symb); - $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(< - - +
@@ -2323,8 +2323,7 @@ sub pickStudentPage { @@ -2363,7 +2370,7 @@ LISTJAVASCRIPT my $result='

 '. 'Manual Grading by Page or Sequence

'; - $result.='
'."
\n"; + $result.=''."\n"; $result.=' Problems from: '."\n". ''."\n". ''."\n". - ''."

\n". - ''."\n". - ''."\n"; + ''."\n". + ''."
\n"; - $result.='
 
'."\n"; $request->print($result); - my $studentTable.=' Select a Student you wish to grade
'. + my $studentTable.=' Select a student you wish to grade
'. '
'. ''. ''. @@ -2414,7 +2420,7 @@ LISTJAVASCRIPT ''. ''; - my (undef,undef,$fullname) = &getclasslist($getsec,'0'); + my (undef,undef,$fullname) = &getclasslist($getsec,'1'); my $ptr = 1; foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { my ($uname,$udom) = split(/:/,$student); @@ -2439,8 +2445,7 @@ LISTJAVASCRIPT sub getSymbMap { my ($request) = @_; - my $navmap = Apache::lonnavmaps::navmap-> new($request, - $ENV{'request.course.fn'}.'.db', + my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db', $ENV{'request.course.fn'}.'_parms.db',1, 1); my $res = $navmap->firstResource(); # temp resource to access constants @@ -2505,7 +2510,7 @@ sub displayPage { my $cnum = $ENV{"course.$ENV{'request.course.id'}.num"}; my $getsec = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'}; my $pageTitle = $ENV{'form.page'}; - my (undef,undef,$fullname) = &getclasslist($getsec,'0'); + my (undef,undef,$fullname) = &getclasslist($getsec,'1'); my ($uname,$udom) = split(/:/,$ENV{'form.student'}); my $result='

 '.$ENV{'form.title'}.'

'; @@ -2515,8 +2520,7 @@ sub displayPage { &sub_page_js($request); $request->print($result); - my $navmap = Apache::lonnavmaps::navmap-> new($request, - $ENV{'request.course.fn'}.'.db', + my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db', $ENV{'request.course.fn'}.'_parms.db',1, 1); my ($mapUrl, $id, $resUrl) = split(/___/, $ENV{'form.page'}); my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps @@ -2531,8 +2535,7 @@ sub displayPage { ''."\n". ''."\n". ''."\n". - ''."\n". - ''."\n"; + ''."\n"; my $checkIcon = ''; @@ -2564,8 +2567,8 @@ sub displayPage { } else { my $companswer = &Apache::loncommon::get_student_answers( $symbx,$uname,$udom,$ENV{'request.course.id'}); - $companswer=~s|||g; - $companswer=~s|||g; + $companswer =~ s|||g; + $companswer =~ s|||g; # while ($companswer =~ /()/s) { #Part: '.$partid.' Submission: ' - .$record{$version.':'.$matchKey[0]}.'
' : ''; + 'Part '.$partid.' '. + ($record{"$version:resource.$partid.tries"} eq '' ? 'Trial not counted' : + 'Trial '.$record{"$version:resource.$partid.tries"}).'  '. + $record{$version.':'.$matchKey[0]}.'
' : ''; $displaySub[1].=(exists $record{"$version:resource.$partid.award"}) ? - 'Part: '.$partid.' '. + 'Part '.$partid.'  '. $record{"$version:resource.$partid.award"}.'/'. $record{"$version:resource.$partid.solved"}.'
' : ''; $displaySub[2].=(exists $record{"$version:resource.$partid.regrader"}) ? @@ -2660,7 +2668,7 @@ sub updateGradeByPage { my $cnum = $ENV{"course.$ENV{'request.course.id'}.num"}; my $getsec = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'}; my $pageTitle = $ENV{'form.page'}; - my (undef,undef,$fullname) = &getclasslist($getsec,'0'); + my (undef,undef,$fullname) = &getclasslist($getsec,'1'); my ($uname,$udom) = split(/:/,$ENV{'form.student'}); my $result='

 '.$ENV{'form.title'}.'

'; @@ -2669,8 +2677,7 @@ sub updateGradeByPage { $request->print($result); - my $navmap = Apache::lonnavmaps::navmap-> new($request, - $ENV{'request.course.fn'}.'.db', + my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db', $ENV{'request.course.fn'}.'_parms.db',1, 1); my ($mapUrl, $id, $resUrl) = split(/___/, $ENV{'form.page'}); my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps @@ -2755,11 +2762,11 @@ sub updateGradeByPage { } $studentTable.='
 Fullname (username) Fullname (username) Fullname (username)
'; - $studentTable.=($changeflag == 0 ? 'No score was changed or updated.' : - 'The scores were changed for '. - $changeflag.' problem'.($changeflag == 1 ? '.' : 's.')); $studentTable.=&show_grading_menu_form($ENV{'form.symb'},$ENV{'form.url'}); - $request->print($studentTable); + my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' : + 'The scores were changed for '. + $changeflag.' problem'.($changeflag == 1 ? '.' : 's.')); + $request->print($grademsg.$studentTable); return ''; } @@ -2772,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
@@ -2816,12 +2848,7 @@ sub scantron_selectphase {
- - Filename of scoring office file: - + Filename of scoring office file: $file_selector
@@ -2830,6 +2857,7 @@ sub scantron_selectphase {

+$grading_menu_button SCANTRONFORM return $result; @@ -2837,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; } @@ -2880,38 +2940,41 @@ sub show_grading_menu_form { my $result.='
'."\n". ''."\n". ''."\n". - ''."\n". - ''."\n". + ''."\n". ''."\n". ''."\n". '
'."\n"; return $result; } +# -- Retrieve choices for grading form +sub savedState { + my %savedState = (); + if ($ENV{'form.saveState'}) { + foreach (split(/:/,$ENV{'form.saveState'})) { + my ($key,$value) = split(/=/,$_,2); + $savedState{$key} = $value; + } + } + return \%savedState; +} + #--- Displays the main menu page ------- sub gradingmenu { my ($request) = @_; my ($symb,$url)=&get_symb_and_url($request); if (!$symb) {return '';} + my $probTitle = &Apache::lonnet::gettitle($symb); $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 || cmd[4].checked) { - formname.submit(); - } + formname.saveState.value = "saveCmd="+radioSelection(cmd)+":saveSec="+pullDownSelection(formname.section)+ + ":saveSub="+radioSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.status); + if (cmd[0].checked || cmd[1].checked || cmd[2].checked || cmd[4].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[3].checked) browseAndUpload(); if (cmd[5].checked) { if (!checkReceiptNo(formname,'notOK')) { return false;} @@ -2930,35 +2993,94 @@ sub gradingmenu { formname.receipt.focus(); return false; } - formname.command[4].checked = true; + formname.command[5].checked = true; return true; } function radioSelection(radioButton) { var selection=null; - for (var i=0; i 1) { + for (var i=0; i 1) { + for (var i=0; i"); + lDoc.write("Browse And Upload"); + + lDoc.write(" GRADINGMENUJS - my $probTitle = &Apache::lonnet::gettitle($ENV{'form.url'}); my $result='

 Manual Grading/View Submission

'. ''. - ''; + ''."\n"; my ($partlist,$handgrade) = &response_type($url); my ($resptype,$hdgrade)=('','no'); for (sort keys(%$handgrade)) { @@ -2969,11 +3091,14 @@ GRADINGMENUJS ''. ''; } - $result.='
Problem: '.$probTitle.'
Problem: '.$probTitle.'
Type: '.$responsetype.'Handgrade: '.$handgrade.'
'; + $result.=''."\n"; - 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'}); + my (undef,$sections) = &getclasslist('all','0'); + my $savedState = &savedState(); + my $saveCmd = ($$savedState{'saveCmd'} eq '' ? 'pickStudentPage' : $$savedState{'saveCmd'}); + my $saveSec = ($$savedState{'saveSec'} eq '' ? 'all' : $$savedState{'saveSec'}); + my $saveSub = ($$savedState{'saveSub'} eq '' ? 'yes' : $$savedState{'saveSub'}); + my $saveStatus = ($$savedState{'saveStatus'} eq '' ? 'Active' : $$savedState{'saveStatus'}); $result.='
'."\n". ''."\n". @@ -2981,8 +3106,7 @@ GRADINGMENUJS ''."\n". ''."\n". ''."\n". - ''."\n". - ''."\n". + ''."\n". ''."\n"; $result.='
'."\n". @@ -2993,35 +3117,38 @@ GRADINGMENUJS $result.=''. ''."\n". ''."\n". ''."\n". ''."\n". + ' submitted'. + ' everybody'."\n". ''."\n"; $result.=''."\n"; if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) { $result.=''. '
'. ' '. + ($saveCmd eq 'pickStudentPage' ? 'checked' : '').'> '. 'Handgrade/View Submission for a student by page/sequence
'. ' '. + ($saveCmd eq 'viewgrades' ? 'checked' : '').'> '. 'Grade by section or class
'. + ($saveCmd eq 'submission' ? 'checked' : '').'> '. ($hdgrade eq 'yes' ? 'View/Grade essay response of' : 'View'). ' an individual student --> For students who has: '. - ' submitted'. - ' everybody
'. ' '. + ($saveCmd eq 'csvupload' ? 'checked' : '').'> '. 'Upload scores from file
'. - ' '. + ' '. 'Grade scantron forms
'. - ' '. + ' '. 'Verify a submission receipt issued by this server--> Receipt no: '.unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}). '-'. @@ -3029,13 +3156,21 @@ GRADINGMENUJS } $result.='

'."\n". - ' Select section: '."\n"; if (ref($sections)) { foreach (sort (@$sections)) {$result.=''."\n";} + ($saveSec eq $_ ? 'selected="on"' : '').'>'.$_.''."\n";} } - $result.= '