version 1.161, 2006/06/01 19:31:12
|
version 1.162, 2006/06/06 21:05:56
|
Line 43 use LONCAPA;
|
Line 43 use LONCAPA;
|
|
|
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','QuestionText','Instance','InstanceText','Criteria','ClosingParagraph')); |
&Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','QuestionText','Setup','Instance','InstanceText','Criteria','ClosingParagraph')); |
} |
} |
|
|
sub initialize_bridgetask { |
sub initialize_bridgetask { |
Line 1791 sub get_id {
|
Line 1791 sub get_id {
|
} |
} |
|
|
my %dimension; |
my %dimension; |
|
sub start_Setup { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
undef(%dimension); |
|
my $dim_id=&get_id($parstack,$safeeval); |
|
$Apache::bridgetask::dimension=$dim_id; |
|
undef(@Apache::bridgetask::instance); |
|
&Apache::lonxml::startredirection(); |
|
return &internal_location($dim_id); |
|
} |
sub start_Question { return &start_Dimension(@_); } |
sub start_Question { return &start_Dimension(@_); } |
sub start_Dimension { |
sub start_Dimension { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
Line 2057 sub get_instance {
|
Line 2066 sub get_instance {
|
} else { |
} else { |
# any other targets no output |
# any other targets no output |
undef($result); |
undef($result); |
|
} |
|
return $result; |
|
} |
|
|
|
sub end_Setup { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
my $result=&Apache::lonxml::endredirection(); |
|
my $dim=&get_id($parstack,$safeeval); |
|
my $instance=&get_instance($dim); |
|
my $version=&get_version(); |
|
if ($target eq 'web') { |
|
@Apache::scripttag::parser_env = @_; |
|
$result.=&Apache::scripttag::xmlparse($dimension{'intro'}); |
|
my @instances = $instance; |
|
if (&Apache::response::showallfoils()) { |
|
@instances = @{$dimension{'instances'}}; |
|
} |
|
foreach my $instance (@instances) { |
|
@Apache::scripttag::parser_env = @_; |
|
$result.=&Apache::scripttag::xmlparse($dimension{$instance.'.text'}); |
|
@Apache::scripttag::parser_env = @_; |
|
$result.=&Apache::scripttag::xmlparse($dimension{'questiontext'}); |
|
} |
|
} elsif ($target eq 'webgrade' |
|
|| $target eq 'grade' && $env{'form.webgrade'}) { |
|
# in case of any side effects that we need |
|
@Apache::scripttag::parser_env = @_; |
|
&Apache::scripttag::xmlparse($dimension{'intro'}); |
|
@Apache::scripttag::parser_env = @_; |
|
&Apache::scripttag::xmlparse($dimension{$instance.'.text'}); |
|
@Apache::scripttag::parser_env = @_; |
|
&Apache::scripttag::xmlparse($dimension{'questiontext'}); |
|
} else { |
|
# any other targets no output |
|
undef($result); |
} |
} |
return $result; |
return $result; |
} |
} |