--- loncom/homework/optionresponse.pm 2003/03/26 18:42:29 1.69
+++ loncom/homework/optionresponse.pm 2003/04/07 22:28:08 1.74
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: optionresponse.pm,v 1.69 2003/03/26 18:42:29 sakharuk Exp $
+# $Id: optionresponse.pm,v 1.74 2003/04/07 22:28:08 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,8 +31,6 @@ package Apache::optionresponse;
use strict;
use Apache::response;
-my $flag_for_exam_printing = 1;
-
BEGIN {
&Apache::lonxml::register('Apache::optionresponse',('optionresponse'));
}
@@ -187,7 +185,10 @@ sub end_foilgroup {
my $wrong=0;
my $ignored=0;
foreach $name (@whichopt) {
- my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1'].":$temp"};
+ my $response=&Apache::response::getresponse($temp);
+ if ($ENV{'form.submitted'} eq 'scantron') {
+ $response = $opt[$response];
+ }
$responsehash{$name}=$response;
if ( $response =~ /[^\s]/) {
my $value=$Apache::response::foilgroup{$name.'.value'};
@@ -229,10 +230,13 @@ sub end_foilgroup {
&Apache::response::handle_previous(\%previous,$ad);
}
}
+ &Apache::lonxml::increment_counter(&getfoilcounts($max));
} elsif ($target eq 'edit') {
$result.=&Apache::edit::end_table();
- }
- if ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {$result .= '\end{enumerate}';}
+ }
+ if ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {
+ $result .= '\end{enumerate}';
+ }
return $result;
}
@@ -318,8 +322,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];
@@ -385,16 +388,18 @@ sub displayfoils {
}
}
if ($target ne 'tex') {
- $optionlist='\n";
+ }
my $text=$Apache::response::foilgroup{$name.'.text'};
- if (!($text=~s|
'.$alphabet[$ind].': '.$opt[$ind].' | '; + $result.=''.$alphabet[$ind].': '.$opt[$ind].' | '; } $result.='