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

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 02 Apr 2003 15:09:00 -0000


sakharuk		Wed Apr  2 10:09:00 2003 EDT

  Modified files:              
    /loncom/homework	radiobuttonresponse.pm 
  Log:
   Start to work on radiobutton response mode for the online exam.
  
  
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.63 loncom/homework/radiobuttonresponse.pm:1.64
--- loncom/homework/radiobuttonresponse.pm:1.63	Tue Jan  7 17:13:07 2003
+++ loncom/homework/radiobuttonresponse.pm	Wed Apr  2 10:09:00 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.63 2003/01/07 22:13:07 albertel Exp $
+# $Id: radiobuttonresponse.pm,v 1.64 2003/04/02 15:09:00 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -370,7 +370,7 @@
       }
     }
   } else {
-    my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
+    my @alphabet = ('A'..'Z');
     my $i = 0;
     my $temp=0;  
     my $id=$Apache::inputtags::response['-1'];
@@ -379,12 +379,11 @@
     my %lastresponse=&Apache::lonnet::str2hash($lastresponse);
     foreach my $name (@whichfoils) {
       if ($target ne 'tex') {
-	  $result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\" ";
+          my $ValueForInput;
+	  if ($Apache::lonhomework::type ne 'exam') {$ValueForInput=$temp;} else {$ValueForInput=$alphabet[$temp];}
+	  $result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$ValueForInput\" ";
 	  if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
 	  $result .= '>'.$Apache::response::foilgroup{$name.'.text'}."</input>\n";
-	  if ($Apache::lonhomework::type eq 'exam') {
-	      $result .= '<table border="1"><tr><td>A: &nbsp;&nbsp;Correct</td><td>B: &nbsp;&nbsp;Incorrect</td></tr></table>';
-	  }
       } else {
 	  if ($Apache::lonhomework::type eq 'exam') {
 	      $result .= '{\small \textbf{'.$alphabet[$i].'}}$\bigcirc$'.$Apache::response::foilgroup{$name.'.text'}.'\\\\';  #' stupid emacs