[LON-CAPA-cvs] cvs: loncom /homework grades.pm

banghart lon-capa-cvs-allow@mail.lon-capa.org
Mon, 01 Oct 2007 19:41:53 -0000


This is a MIME encoded message

--banghart1191267713
Content-Type: text/plain

banghart		Mon Oct  1 15:41:53 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  	Saving work in progress. Needs testing. 
  	Changes to permit use of multiple select for Student Status.
  	Layout change in Select Grading/Viewing Option
  
  
--banghart1191267713
Content-Type: text/plain
Content-Disposition: attachment; filename="banghart-20071001154153.txt"

Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.441 loncom/homework/grades.pm:1.442
--- loncom/homework/grades.pm:1.441	Thu Sep 27 15:44:51 2007
+++ loncom/homework/grades.pm	Mon Oct  1 15:41:51 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.441 2007/09/27 19:44:51 www Exp $
+# $Id: grades.pm,v 1.442 2007/10/01 19:41:51 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -398,6 +398,7 @@
 sub getclasslist {
     my ($getsec,$filterlist) = @_;
     my @getsec;
+    my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
     if (!ref($getsec)) {
 	if ($getsec ne '' && $getsec ne 'all') {
 	    @getsec=($getsec);
@@ -427,8 +428,8 @@
         my $status   = 
             $classlist->{$student}->[&Apache::loncoursedata::CL_STATUS()];
 	# filter students according to status selected
-	if ($filterlist && $env{'form.Status'} ne 'Any') {
-	    if ($env{'form.Status'} ne $status) {
+	if ($filterlist && (!($stu_status =~ /Any/))) {
+	    if (!($stu_status =~ $status)) {
 		delete ($classlist->{$student});
 		next;
 	    }
@@ -510,6 +511,7 @@
 # Shows a student's view of problem and submission
 sub jscriptNform {
     my ($symb) = @_;
+    my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
     my $jscript='<script type="text/javascript" language="javascript">'."\n".
 	'    function viewOneStudent(user,domain) {'."\n".
 	'	document.onestudent.student.value = user;'."\n".
@@ -521,7 +523,7 @@
 	'<input type="hidden" name="symb"    value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
 	'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n".
 	'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n".
-	'<input type="hidden" name="Status"  value="'.$env{'form.Status'}.'" />'."\n".
+	'<input type="hidden" name="Status"  value="'.$stu_status.'" />'."\n".
 	'<input type="hidden" name="command" value="submission" />'."\n".
 	'<input type="hidden" name="student" value="" />'."\n".
 	'<input type="hidden" name="userdom" value="" />'."\n".
@@ -746,8 +748,8 @@
     if ($env{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1) {
 	$gradeTable.='<label><input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> essay part only </label>'."\n";
     }
-
-    my $saveStatus = $env{'form.Status'} eq '' ? 'Active' : $env{'form.Status'};
+    my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
+    my $saveStatus = $stu_status eq '' ? 'Active' : $stu_status;
     $env{'form.Status'} = $saveStatus;
     $gradeTable.='<label><input type="radio" name="lastSub" value="lastonly" '.$checklastsub.' /> last submission only </label>'."\n".
 	'<label><input type="radio" name="lastSub" value="last" /> last submission & parts info </label>'."\n".
@@ -769,7 +771,7 @@
 	'<input type="hidden" name="saveStatusOld" value="'.$saveStatus.'" />'."\n";
 
     if (exists($env{'form.gradingMenu'}) && exists($env{'form.Status'})) {
-	$gradeTable.='<input type="hidden" name="Status"   value="'.$env{'form.Status'}.'" />'."\n";
+	$gradeTable.='<input type="hidden" name="Status"   value="'.$stu_status.'" />'."\n";
     } else {
 	$gradeTable.='<b>Student Status:</b> '.
 	    &Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,'javascript:reLoadList(this.form);').'<br />';
@@ -1777,10 +1779,11 @@
 	    $env{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0';
 	}
 	my $overRideScore = $env{'form.overRideScore'} eq '' ? 'no' : $env{'form.overRideScore'};
+	my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
 	$request->print('<form action="/adm/grades" method="post" name="SCORE" enctype="multipart/form-data">'."\n".
 			'<input type="hidden" name="command"    value="handgrade" />'."\n".
 			'<input type="hidden" name="saveState"  value="'.$env{'form.saveState'}.'" />'."\n".
-			'<input type="hidden" name="Status"     value="'.$env{'form.Status'}.'" />'."\n".
+			'<input type="hidden" name="Status"     value="'.$stu_status.'" />'."\n".
 			'<input type="hidden" name="overRideScore" value="'.$overRideScore.'" />'."\n".
 			'<input type="hidden" name="probTitle"  value="'.$env{'form.probTitle'}.'" />'."\n".
 			'<input type="hidden" name="refresh"    value="off" />'."\n".
@@ -3007,12 +3010,13 @@
     $result.=&jscriptNform($symb);
 
     #beginning of class grading form
+    my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
     $result.= '<form action="/adm/grades" method="post" name="classgrade">'."\n".
 	'<input type="hidden" name="symb"    value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
 	'<input type="hidden" name="command" value="editgrades" />'."\n".
 	&build_section_inputs().
 	'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."\n".
-	'<input type="hidden" name="Status" value="'.$env{'form.Status'}.'" />'."\n".
+	'<input type="hidden" name="Status" value="'.$env{'stu_status'}.'" />'."\n".
 	'<input type="hidden" name="probTitle" value="'.$env{'form.probTitle'}.'" />'."\n";
 
     my $sectionClass;
@@ -3131,9 +3135,10 @@
     if (scalar(%$fullname) eq 0) {
 	my $colspan=3+scalar(@parts);
 	my $section_display = join (", ",&Apache::loncommon::get_env_multiple('form.section'));
+        my $stu_status = join(' or ',&Apache::loncommon::get_env_multiple('form.Status'));
 	$result='<span class="LC_warning">'.
 	    &mt('There are no students in section(s) [_1] with enrollment status [_2] to modify or grade',
-	        $section_display, $env{'form.Status'}).
+	        $section_display, $stu_status).
 	    '</span>';
     }
     $result.=&show_grading_menu_form($symb);
@@ -3917,7 +3922,8 @@
 	'<label><input type="radio" name="lastSub" value="all" /> all details</label>'."\n";
     
     $result.=&build_section_inputs();
-    $result.='<input type="hidden" name="Status"  value="'.$env{'form.Status'}.'" />'."\n".
+    my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
+    $result.='<input type="hidden" name="Status"  value="'.$stu_status.'" />'."\n".
 	'<input type="hidden" name="command" value="displayPage" />'."\n".
 	'<input type="hidden" name="symb"    value="'.&Apache::lonenc::check_encrypt($symb).'" />'."\n".
 	'<input type="hidden" name="saveState" value="'.$env{'form.saveState'}.'" />'."<br />\n";
@@ -7008,8 +7014,13 @@
 	'<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".
-	'&nbsp;'.&mt('Select Section').': <select name="section" multiple="multiple" size="3">'."\n";
+	'&nbsp;<select name="section" multiple="multiple" size="3">'."\n";
     if (ref($sections)) {
 	foreach (sort (@$sections)) {
 	    $result.='<option value="'.$_.'" '.
@@ -7017,12 +7028,14 @@
 	}
     }
     $result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="selected"' : ''). '>all</option></select> &nbsp; ';
-
-    $result.=&mt('Student Status').':'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef);
+#    $result.= '</td><td>'."\n";
+#    $result.='Put group select here'."\n";
+    $result.='</td><td>'."\n";
+    $result.=&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,3,undef,'mult');
 
     $result.='</td></tr>';
 
-    $result.='<tr bgcolor="#ffffe6"valign="top"><td><label>'.
+    $result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="3"><label>'.
 	'<input type="radio" name="radioChoice" value="submission" '.
 	($saveCmd eq 'submission' ? 'checked="checked"' : '').' /> '.'<b>'.&mt('Current Resource').':</b> '.&mt('For one or more students').
 	'</label> <select name="submitonly">'.
@@ -7037,17 +7050,17 @@
 	'<option value="all" '.
 	($saveSub eq 'all' ? 'selected="selected"' : '').'>'.&mt('with any status').'</option></select></td></tr>'."\n";
 
-    $result.='<tr bgcolor="#ffffe6"valign="top"><td>'.
+    $result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'.
 	'<label><input type="radio" name="radioChoice" value="viewgrades" '.
 	($saveCmd eq 'viewgrades' ? 'checked="checked"' : '').' /> '.
 	'<b>Current Resource:</b> For all students in selected section or course</label></td></tr>'."\n";
 
-    $result.='<tr bgcolor="#ffffe6" valign="top"><td>'.
+    $result.='<tr bgcolor="#ffffe6" valign="top"><td colspan="2">'.
 	'<label><input type="radio" name="radioChoice" value="pickStudentPage" '.
 	($saveCmd eq 'pickStudentPage' ? 'checked="checked"' : '').' /> '.
 	'The <b>complete</b> set/page/sequence: For one student</label></td></tr>'."\n";
 
-    $result.='<tr bgcolor="#ffffe6"><td><br />'.
+    $result.='<tr bgcolor="#ffffe6"><td colspan="2"><br />'.
 	'<input type="button" onClick="javascript:checkChoice(this.form,\'2\');" value="Next->" />'.
 	'</td></tr></table>'."\n";
 

--banghart1191267713--