version 1.599, 2010/03/19 21:22:34
|
version 1.600, 2010/03/19 22:00:06
|
Line 8582 sub grading_menu {
|
Line 8582 sub grading_menu {
|
icon => 'edit-find-replace.png', |
icon => 'edit-find-replace.png', |
linktitle => 'Grade current resource for all students.' |
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, |
url => $url1d, |
permission => 'F', |
permission => 'F', |
icon => 'edit-find-replace.png', |
icon => 'edit-find-replace.png', |
Line 8675 GRADINGMENUJS
|
Line 8675 GRADINGMENUJS
|
return $Str; |
return $Str; |
} |
} |
|
|
sub individual { |
|
my ($request)=@_; |
|
&submit_options($request); |
|
} |
|
|
|
sub ungraded { |
sub ungraded { |
my ($request)=@_; |
my ($request)=@_; |
&submit_options($request); |
&submit_options($request); |
} |
} |
|
|
sub table { |
|
my ($request)=@_; |
|
&submit_options($request); |
|
} |
|
|
|
sub all_for_one { |
|
my ($request)=@_; |
|
&submit_options($request); |
|
} |
|
|
|
sub submit_options_sequence { |
sub submit_options_sequence { |
my ($request) = @_; |
my ($request) = @_; |
my ($symb)=&get_symb($request); |
my ($symb)=&get_symb($request); |
if (!$symb) {return '';} |
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."); |
# Preselect sections |
$request->print(&Apache::lonhtmlcommon::scripttag(<<GRADINGMENUJS)); |
my $selsec=""; |
function checkChoice(formname,val,cmdx) { |
if (ref($sections)) { |
if (val <= 2) { |
foreach my $section (sort(@$sections)) { |
var cmd = radioSelection(formname.radioChoice); |
$selsec.='<option value="'.$section.'" '. |
var cmdsave = cmd; |
($saveSec eq $section ? 'selected="selected"':'').'>'.$section.'</option>'."\n"; |
} else { |
|
cmd = cmdx; |
|
cmdsave = 'submission'; |
|
} |
|
formname.command.value = cmd; |
|
formname.saveState.value = "saveCmd="+cmdsave+":saveSec="+pullDownSelection(formname.section)+ |
|
":saveSub="+pullDownSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.Status); |
|
if (val < 5) formname.submit(); |
|
if (val == 5) { |
|
if (!checkReceiptNo(formname,'notOK')) { return false;} |
|
formname.submit(); |
|
} |
} |
if (val < 7) formname.submit(); |
|
} |
} |
|
|
function checkReceiptNo(formname,nospace) { |
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
var receiptNo = formname.receipt.value; |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
var checkOpt = false; |
'<input type="hidden" name="saveState" value="" />'."\n". |
if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;} |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;} |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
if (checkOpt) { |
|
alert("$receiptalert"); |
$result.=' |
formname.receipt.value = ""; |
<h2> |
formname.receipt.focus(); |
'.&mt('Grade complete page/sequence/folder for one student').' |
return false; |
</h2> |
} |
|
return true; |
<div class="LC_columnSection"> |
} |
|
GRADINGMENUJS |
<fieldset> |
|
<legend> |
|
'.&mt('Sections').' |
|
</legend> |
|
<select name="section" multiple="multiple" size="5">'."\n"; |
|
$result.= $selsec; |
|
$result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> '; |
|
$result.=' |
|
</fieldset> |
|
|
|
<fieldset> |
|
<legend> |
|
'.&mt('Groups').' |
|
</legend> |
|
'.&Apache::lonstatistics::GroupSelect('group','multiple',5).' |
|
</fieldset> |
|
|
|
<fieldset> |
|
<legend> |
|
'.&mt('Access Status').' |
|
</legend> |
|
'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,5,undef,'mult').' |
|
</fieldset> |
|
|
|
</div> |
|
|
|
<br /> |
|
|
|
<input type="hidden" name="command" value="pickStudentPage" /> |
|
<div> |
|
<input type="submit" value="'.&mt('Next').' →" /> |
|
</div> |
|
</div> |
|
</form>'; |
|
$result .= &show_grading_menu_form($symb); |
|
return $result; |
|
} |
|
|
|
sub submit_options_table { |
|
my ($request) = @_; |
|
my ($symb)=&get_symb($request); |
|
if (!$symb) {return '';} |
&commonJSfunctions($request); |
&commonJSfunctions($request); |
# my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle); |
|
my $result; |
my $result; |
my (undef,$sections) = &getclasslist('all','0'); |
my (undef,$sections) = &getclasslist('all','0'); |
my $savedState = &savedState(); |
my $savedState = &savedState(); |
Line 8757 GRADINGMENUJS
|
Line 8778 GRADINGMENUJS
|
|
|
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
|
'<input type="hidden" name="saveState" value="" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\n". |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
$result.=' |
$result.=' |
<h2> |
<h2> |
'.&mt('Grade Complete Folder for One Student').' |
'.&mt('Grading table').' |
</h2> |
</h2> |
|
|
<div class="LC_columnSection"> |
<div class="LC_columnSection"> |
Line 8797 GRADINGMENUJS
|
Line 8817 GRADINGMENUJS
|
|
|
<br /> |
<br /> |
|
|
<input type="hidden" name="command" value="pickStudentPage" /> |
<input type="hidden" name="command" value="viewgrades" /> |
<div> |
<div> |
<input type="submit" value="'.&mt('Next').' →" /> |
<input type="submit" value="'.&mt('Next').' →" /> |
</div> |
</div> |
Line 8807 GRADINGMENUJS
|
Line 8827 GRADINGMENUJS
|
return $result; |
return $result; |
} |
} |
|
|
|
|
|
|
#--- Displays the submissions first page ------- |
#--- Displays the submissions first page ------- |
sub submit_options { |
sub submit_options { |
my ($request) = @_; |
my ($request) = @_; |
Line 8814 sub submit_options {
|
Line 8836 sub submit_options {
|
if (!$symb) {return '';} |
if (!$symb) {return '';} |
my $probTitle = &Apache::lonnet::gettitle($symb); |
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(<<GRADINGMENUJS)); |
|
function checkChoice(formname,val,cmdx) { |
|
if (val <= 2) { |
|
var cmd = radioSelection(formname.radioChoice); |
|
var cmdsave = cmd; |
|
} else { |
|
cmd = cmdx; |
|
cmdsave = 'submission'; |
|
} |
|
formname.command.value = cmd; |
|
formname.saveState.value = "saveCmd="+cmdsave+":saveSec="+pullDownSelection(formname.section)+ |
|
":saveSub="+pullDownSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.Status); |
|
if (val < 5) formname.submit(); |
|
if (val == 5) { |
|
if (!checkReceiptNo(formname,'notOK')) { return false;} |
|
formname.submit(); |
|
} |
|
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 |
|
&commonJSfunctions($request); |
&commonJSfunctions($request); |
# my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle); |
|
my $result; |
my $result; |
my (undef,$sections) = &getclasslist('all','0'); |
my (undef,$sections) = &getclasslist('all','0'); |
my $savedState = &savedState(); |
my $savedState = &savedState(); |
Line 8870 GRADINGMENUJS
|
Line 8856 GRADINGMENUJS
|
|
|
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
$result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
'<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n". |
# '<input type="hidden" name="handgrade" value="'.$hdgrade.'" />'."\n". |
|
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
'<input type="hidden" name="probTitle" value="'.$probTitle.'" />'."\n". |
'<input type="hidden" name="command" value="" />'."\n". |
|
'<input type="hidden" name="saveState" value="" />'."\n". |
'<input type="hidden" name="saveState" value="" />'."\n". |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
'<input type="hidden" name="gradingMenu" value="1" />'."\n". |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
'<input type="hidden" name="showgrading" value="yes" />'."\n"; |
|
|
$result.=' |
$result.=' |
<h2> |
<h2> |
'.&mt('Grade Current Resource').' |
'.&mt('Select individual students to grade').' |
</h2> |
</h2> |
|
|
<div class="LC_columnSection"> |
<div class="LC_columnSection"> |
Line 8924 GRADINGMENUJS
|
Line 8908 GRADINGMENUJS
|
</div> |
</div> |
|
|
<br /> |
<br /> |
<div> |
<input type="hidden" name="command" value="submission" /> |
<div> |
<input type="submit" value="'.&mt('Next').' →" /> |
<label> |
|
<input type="radio" name="radioChoice" value="submission" '. |
|
($saveCmd eq 'submission' ? 'checked="checked"' : '').' /> '. |
|
&mt('Select individual students to grade and view submissions.').' |
|
</label> |
|
</div> |
|
<div> |
|
<label> |
|
<input type="radio" name="radioChoice" value="viewgrades" '. |
|
($saveCmd eq 'viewgrades' ? 'checked="checked"' : '').' /> '. |
|
&mt('Grade all selected students in a grading table.').' |
|
</label> |
|
</div> |
|
<div> |
|
<input type="button" onclick="javascript:checkChoice(this.form,\'2\');" value="'.&mt('Next').' →" /> |
|
</div> |
</div> |
</div> |
</div> |
|
|
Line 9561 sub handler {
|
Line 9530 sub handler {
|
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { |
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { |
$request->print(&grading_menu($request)); |
$request->print(&grading_menu($request)); |
} elsif ($command eq 'individual' && $perm{'vgr'}) { |
} elsif ($command eq 'individual' && $perm{'vgr'}) { |
$request->print(&individual($request)); |
$request->print(&submit_options($request)); |
} elsif ($command eq 'ungraded' && $perm{'vgr'}) { |
} elsif ($command eq 'ungraded' && $perm{'vgr'}) { |
$request->print(&submit_options($request)); |
$request->print(&submit_options($request)); |
} elsif ($command eq 'table' && $perm{'vgr'}) { |
} 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'}) { |
} elsif ($command eq 'all_for_one' && $perm{'vgr'}) { |
$request->print(&submit_options_sequence($request)); |
$request->print(&submit_options_sequence($request)); |
} elsif ($command eq 'viewgrades' && $perm{'vgr'}) { |
} elsif ($command eq 'viewgrades' && $perm{'vgr'}) { |