version 1.43, 2002/07/29 20:43:47
|
version 1.46, 2002/08/05 18:24:05
|
Line 184 sub displayallfoils {
|
Line 184 sub displayallfoils {
|
my $part=$Apache::inputtags::part; |
my $part=$Apache::inputtags::part; |
my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
my %lastresponse=&Apache::lonnet::str2hash($lastresponse); |
my %lastresponse=&Apache::lonnet::str2hash($lastresponse); |
&Apache::lonhomework::showhash(%lastresponse); |
if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/) || ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER')) { |
foreach my $name (@names) { |
foreach my $name (@names) { |
if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') { |
if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') { |
$result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\" "; |
$result.="<br />".$Apache::response::foilgroup{$name.'.value'}; |
if (defined($lastresponse{$name})) { $result .= 'checked="on"'; } |
if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { |
$result .= '>'.$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
$result.='<b>'; |
$temp++; |
} |
|
$result .= $Apache::response::foilgroup{$name.'.text'}; |
|
if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { |
|
$result.='</b>'; |
|
} |
|
} |
|
} |
|
} else { |
|
foreach my $name (@names) { |
|
if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') { |
|
$result.="<br /><input type=\"radio\" name=\"HWVAL$Apache::inputtags::response['-1']\" value=\"$temp\" "; |
|
if (defined($lastresponse{$name})) { $result .= 'checked="on"'; } |
|
$result .= '>'.$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
|
$temp++; |
|
} |
} |
} |
} |
} |
return $result; |
return $result; |
Line 242 sub displayfoils {
|
Line 256 sub displayfoils {
|
my $result; |
my $result; |
|
|
my @whichfoils=&whichfoils($max,$answer); |
my @whichfoils=&whichfoils($max,$answer); |
if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ ) { |
if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ || ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER')) { |
foreach my $name (@whichfoils) { |
foreach my $name (@whichfoils) { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$result.="<br />"; |
$result.="<br />"; |
|
} else { |
|
$result.='\vskip 0 mm \item '; |
} |
} |
if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { |
if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { |
$result.='Correct'; |
if ($target ne 'tex') { $result.='Correct:<b>'; } else { $result.='Correct: ';} |
|
} else { |
|
$result.='Incorrect:'; |
|
} |
|
if ($target ne 'tex') { |
|
$result.=$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
} else { |
} else { |
$result.='Incorrect'; |
$result.=$Apache::response::foilgroup{$name.'.text'}; |
|
} |
|
if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { |
|
if ($target ne 'tex') { $result.='</b>';} |
} |
} |
$result.=":".$Apache::response::foilgroup{$name.'.text'}."</input>\n"; |
|
} |
} |
} else { |
} else { |
my $temp=0; |
my $temp=0; |
Line 266 sub displayfoils {
|
Line 289 sub displayfoils {
|
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"; |
} else { |
} else { |
$result .= $Apache::response::foilgroup{$name.'.text'}; |
$result .= '\item '.$Apache::response::foilgroup{$name.'.text'}; |
} |
} |
$temp++; |
$temp++; |
} |
} |
} |
} |
if ($target ne 'tex') { $result.="<br />"; } |
if ($target ne 'tex') { $result.="<br />"; } else { $result.='\vskip 0 mm '; } |
return $result; |
return $result; |
} |
} |
|
|
Line 336 sub start_foil {
|
Line 359 sub start_foil {
|
my $result=''; |
my $result=''; |
if ($target eq 'web' || $target eq 'tex') { |
if ($target eq 'web' || $target eq 'tex') { |
&Apache::lonxml::startredirection; |
&Apache::lonxml::startredirection; |
if ($target eq 'tex') { |
|
$result .= '\item '; |
|
} |
|
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result=&Apache::edit::tag_start($target,$token); |
$result=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::text_arg('Name:','name',$token); |
$result.=&Apache::edit::text_arg('Name:','name',$token); |