[LON-CAPA-cvs] cvs: loncom /homework grades.pm
banghart
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 12 Oct 2007 22:36:58 -0000
banghart Fri Oct 12 18:36:58 2007 EDT
Modified files:
/loncom/homework grades.pm
Log:
Bug 4058. Remove dead code. Make verify receipt javascript work.
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.457 loncom/homework/grades.pm:1.458
--- loncom/homework/grades.pm:1.457 Fri Oct 12 16:06:52 2007
+++ loncom/homework/grades.pm Fri Oct 12 18:36:56 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.457 2007/10/12 20:06:52 banghart Exp $
+# $Id: grades.pm,v 1.458 2007/10/12 22:36:56 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -7229,11 +7229,9 @@
$fields{'command'} = 'verify';
$url = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
push (@menu, { url => "",
- jscript => ' onClick="javascript:checkChoice2(document.forms.gradingMenu,\'5\',\'verify\')" ',
name => &mt('Verify Receipt'),
short_description =>
&mt('')});
-
#
# Create the menu
my $Str;
@@ -7255,10 +7253,10 @@
$menudata->{'url'}.'" >'.
$menudata->{'name'}."</a></h3>\n";
} else {
- $Str .=' <h3><a '.
+ $Str .=' <h3><input type="button" value="Verify Receipt" '.
$menudata->{'jscript'}.
- ' href="javascript:checkChoice2(document.forms.gradingMenu,\'5\',\'verify\')" >'.
- $menudata->{'name'}."</a></h3>\n";
+ ' onClick="javascript:checkChoice(document.forms.gradingMenu,\'5\',\'verify\')" '.
+ ' /></h3>';
$Str .= (' 'x8).
' receipt: '.&Apache::lonnet::recprefix($env{'request.course.id'}).
'-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')" />';
@@ -7279,30 +7277,14 @@
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 checkChoice2(formname,val,cmdx) {
- if (val <= 2) {
- var cmd = radioSelection(formname.radioChoice);
- var cmdsave = cmd;
- } else {
- cmd = cmdx;
- cmdsave = 'submission';
- }
- formname.command.value = cmd;
if (val < 5) formname.submit();
if (val == 5) {
- if (!checkReceiptNo(formname,'notOK')) { return false;}
- formname.submit();
+ if (!checkReceiptNo(formname,'notOK')) {
+ return false;
+ } else {
+ formname.submit();
+ }
}
- if (val < 7) formname.submit();
}
function checkReceiptNo(formname,nospace) {
@@ -7321,43 +7303,6 @@
</script>
GRADINGMENUJS
&commonJSfunctions($request);
- my $result='<h3> <span class="LC_info">Manual Grading/View Submission</span></h3>';
- $result.=$table;
- 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'});
-
- $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="handgrade" value="'.$hdgrade.'" />'."\n".
- '<input type="hidden" name="probTitle" value="'.$probTitle.'" ue="" />'."\n".
- '<input type="hidden" name="saveState" value="" />'."\n".
- '<input type="hidden" name="gradingMenu" value="1" />'."\n".
- '<input type="hidden" name="showgrading" value="yes" />'."\n";
-
- $result.='<table width="100%" border="0"><tr><td bgcolor=#777777>'."\n".
- '<table width="100%" border="0"><tr bgcolor="#e6ffff"><td colspan="2">'."\n".
- ' <b>Select a Grading/Viewing Option</b></td></tr>'."\n".
- '<tr bgcolor="#ffffe6" valign="top"><td>'."\n";
-
- $result.='<table width="100%" border="0">';
- $result.='<tr bgcolor="#ffffe6" valign="top">'."\n";
- $result.='<td><b>'.&mt('Sections').'</b></td>';
-# $result.='<td>Groups</td>';
- $result.='<td><b>'.&mt('Access Status').'</td>'."\n";
- $result.='</tr>';
- $result.='<tr bgcolor="#ffffe6" valign="top"><td>'."\n".
- ' <select name="section" multiple="multiple" size="3">'."\n";
- if (ref($sections)) {
- foreach (sort (@$sections)) {
- $result.='<option value="'.$_.'" '.
- ($saveSec eq $_ ? 'selected="selected"':'').'>'.$_.'</option>'."\n";
- }
- }
- $result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> ';
return $Str;
}