version 1.55, 2002/10/14 20:33:57
|
version 1.58, 2002/10/25 19:02:38
|
Line 42 sub start_radiobuttonresponse {
|
Line 42 sub start_radiobuttonresponse {
|
&Apache::lonxml::register('Apache::radiobuttonresponse',('foilgroup','foil','conceptgroup')); |
&Apache::lonxml::register('Apache::radiobuttonresponse',('foilgroup','foil','conceptgroup')); |
push (@Apache::lonxml::namespace,'radiobuttonresponse'); |
push (@Apache::lonxml::namespace,'radiobuttonresponse'); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
|
%Apache::hint::radiobutton=(); |
if ($target eq 'meta') { |
if ($target eq 'meta') { |
$result=&Apache::response::meta_package_write('radiobuttonresponse'); |
$result=&Apache::response::meta_package_write('radiobuttonresponse'); |
} elsif ($target eq 'edit' ) { |
} elsif ($target eq 'edit' ) { |
Line 79 sub end_radiobuttonresponse {
|
Line 80 sub end_radiobuttonresponse {
|
|
|
%Apache::response::foilgroup=(); |
%Apache::response::foilgroup=(); |
sub start_foilgroup { |
sub start_foilgroup { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
my $result; |
%Apache::response::foilgroup=(); |
%Apache::response::foilgroup=(); |
$Apache::radiobuttonresponse::conceptgroup=0; |
$Apache::radiobuttonresponse::conceptgroup=0; |
&Apache::response::setrandomnumber(); |
&Apache::response::setrandomnumber(); |
return ''; |
if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') { |
|
$result.='\item[\textbf{'.$Apache::lonxml::counter.'}.]'; |
|
&Apache::lonxml::increment_counter(); |
|
} |
|
return $result; |
} |
} |
|
|
sub storesurvey { |
sub storesurvey { |
Line 360 sub displayfoils {
|
Line 367 sub displayfoils {
|
} |
} |
} |
} |
} else { |
} else { |
|
my @alphabet = ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); |
|
my $i = 0; |
my $temp=0; |
my $temp=0; |
my $id=$Apache::inputtags::response['-1']; |
my $id=$Apache::inputtags::response['-1']; |
my $part=$Apache::inputtags::part; |
my $part=$Apache::inputtags::part; |
Line 374 sub displayfoils {
|
Line 383 sub displayfoils {
|
$result .= '<table border="1"><tr><td>A: Correct</td><td>B: Incorrect</td></tr></table>'; |
$result .= '<table border="1"><tr><td>A: Correct</td><td>B: Incorrect</td></tr></table>'; |
} |
} |
} else { |
} else { |
$result .= '\item '.$Apache::response::foilgroup{$name.'.text'}; |
|
if ($Apache::lonhomework::type eq 'exam') { |
if ($Apache::lonhomework::type eq 'exam') { |
$result.= '\vskip 2 mm \noindent \begin{tabular}{|lr|lr|}\hline '; |
$result .= '{\small \textbf{'.$alphabet[$i].'}}$\bigcirc$'.$Apache::response::foilgroup{$name.'.text'}.'\\\\'; #' stupid emacs |
$result.= 'A: & Correct & B: & Incorrect'; |
$i++; |
$result.='\\\\\hline\end{tabular}\vskip 0 mm '; |
} else { |
|
$result .= '\item '.$Apache::response::foilgroup{$name.'.text'}; |
} |
} |
} |
} |
$temp++; |
$temp++; |
Line 433 sub end_conceptgroup {
|
Line 442 sub end_conceptgroup {
|
my $concept = &Apache::lonxml::get_param('concept',$parstack,$safeeval); |
my $concept = &Apache::lonxml::get_param('concept',$parstack,$safeeval); |
$Apache::response::foilgroup{"$name.concept"} = $concept; |
$Apache::response::foilgroup{"$name.concept"} = $concept; |
&Apache::lonxml::debug("Selecting $name in $concept"); |
&Apache::lonxml::debug("Selecting $name in $concept"); |
|
my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]"; |
|
push(@{ $Apache::hint::radiobutton{"$part_id.concepts"} },$concept); |
|
$Apache::hint::radiobutton{"$part_id.concept.$concept"}= |
|
$Apache::response::conceptgroup{'names'}; |
} |
} |
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result=&Apache::edit::end_table(); |
$result=&Apache::edit::end_table(); |