--- loncom/homework/optionresponse.pm	2003/03/25 22:13:25	1.68
+++ loncom/homework/optionresponse.pm	2003/04/02 18:07:10	1.72
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.68 2003/03/25 22:13:25 sakharuk Exp $
+# $Id: optionresponse.pm,v 1.72 2003/04/02 18:07:10 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -316,8 +316,7 @@ sub displayfoils {
   my $result;
   my $name;
   my $displayoptionintex=0;
-  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 @whichopt = &whichfoils($max,$randomize);
   my $part=$Apache::inputtags::part;
   my $id=$Apache::inputtags::response[-1];
@@ -383,11 +382,13 @@ sub displayfoils {
 	}
       }
       if ($target ne 'tex') {
-	  $optionlist='<select name="HWVAL_'.
+	  if ($Apache::lonhomework::type ne 'exam') {
+	    $optionlist='<select name="HWVAL_'.
 	      $Apache::inputtags::response['-1'].':'.$temp.'">'.
 		  $optionlist."</select>\n";
+	  }
 	  my $text=$Apache::response::foilgroup{$name.'.text'};
-	  if (!($text=~s|<drawoptionlist\s*/>|$optionlist|)) {
+	  if (!($text=~s|<drawoptionlist\s*/>|$optionlist|) && $Apache::lonhomework::type ne 'exam') {
 	      $text=$optionlist.$text;
 	  }
 	  $result.=$break.$text."\n";
@@ -415,7 +416,7 @@ sub displayfoils {
 		  }
 	      }
 	      if ($Apache::lonhomework::type eq 'exam') {
-		  $result.='\vskip -2 mm\parbox{\textwidth}{\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\parbox{\textwidth - 5 mm}{'.&bubbles(\@alphabet,\@opt).'}\end{enumerate}} \vskip -3 mm \strut ';
+		  $result.='\vskip -2 mm\parbox{\textwidth}{\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\parbox{\textwidth - 5 mm}{'.&bubbles(\@alphabet,\@opt).'}\end{enumerate}} \vskip -9 mm \strut ';
 	      }
 	      $displayoptionintex=1;
 	  } else {
@@ -435,7 +436,7 @@ sub displayfoils {
 		  }
 	      }
 	      if ($Apache::lonhomework::type eq 'exam') {
-		  $result.='\vskip -2 mm \parbox{\textwidth}{\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\parbox{\textwidth - 5 mm}{'.&bubbles(\@alphabet,\@opt).'}\end{enumerate}} \vskip -3 mm \strut ';
+		  $result.='\vskip -2 mm \parbox{\textwidth}{\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\parbox{\textwidth - 5 mm}{'.&bubbles(\@alphabet,\@opt).'}\end{enumerate}} \vskip -9 mm \strut ';
 	      }
 	  }
       }
@@ -474,7 +475,8 @@ sub webbubbles {
 	my $number_of_bubbles = $#opt + 1;
 	$result.= '<table border="1"><tr>';
 	for (my $ind=0;$ind<$number_of_bubbles;$ind++) {
-	   $result.='<td>'.$alphabet[$ind].': '.$opt[$ind].'</td>';
+	   $result.='<td><input type="radio" name="HWVAL'.$Apache::inputtags::response['-1'].
+                    '" value='.$opt[$ind].'>'.$alphabet[$ind].': '.$opt[$ind].'</td>';
 	}
 	$result.='</tr></table>';
 	return $result;
@@ -631,12 +633,28 @@ sub end_foil {
 	   && !&Apache::response::showallfoils() ) {
 	push @{ $Apache::response::conceptgroup{'names'} }, $name;
 	$Apache::response::conceptgroup{"$name.value"} = $value;
-	$Apache::response::conceptgroup{"$name.text"} = $text;
+	if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') {
+	    $Apache::response::conceptgroup{"$name.text"} = '\vskip 4 mm $\triangleright$ '.$text;
+	} else {
+	    if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') {
+		$Apache::response::conceptgroup{"$name.text"} = ' $\triangleright$ '.$text;
+	    } else {
+		$Apache::response::conceptgroup{"$name.text"} = $text;
+	    }
+	}
 	$Apache::response::conceptgroup{"$name.location"} = $location;
       } else {
 	push @{ $Apache::response::foilgroup{'names'} }, $name;
 	$Apache::response::foilgroup{"$name.value"} = $value;
-	$Apache::response::foilgroup{"$name.text"} = $text;
+	if ($Apache::lonhomework::type eq 'exam') {
+	    $Apache::response::foilgroup{"$name.text"} = '\vskip 5 mm $\triangleright$ '.$text;
+	} else {
+	    if ($target eq 'tex' and $Apache::lonhomework::type eq 'exam') {
+		$Apache::response::foilgroup{"$name.text"} = ' $\triangleright$ '.$text;
+	    } else {
+		$Apache::response::foilgroup{"$name.text"} = $text;
+	    }
+	}
 	$Apache::response::foilgroup{"$name.location"} = $location;
       }
     }