version 1.80, 2003/07/25 18:46:19
|
version 1.84, 2003/08/01 19:04:06
|
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('texout',$parstack,$safeeval); |
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 'nooptions') {@opt=();} |
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 328 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 436 sub displayfoils {
|
Line 437 sub displayfoils {
|
sub optionlist_correction { |
sub optionlist_correction { |
|
|
my $texoptionlist = shift; |
my $texoptionlist = shift; |
if ($texoptionlist=~/<option selected/) { |
if ($texoptionlist=~/<option selected/ or $texoptionlist=~/<option>[^<]+<\/option>/) { |
$texoptionlist =~ s/<option><\/option>/\\item \[\] Possible answers are:/; |
$texoptionlist =~ s/<option><\/option>/\\item \[\] Choose from: /; |
$texoptionlist =~ s/<option>/\{\\bf /g; |
$texoptionlist =~ s/<option>/\{\\bf /g; |
$texoptionlist =~ s/<option selected="on">/\{\\bf /g; |
$texoptionlist =~ s/<option selected="on">/\{\\bf /g; |
$texoptionlist =~ s/<\/option>/\},/g; |
$texoptionlist =~ s/<\/option>/\},/g; |