version 1.8, 2001/01/15 21:44:21
|
version 1.10, 2001/01/19 21:44:12
|
Line 1
|
Line 1
|
# The LearningOnline Network with CAPA |
# The LearningOnline Network with CAPA |
# mutliple choice style responses |
# mutliple choice style responses |
|
|
# 11/23,11/24,11/28 Gerd Kortemeyer |
|
|
|
package Apache::radiobuttonresponse; |
package Apache::radiobuttonresponse; |
use strict; |
use strict; |
|
|
Line 39 sub setrandomnumber {
|
Line 37 sub setrandomnumber {
|
return ''; |
return ''; |
} |
} |
|
|
#FIXME needs to stablely do random picks |
|
sub end_foilgroup { |
sub end_foilgroup { |
my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; |
|
|
Line 124 sub displayfoils {
|
Line 121 sub displayfoils {
|
push (@whichfalse,$afalse); |
push (@whichfalse,$afalse); |
} |
} |
splice(@whichfalse,$answer,0,$truelist[$whichtrue]); |
splice(@whichfalse,$answer,0,$truelist[$whichtrue]); |
my $temp=0; |
|
&Apache::lonxml::debug("the true statement is $answer"); |
&Apache::lonxml::debug("the true statement is $answer"); |
foreach $name (@whichfalse) { |
if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ ) { |
$result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\">".$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
foreach $name (@whichfalse) { |
$temp++; |
$result.="<br />".$Apache::response::foilgroup{$name.'.value'}. |
|
":".$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
|
} |
|
} else { |
|
my $temp=0; |
|
foreach $name (@whichfalse) { |
|
$result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\">".$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
|
$temp++; |
|
} |
} |
} |
return $result."<br />"; |
return $result."<br />"; |
} |
} |