--- loncom/homework/grades.pm 2010/03/19 21:22:34 1.599 +++ loncom/homework/grades.pm 2010/03/19 22:00:06 1.600 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.599 2010/03/19 21:22:34 www Exp $ +# $Id: grades.pm,v 1.600 2010/03/19 22:00:06 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -8582,7 +8582,7 @@ sub grading_menu { icon => 'edit-find-replace.png', linktitle => 'Grade current resource for all students.' }, - { linktext => 'Grade complete page/sequence/folder for one student.', + { linktext => 'Grade complete page/sequence/folder for one student', url => $url1d, permission => 'F', icon => 'edit-find-replace.png', @@ -8675,69 +8675,90 @@ GRADINGMENUJS return $Str; } -sub individual { - my ($request)=@_; - &submit_options($request); -} sub ungraded { my ($request)=@_; &submit_options($request); } -sub table { - my ($request)=@_; - &submit_options($request); -} - -sub all_for_one { - my ($request)=@_; - &submit_options($request); -} - sub submit_options_sequence { my ($request) = @_; my ($symb)=&get_symb($request); if (!$symb) {return '';} - my $probTitle = &Apache::lonnet::gettitle($symb); + &commonJSfunctions($request); + my $result; + my (undef,$sections) = &getclasslist('all','0'); + my $savedState = &savedState(); + my $saveCmd = ($$savedState{'saveCmd'} eq '' ? 'submission' : $$savedState{'saveCmd'}); + my $saveSec = ($$savedState{'saveSec'} eq '' ? 'all' : $$savedState{'saveSec'}); + my $saveSub = ($$savedState{'saveSub'} eq '' ? 'all' : $$savedState{'saveSub'}); + my $saveStatus = ($$savedState{'saveStatus'} eq '' ? 'Active' : $$savedState{'saveStatus'}); - my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box."); - $request->print(&Apache::lonhtmlcommon::scripttag(<'.$section.''."\n"; } - if (val < 7) formname.submit(); } - 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("$receiptalert"); - formname.receipt.value = ""; - formname.receipt.focus(); - return false; - } - return true; - } -GRADINGMENUJS + $result.='
'."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n"; + + $result.=' +

+ '.&mt('Grade complete page/sequence/folder for one student').' +

+ +
+ +
+ + '.&mt('Sections').' + +   '; + $result.=' +
+ +
+ + '.&mt('Groups').' + + '.&Apache::lonstatistics::GroupSelect('group','multiple',5).' +
+ +
+ + '.&mt('Access Status').' + + '.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,5,undef,'mult').' +
+ +
+ +
+ + +
+ +
+ +
'; + $result .= &show_grading_menu_form($symb); + return $result; +} + +sub submit_options_table { + my ($request) = @_; + my ($symb)=&get_symb($request); + if (!$symb) {return '';} &commonJSfunctions($request); -# my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle); my $result; my (undef,$sections) = &getclasslist('all','0'); my $savedState = &savedState(); @@ -8757,14 +8778,13 @@ GRADINGMENUJS $result.='
'."\n". ''."\n". - ''."\n". ''."\n". ''."\n". ''."\n"; $result.='

- '.&mt('Grade Complete Folder for One Student').' + '.&mt('Grading table').'

@@ -8797,7 +8817,7 @@ GRADINGMENUJS
- +
@@ -8807,6 +8827,8 @@ GRADINGMENUJS return $result; } + + #--- Displays the submissions first page ------- sub submit_options { my ($request) = @_; @@ -8814,43 +8836,7 @@ sub submit_options { if (!$symb) {return '';} my $probTitle = &Apache::lonnet::gettitle($symb); - my $receiptalert = &mt("Please enter a receipt number given by a student in the receipt box."); - $request->print(&Apache::lonhtmlcommon::scripttag(<'."\n". -# ''."\n". ''."\n". - ''."\n". ''."\n". ''."\n". ''."\n"; $result.='

- '.&mt('Grade Current Resource').' + '.&mt('Select individual students to grade').'

@@ -8924,23 +8908,8 @@ GRADINGMENUJS

-
-
- -
-
- -
-
- + +
@@ -9561,11 +9530,11 @@ sub handler { } elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { $request->print(&grading_menu($request)); } elsif ($command eq 'individual' && $perm{'vgr'}) { - $request->print(&individual($request)); + $request->print(&submit_options($request)); } elsif ($command eq 'ungraded' && $perm{'vgr'}) { $request->print(&submit_options($request)); } elsif ($command eq 'table' && $perm{'vgr'}) { - $request->print(&submit_options($request)); + $request->print(&submit_options_table($request)); } elsif ($command eq 'all_for_one' && $perm{'vgr'}) { $request->print(&submit_options_sequence($request)); } elsif ($command eq 'viewgrades' && $perm{'vgr'}) {