version 1.54, 2002/10/02 18:12:51
|
version 1.55, 2002/10/14 20:33:57
|
Line 102 sub storesurvey {
|
Line 102 sub storesurvey {
|
|
|
sub grade_response { |
sub grade_response { |
my ($max,$randomize)=@_; |
my ($max,$randomize)=@_; |
|
#keep the random numbers the same must always call this |
|
my ($answer,@whichfoils)=&whichfoils($max,$randomize); |
if (!defined($ENV{'form.submitted'})) { return; } |
if (!defined($ENV{'form.submitted'})) { return; } |
my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']}; |
my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']}; |
if ( $response !~ /[0-9]+/) { return; } |
if ( $response !~ /[0-9]+/) { return; } |
my $part=$Apache::inputtags::part; |
my $part=$Apache::inputtags::part; |
my $id = $Apache::inputtags::response['-1']; |
my $id = $Apache::inputtags::response['-1']; |
my ($answer,@whichfoils)=&whichfoils($max,$randomize); |
|
my %responsehash; |
my %responsehash; |
$responsehash{$whichfoils[$response]}=$response; |
$responsehash{$whichfoils[$response]}=$response; |
my $responsestr=&Apache::lonnet::hash2str(%responsehash); |
my $responsestr=&Apache::lonnet::hash2str(%responsehash); |
Line 369 sub displayfoils {
|
Line 370 sub displayfoils {
|
$result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\" "; |
$result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\" "; |
if (defined($lastresponse{$name})) { $result .= 'checked="on"'; } |
if (defined($lastresponse{$name})) { $result .= 'checked="on"'; } |
$result .= '>'.$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
$result .= '>'.$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
$result .= '<table border="1"><tr><td>A: Correct</td><td>B: Incorrect</td></tr></table>'; |
if ($Apache::lonhomework::type eq 'exam') { |
|
$result .= '<table border="1"><tr><td>A: Correct</td><td>B: Incorrect</td></tr></table>'; |
|
} |
} else { |
} else { |
$result .= '\item '.$Apache::response::foilgroup{$name.'.text'}; |
$result .= '\item '.$Apache::response::foilgroup{$name.'.text'}; |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |