version 1.18, 2001/05/31 22:34:33
|
version 1.23, 2001/08/13 20:51:39
|
Line 10 sub BEGIN {
|
Line 10 sub BEGIN {
|
} |
} |
|
|
sub start_radiobuttonresponse { |
sub start_radiobuttonresponse { |
my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
#when in a radiobutton response use these |
#when in a radiobutton response use these |
&Apache::lonxml::register('Apache::radiobuttonresponse',('foilgroup','foil','conceptgroup')); |
&Apache::lonxml::register('Apache::radiobuttonresponse',('foilgroup','foil','conceptgroup')); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
my $id = &Apache::response::start_response($parstack,$safeeval); |
Line 45 sub storesurvey {
|
Line 45 sub storesurvey {
|
} |
} |
|
|
sub end_foilgroup { |
sub end_foilgroup { |
my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
|
my $result; |
my $result; |
if ($target ne 'meta') { |
if ($target eq 'grade' || $target eq 'web') { |
my $rrargs =''; |
my $style = &Apache::lonxml::get_param('style',$parstack,$safeeval,'-2'); |
if ( $#$parstack > 0 ) { $rrargs=$$parstack['-2']; } |
|
my $style = &Apache::run::run("{$rrargs;".'return $style}',$safeeval); |
|
if ( $style eq 'survey' ) { |
if ( $style eq 'survey' ) { |
if ($target eq 'web') { |
if ($target eq 'web') { |
$result=&displayallfoils(); |
$result=&displayallfoils(); |
Line 90 sub end_foilgroup {
|
Line 88 sub end_foilgroup {
|
|
|
sub getfoilcounts { |
sub getfoilcounts { |
my ($parstack,$safeeval)=@_; |
my ($parstack,$safeeval)=@_; |
my $rrargs =''; |
my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2'); |
if ( $#$parstack > 0 ) { $rrargs=$$parstack['-2']; } |
|
my $max = &Apache::run::run("{$rrargs;".'return $max}',$safeeval); |
|
my @names = @{ $Apache::response::foilgroup{'names'} }; |
my @names = @{ $Apache::response::foilgroup{'names'} }; |
my $truecnt=0; |
my $truecnt=0; |
my $falsecnt=0; |
my $falsecnt=0; |
Line 191 sub start_conceptgroup {
|
Line 187 sub start_conceptgroup {
|
} |
} |
|
|
sub end_conceptgroup { |
sub end_conceptgroup { |
my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
$Apache::radiobuttonresponse::conceptgroup=0; |
$Apache::radiobuttonresponse::conceptgroup=0; |
if ($target eq 'web' || $target eq 'grade') { |
if ($target eq 'web' || $target eq 'grade') { |
my @names = @{ $Apache::response::conceptgroup{'names'} }; |
my @names = @{ $Apache::response::conceptgroup{'names'} }; |
Line 200 sub end_conceptgroup {
|
Line 196 sub end_conceptgroup {
|
push @{ $Apache::response::foilgroup{'names'} }, $name; |
push @{ $Apache::response::foilgroup{'names'} }, $name; |
$Apache::response::foilgroup{"$name.text"} = $Apache::response::conceptgroup{"$name.text"}; |
$Apache::response::foilgroup{"$name.text"} = $Apache::response::conceptgroup{"$name.text"}; |
$Apache::response::foilgroup{"$name.value"} = $Apache::response::conceptgroup{"$name.value"}; |
$Apache::response::foilgroup{"$name.value"} = $Apache::response::conceptgroup{"$name.value"}; |
my $args; |
my $concept = &Apache::lonxml::get_param('concept',$parstack,$safeeval); |
if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } |
|
my $concept = &Apache::run::run("{$args;".'return $concept}',$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"); |
} |
} |
Line 215 sub start_foil {
|
Line 209 sub start_foil {
|
} |
} |
|
|
sub end_foil { |
sub end_foil { |
my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
my $text=''; |
my $text=''; |
if ($target eq 'web') { $text=&Apache::lonxml::endredirection; } |
if ($target eq 'web') { $text=&Apache::lonxml::endredirection; } |
if ($target eq 'web' || $target eq 'grade') { |
if ($target eq 'web' || $target eq 'grade') { |
my $args =''; |
my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval); |
if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } |
|
my $value = &Apache::run::run("{$args;".'return $value}',$safeeval); |
|
if ($value ne 'unused') { |
if ($value ne 'unused') { |
my $name = &Apache::run::run("{$args;".'return $name}',$safeeval); |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
if ( $Apache::radiobuttonresponse::conceptgroup ) { |
if ( $Apache::radiobuttonresponse::conceptgroup ) { |
push @{ $Apache::response::conceptgroup{'names'} }, $name; |
push @{ $Apache::response::conceptgroup{'names'} }, $name; |
$Apache::response::conceptgroup{"$name.value"} = $value; |
$Apache::response::conceptgroup{"$name.value"} = $value; |