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

bisitz bisitz at source.lon-capa.org
Mon May 5 13:40:54 EDT 2014


bisitz		Mon May  5 17:40:54 2014 EDT

  Modified files:              
    /loncom/homework	matchresponse.pm rankresponse.pm 
  Log:
  More practicable and consistent output of previous tries with incomplete answers:
  Explicit display of empty answer items, i.e. not submitted
  
  
  
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.90 loncom/homework/matchresponse.pm:1.91
--- loncom/homework/matchresponse.pm:1.90	Thu Feb 27 14:41:34 2014
+++ loncom/homework/matchresponse.pm	Mon May  5 17:40:54 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.90 2014/02/27 14:41:34 bisitz Exp $
+# $Id: matchresponse.pm,v 1.91 2014/05/05 17:40:54 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -581,6 +581,9 @@
     
     foreach my $name (@{ $foil_order }) {
 	my $item = &HTML::Entities::encode(shift(@items),'<>&"');
+        if ($item eq '') {
+            $item = ' ';
+        }
 	$output .= '<tr><td>'.$item.'</td></tr>';
     }
     return if (!defined($output));
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.70 loncom/homework/rankresponse.pm:1.71
--- loncom/homework/rankresponse.pm:1.70	Thu Feb 27 14:41:34 2014
+++ loncom/homework/rankresponse.pm	Mon May  5 17:40:54 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.70 2014/02/27 14:41:34 bisitz Exp $
+# $Id: rankresponse.pm,v 1.71 2014/05/05 17:40:54 bisitz Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -335,8 +335,11 @@
     my %grading     =&Apache::lonnet::str2hash($other_data->[1]);
     my $output;
     foreach my $name (@{ $foil_order }) {
-	next if (!defined($lastresponse{$name}));
-	$output .= '<tr><td>'.&HTML::Entities::encode($lastresponse{$name},'<>&"').'</td></tr>';
+        if (defined($lastresponse{$name})) {
+            $output .= '<tr><td>'.&HTML::Entities::encode($lastresponse{$name},'<>&"').'</td></tr>';
+        } else {
+            $output .= '<tr><td> </td></tr>';
+        }
     }
     return if (!defined($output));
     $output =




More information about the LON-CAPA-cvs mailing list