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

www lon-capa-cvs@mail.lon-capa.org
Tue, 22 Nov 2005 20:21:03 -0000


www		Tue Nov 22 15:21:03 2005 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Bug #3894: choose if you want to send along grading info
  Also, subject selection now actually works.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.297 loncom/homework/grades.pm:1.298
--- loncom/homework/grades.pm:1.297	Tue Nov 22 14:31:43 2005
+++ loncom/homework/grades.pm	Tue Nov 22 15:21:02 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.297 2005/11/22 19:31:43 www Exp $
+# $Id: grades.pm,v 1.298 2005/11/22 20:21:02 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1844,11 +1844,12 @@
 	    '<input type="hidden" name="newmsg'.$counter.'" value="" />'."\n";
 	$result.='&nbsp;<a href="javascript:msgCenter(document.SCORE,'.$counter.
 	    ',\''.$msgfor.'\')"; TARGET=_self>'.
-	    'Compose Message to student'.(scalar(@col_fullnames) >= 1 ? 's' : '').'</a> &nbsp;'.
+	    &mt('Compose message to student').(scalar(@col_fullnames) >= 1 ? 's' : '').'</a> ('.
+	    &mt('incl. grades').' <input type="checkbox" name="withgrades'.$counter.'" />)'.
 	    '<img src="'.$request->dir_config('lonIconsURL').
 	    '/mailbkgrd.gif" width="14" height="10" name="mailicon'.$counter.'" />'."\n".
-	    '<br />&nbsp;(Message will be sent when you click on Save & Next below.)'."\n" 
-	    if ($env{'form.handgrade'} eq 'yes');
+	    '<br />&nbsp;('.
+	    &mt('Message will be sent when you click on Save & Next below.').")\n";
 	$request->print($result);
     }
     if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
@@ -1974,19 +1975,21 @@
 	    my $includemsg = $env{'form.includemsg'.$ctr};
 	    my ($subject,$message,$msgstatus) = ('','','');
 	    if ($includemsg =~ /savemsg|newmsg\Q$ctr\E/) {
-		$subject = $env{'form.msgsub'} if ($includemsg =~ /^msgsub/);
+		$subject = $env{'form.msgsub'} if ($includemsg =~ /msgsub/);
 		unless ($subject=~/\w/) { $subject=&mt('Grading Feedback'); }
 		my (@msgnum) = split(/,/,$includemsg);
 		foreach (@msgnum) {
 		    $message.=$env{'form.'.$_} if ($_ =~ /savemsg|newmsg/ && $_ ne '');
 		}
 		$message =&Apache::lonfeedback::clear_out_html($message);
-		$message.="\n\nPoint".($pts > 1 ? 's':'').' awarded = '.$pts.' out of '.$wgt;
-		$message.=" for <a href=\"".
+		if ($env{'form.withgrades'.$ctr}) {
+		    $message.="\n\nPoint".($pts > 1 ? 's':'').' awarded = '.$pts.' out of '.$wgt;
+		    $message.=" for <a href=\"".
 		    &Apache::lonnet::clutter($url).
 		    "?symb=$symb\">$env{'form.probTitle'}</a>";
+		}
 		$msgstatus = &Apache::lonmsg::user_normal_msg ($uname,$udom,
-							       $env{'form.msgsub'}.' ['.
+							       $subject.' ['.
 							       &Apache::lonnet::declutter($url).']',$message);
 		$request->print('<br />'.&mt('Sending message to [_1]@[_2]',$uname,$udom).': '.
 				$msgstatus);