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

www lon-capa-cvs@mail.lon-capa.org
Sun, 15 May 2005 01:11:33 -0000


www		Sat May 14 21:11:33 2005 EDT

  Modified files:              
    /loncom/homework	grades.pm 
    /loncom/interface	lonmsg.pm 
  Log:
  COM: still forgetful about which folder I was in
  GRDS: Added "Grading" to the Validate Button (confused me at first)
  GRDS: Able to override the don't-reset-correct safeguard with checkbox
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.264 loncom/homework/grades.pm:1.265
--- loncom/homework/grades.pm:1.264	Fri Apr 29 13:02:06 2005
+++ loncom/homework/grades.pm	Sat May 14 21:11:32 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.264 2005/04/29 17:02:06 banghart Exp $
+# $Id: grades.pm,v 1.265 2005/05/15 01:11:32 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2308,6 +2308,7 @@
     function writeRadText(partid,weight) {
 	var selval   = document.classgrade["SELVAL_"+partid];
 	var radioButton = document.classgrade["RADVAL_"+partid];
+        var override = document.classgrade["FORCE_"+partid].checked;
 	var textbox = document.classgrade["TEXTVAL_"+partid];
 	if (selval[1].selected || selval[2].selected) {
 	    for (var i=0; i<radioButton.length; i++) {
@@ -2321,7 +2322,7 @@
 		var scorename = document.classgrade["GD_"+user+"_"+partid+"_awarded"];
 		var saveval   = document.classgrade["GD_"+user+"_"+partid+"_solved_s"].value;
 		var selname   = document.classgrade["GD_"+user+"_"+partid+"_solved"];
-		if (saveval != "correct") {
+		if ((saveval != "correct") || override) {
 		    scorename.value = "";
 		    if (selval[1].selected) {
 			selname[1].selected = true;
@@ -2338,7 +2339,7 @@
 		var scorename = document.classgrade["GD_"+user+"_"+partid+"_awarded"];
 		var saveval   = document.classgrade["GD_"+user+"_"+partid+"_solved_s"].value;
 		var selname   = document.classgrade["GD_"+user+"_"+partid+"_solved"];
-		if (saveval != "correct") {
+		if ((saveval != "correct") || override) {
 		    scorename.value = document.classgrade["GD_"+user+"_"+partid+"_awarded_s"].value;
 		    selname[0].selected = true;
 		}
@@ -2492,7 +2493,8 @@
 		$weight{$partid}.')"> '.
 	    '<option selected="on"> </option>'.
 	    '<option>excused</option>'.
-	    '<option>reset status</option></select></td></tr>'."\n";
+	    '<option>reset status</option></select></td>'.
+            '<td><input type="checkbox" name="FORCE_'.$partid.'" /> Override "Correct"</td></tr>'."\n";
 	$ctsparts++;
     }
     $result.='</table>'.'</td></tr></table>'.'</td></tr></table>'."\n".
@@ -3785,7 +3787,7 @@
           </tr>
           <tr bgcolor="#ffffe6">
             <td colspan="2">
-              <input type="submit" value="Validate Scantron Records" />
+              <input type="submit" value="Grading: Validate Scantron Records" />
             </td>
           </tr>
         </table>
@@ -4240,10 +4242,10 @@
 	    $r->print('<p><font color="red">You have not selected a the format of the student\'s response data.</font></p>');
 	} 
     } else {
-	my $warning=&scantron_warning_screen('Validate Records');
+	my $warning=&scantron_warning_screen('Grading: Validate Records');
 	$r->print(<<STUFF);
 $warning
-<input type="submit" name="submit" value="Validate Records" />
+<input type="submit" name="submit" value="Grading: Validate Records" />
 <input type="hidden" name="command" value="scantron_validate" />
 STUFF
     }
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.141 loncom/interface/lonmsg.pm:1.142
--- loncom/interface/lonmsg.pm:1.141	Mon Apr 11 17:51:43 2005
+++ loncom/interface/lonmsg.pm	Sat May 14 21:11:32 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.141 2005/04/11 21:51:43 raeburn Exp $
+# $Id: lonmsg.pm,v 1.142 2005/05/15 01:11:32 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -613,6 +613,7 @@
 
 sub movemsg {
     my ($msgid,$srcfolder,$trgfolder)=@_;
+    if ($srcfolder eq 'new') { $srcfolder=''; }
     my $srcsuffix=&foldersuffix($srcfolder);
     my $trgsuffix=&foldersuffix($trgfolder);
 
@@ -1043,7 +1044,7 @@
 # ============================================================== Compose output
 
 sub compout {
-    my ($r,$forwarding,$replying,$broadcast,$replycrit,$folder)=@_;
+    my ($r,$forwarding,$replying,$broadcast,$replycrit,$folder,$dismode)=@_;
     my $suffix=&foldersuffix($folder);
 
     if ($broadcast eq 'individual') {
@@ -1174,6 +1175,8 @@
 </textarea></p><br />
 $dispcrit
 $disbase
+<input type="hidden" name="folder" value="$folder" />
+<input type="hidden" name="dismode" value="$dismode" />
 <input type="submit" name="send" value="$func $lt{'ma'}" />
 <input type="submit" name="cancel" value="$lt{'ca'}" /><hr />
 $citation
@@ -2048,6 +2051,14 @@
     } else {
 	$sqs.='&folder='.&Apache::lonnet::escape($folder);
     }
+# ------------------------------------------------------------ Get Display Mode
+
+    my $dismode=$env{'form.dismode'};
+    unless ($dismode) { 
+	$dismode=''; 
+    } else {
+	$sqs.='&dismode='.&Apache::lonnet::escape($dismode);
+    }
 
 # --------------------------------------------------------------------- Display
 
@@ -2079,7 +2090,7 @@
     if ($env{'form.display'}) {
 	&displaymessage($r,$env{'form.display'},$folder);
     } elsif ($env{'form.replyto'}) {
-	&compout($r,'',$env{'form.replyto'},undef,undef,$folder);
+	&compout($r,'',$env{'form.replyto'},undef,undef,$folder,$dismode);
     } elsif ($env{'form.confirm'}) {
 	&printheader($r,'','Confirmed Receipt');
 	foreach (keys %env) {
@@ -2104,7 +2115,7 @@
 	&printheader($r,'','Deleted Message');
 	&statuschange($env{'form.markdel'},'deleted',$folder);
 	&Apache::loncommunicate::menu($r);
-	&disall($r,$folder);
+	&disall($r,($folder?$folder:$dismode));
     } elsif ($env{'form.markedmove'}) {
 	my $total=0;
 	foreach (keys %env) {
@@ -2117,7 +2128,7 @@
 	&printheader($r,'','Moved Messages');
 	$r->print('Moved '.$total.' message(s)<p>');
 	&Apache::loncommunicate::menu($r);
-	&disall($r,$folder);
+	&disall($r,($folder?$folder:$dismode));
     } elsif ($env{'form.markeddel'}) {
 	my $total=0;
 	foreach (keys %env) {
@@ -2129,12 +2140,12 @@
 	&printheader($r,'','Deleted Messages');
 	$r->print('Deleted '.$total.' message(s)<p>');
 	&Apache::loncommunicate::menu($r);
-	&disall($r,$folder);
+	&disall($r,($folder?$folder:$dismode));
     } elsif ($env{'form.markunread'}) {
 	&printheader($r,'','Marked Message as Unread');
 	&statuschange($env{'form.markunread'},'new');
 	&Apache::loncommunicate::menu($r);
-	&disall($r,$folder);
+	&disall($r,($folder?$folder:$dismode));
     } elsif ($env{'form.compose'}) {
 	&compout($r,'','',$env{'form.compose'});
     } elsif ($env{'form.recordftf'}) {
@@ -2146,7 +2157,7 @@
 	if ($env{'form.storebasecomment'}) {
 	    &storecomment($r);
 	}
-	&disall($r,$folder);
+	&disall($r,($folder?$folder:$dismode));
     } elsif ($env{'form.newfolder'}) {
 	&printheader($r,'','New Folder');
 	&makefolder($env{'form.newfolder'});
@@ -2156,8 +2167,8 @@
 	&storedcommentlisting($r);
     } else {
 	&printheader($r,'','Display All Messages');
-	&Apache::loncommunicate::menu($r);
-	&disall($r,$folder);
+	&Apache::loncommunicate::menu($r); 
+	&disall($r,($folder?$folder:$dismode));
     }
     $r->print(&Apache::loncommon::endbodytag().'</html>');
     return OK;