[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm matchresponse.pm optionresponse.pm rankresponse.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 20 Jun 2005 21:31:10 -0000


albertel		Mon Jun 20 17:31:10 2005 EDT

  Modified files:              
    /loncom/homework	inputtags.pm matchresponse.pm optionresponse.pm 
                    	rankresponse.pm 
  Log:
  - slapping a <b> arond the correct value for option/rank/match responses BUG#4139
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.168 loncom/homework/inputtags.pm:1.169
--- loncom/homework/inputtags.pm:1.168	Mon Jun 20 15:54:28 2005
+++ loncom/homework/inputtags.pm	Mon Jun 20 17:31:07 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.168 2005/06/20 19:54:28 albertel Exp $
+# $Id: inputtags.pm,v 1.169 2005/06/20 21:31:07 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -401,7 +401,7 @@
 }
 
 sub decideoutput {
-    my ($award,$awardmsg,$solved,$previous,$target)=@_;
+    my ($award,$awarded,$awardmsg,$solved,$previous,$target)=@_;
     my $message='';
     my $button=0;
     my $previousmsg;
@@ -413,11 +413,18 @@
 	  'not_charged_try' => '#ffffaa',
 	  'no_message' => '#fffff',
 	  );
+
     if ($previous) { $previousmsg=&mt('You have entered that answer before'); }
     
     if      ($solved =~ /^correct/) {
+	$bgcolor=$possiblecolors{'correct'};
 	if ($award eq 'ASSIGNED_SCORE') {
 	    $message = &mt("A score has been assigned.");
+	    if ($awarded < 1 && $awarded > 0) {
+		$bgcolor=$possiblecolors{'not_charged_try'};
+	    } elsif ($awarded < 1) {
+		$bgcolor=$possiblecolors{'charged_try'};
+	    }
 	} else {
 	    if ($target eq 'tex') {
 		$message = '\textbf{'.&mt('You are correct.').'}';
@@ -434,7 +441,6 @@
 		    (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):'');
 	    }
 	}
-	$bgcolor=$possiblecolors{'correct'};
 	$button=0;
 	$previousmsg='';
     } elsif ($solved =~ /^excused/) {
@@ -787,6 +793,7 @@
     if ( $status ne 'CLOSED' && $status ne 'UNAVAILABLE' &&
 	 $status ne 'INVALID_ACCESS') {  
 	my $award = $Apache::lonhomework::history{"resource.$id.award"};
+	my $awarded = $Apache::lonhomework::history{"resource.$id.awarded"};
 	my $solved = $Apache::lonhomework::history{"resource.$id.solved"};
 	my $previous = $Apache::lonhomework::history{"resource.$id.previous"};
 	my $awardmsg = $Apache::lonhomework::history{"resource.$id.awardmsg"};
@@ -794,7 +801,8 @@
 	if ( $award ne '' || $solved ne '' || $status eq 'SHOW_ANSWER') {
 	    &Apache::lonxml::debug('Getting message');
 	    ($showbutton,$bgcolor,$message,$previousmsg) =
-		&decideoutput($award,$awardmsg,$solved,$previous,$target);
+		&decideoutput($award,$awarded,$awardmsg,$solved,$previous,
+			      $target);
 	    if ($target eq 'tex') {
 		$message='\vskip 2 mm '.$message.' ';
 	    } else {
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.52 loncom/homework/matchresponse.pm:1.53
--- loncom/homework/matchresponse.pm:1.52	Thu Apr  7 02:56:22 2005
+++ loncom/homework/matchresponse.pm	Mon Jun 20 17:31:07 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.52 2005/04/07 06:56:22 albertel Exp $
+# $Id: matchresponse.pm,v 1.53 2005/06/20 21:31:07 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -438,7 +438,7 @@
 	    if ($target eq 'tex') {
 		$question.=' \\\\ '.$letter.':'.$text;
 	    } else {
-		$question.='<br />'.$letter.':'.$text;
+		$question.='<br /><b>'.$letter.':</b> '.$text;
 	    }
 	}
     } else {
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.126 loncom/homework/optionresponse.pm:1.127
--- loncom/homework/optionresponse.pm:1.126	Mon Jun  6 21:33:19 2005
+++ loncom/homework/optionresponse.pm	Mon Jun 20 17:31:07 2005
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.126 2005/06/07 01:33:19 albertel Exp $
+# $Id: optionresponse.pm,v 1.127 2005/06/20 21:31:07 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -360,7 +360,7 @@
 		if ($text=~/^\s*$/) {
 		    $text=$value.$text;
 		} else {
-		    $text=$value.': '.$text;
+		    $text='<b>'.$value.':</b> '.$text;
 		}
 	    } else {
 		$text='&#149;'.$text;
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.45 loncom/homework/rankresponse.pm:1.46
--- loncom/homework/rankresponse.pm:1.45	Tue Mar 15 11:55:22 2005
+++ loncom/homework/rankresponse.pm	Mon Jun 20 17:31:07 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.45 2005/03/15 16:55:22 albertel Exp $
+# $Id: rankresponse.pm,v 1.46 2005/06/20 21:31:07 albertel Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -263,8 +263,11 @@
 	foreach my $name (@whichfoils) {
 	    my $text=$Apache::response::foilgroup{$name.'.text'};
 	    my $value=shift(@correctorder);
-	    if ($target eq 'web') {$result.='<br />';} else {$result.=' \strut\\\\\strut ';}
-	    $result.=$value.':'.$text;
+	    if ($target eq 'web') {
+		$result.='<br /><b>'.$value.':</b> '.$text;
+	    } else {
+		$result.=' \strut\\\\\strut '.$value.':'.$text;
+	    }
 	}
     } else {
 	my $i = 0;