version 1.160, 2006/06/01 19:22:29
|
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 365 sub file_list {
|
Line 365 sub file_list {
|
my $file=$file_url.$partial_file; |
my $file=$file_url.$partial_file; |
$file=~s|/+|/|g; |
$file=~s|/+|/|g; |
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file); |
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file); |
$file_list.='<li><nobr><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'. |
$file_list.='<li><span style="white-space: nowrap;"><a href="'.$file.'?rawmode=1" target="lonGRDs"><img src="'. |
&Apache::loncommon::icon($file).'" border="0"> '.$file. |
&Apache::loncommon::icon($file).'" alt="file icon" border="0" /> '.$file. |
'</a></nobr></li>'."\n"; |
'</a></span></li>'."\n"; |
} |
} |
$file_list.="</ul>\n"; |
$file_list.="</ul>\n"; |
return $file_list; |
return $file_list; |
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; |
} |
} |