version 1.79, 2003/07/01 20:12:55
|
version 1.85, 2003/09/09 13:36:11
|
Line 152 sub end_foilgroup {
|
Line 152 sub end_foilgroup {
|
|
|
my $result; |
my $result; |
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') { |
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') { |
|
my $tex_option_switch=&Apache::lonxml::get_param('texoptions',$parstack,$safeeval); |
my $name; |
my $name; |
my @opt; |
my @opt; |
eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval); |
eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval); |
|
if ($target eq 'tex' && $tex_option_switch eq 'nochoice') {@opt=();} |
&Apache::lonxml::debug("Options are $#opt"); |
&Apache::lonxml::debug("Options are $#opt"); |
my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2'); |
my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2'); |
my $randomize = &Apache::lonxml::get_param('randomize',$parstack, |
my $randomize = &Apache::lonxml::get_param('randomize',$parstack, |
Line 326 sub displayfoils {
|
Line 328 sub displayfoils {
|
$result.=$text."\n"; |
$result.=$text."\n"; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$Apache::response::foilgroup{$name.'.text'}=~s/\\item//; |
$Apache::response::foilgroup{$name.'.text'}=~s/\\item//; |
$result .='\item \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'. |
if ($max>1) {$result .='\item ';} |
|
$result .=' \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'. |
":".$Apache::response::foilgroup{$name.'.text'}."\n"; |
":".$Apache::response::foilgroup{$name.'.text'}."\n"; |
} |
} |
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
Line 434 sub displayfoils {
|
Line 437 sub displayfoils {
|
sub optionlist_correction { |
sub optionlist_correction { |
|
|
my $texoptionlist = shift; |
my $texoptionlist = shift; |
$texoptionlist =~ s/<option><\/option>/\\item \[\] Possible answers are:/; |
if ($texoptionlist=~/<option selected/ or $texoptionlist=~/<option>[^<]+<\/option>/) { |
$texoptionlist =~ s/<option>/\{\\bf /g; |
$texoptionlist =~ s/<option><\/option>/\\item \[\] Choices: /; |
$texoptionlist =~ s/<option selected="on">/\{\\bf /g; |
$texoptionlist =~ s/<option>/\{\\bf /g; |
$texoptionlist =~ s/<\/option>/\},/g; |
$texoptionlist =~ s/<option selected="on">/\{\\bf /g; |
$texoptionlist =~ s/,$/\./g; |
$texoptionlist =~ s/<\/option>/\},/g; |
$texoptionlist =~ s/>/\$>\$/g; |
$texoptionlist =~ s/,$/\./g; |
$texoptionlist =~ s/</\$<\$/g; |
$texoptionlist =~ s/>/\$>\$/g; |
$texoptionlist =~ s/=/\$=\$/g; |
$texoptionlist =~ s/</\$<\$/g; |
$texoptionlist =~ s/\^(\d+)/<m>\$$1\$<\/m>/g; |
$texoptionlist =~ s/=/\$=\$/g; |
|
$texoptionlist =~ s/\^(\d+)/<m>\$$1\$<\/m>/g; |
|
} else { |
|
$texoptionlist =~ s/<option><\/option>/\\item \[\] \\vskip -5 mm/; |
|
} |
return $texoptionlist; |
return $texoptionlist; |
} |
} |
|
|