--- loncom/homework/bridgetask.pm 2005/09/09 18:45:56 1.46
+++ loncom/homework/bridgetask.pm 2005/09/14 21:03:48 1.48
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.46 2005/09/09 18:45:56 albertel Exp $
+# $Id: bridgetask.pm,v 1.48 2005/09/14 21:03:48 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -987,7 +987,10 @@ sub get_instance {
my $instance=&get_instance();
my $version=&get_version();
if ($target eq 'web') {
- $result=$dimension{'intro'}.$dimension{$instance.'.text'};
+ @Apache::scripttag::parser_env = @_;
+ $result.=&Apache::scripttag::xmlparse($dimension{'intro'});
+ @Apache::scripttag::parser_env = @_;
+ $result.=&Apache::scripttag::xmlparse($dimension{$instance.'.text'});
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'pass' ||
$Apache::lonhomework::history{"resource.$version.status"} eq 'fail') {
foreach my $id (@{$dimension{$instance.'.criterias'}}) {
@@ -1010,20 +1013,28 @@ sub get_instance {
}
}
} elsif ($target eq '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'});
foreach my $id (@{$dimension{$instance.'.criterias'}}) {
my $link='criteria_'.$instance.'_'.$id;
my $status=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"};
$result.='
'.
''.
''.
- ' '.
+ ' '.
#$dimension{$instance.'.criteria.'.$id}.
' | '.
'Additional Comment for Student '.
''.
' | '.
''.
- ' '.
+ ' '.
' '.
' '.
' '.
@@ -1042,9 +1053,9 @@ sub get_instance {
foreach my $partial_file (split(',',$Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"})) {
my $file=$file_url.$partial_file;
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file);
- $result.='![]('.
+ $result.='<nobr><a href=) '.$file.
- '';
+ ' ';
}
$result.=' |
';
$last_link=$link;
@@ -1067,7 +1078,7 @@ sub get_instance {
} elsif ($status eq 'ungraded') {
$ungraded++;
} else {
- &Apache::lonxml::error("got weird status --$status--");
+ $ungraded++;
}
}
if ($optional_passed < $dimension{$instance.'.optionalrequired'}) {
@@ -1096,22 +1107,18 @@ sub start_IntroParagraph {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $result;
if ($target eq 'web' || $target eq 'webgrade') {
- if ($tagstack->[-2] eq 'Dimension' || $target eq 'webgrade') {
- &Apache::lonxml::startredirection();
+ if ($tagstack->[-2] eq 'Dimension') {
+ $dimension{'intro'}=&Apache::lonxml::get_all_text('/introparagraph',$parser);
+
+ } elsif ($target eq 'webgrade') {
+ &Apache::lonxml::get_all_text('/introparagraph',$parser);
}
+
}
return $result;
}
sub end_IntroParagraph {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- my $result;
- if ($target eq 'web' || $target eq 'webgrade') {
- if ($tagstack->[-2] eq 'Dimension' || $target eq 'webgrade') {
- $dimension{'intro'}=&Apache::lonxml::endredirection();
- }
- }
- return $result;
}
sub start_Instance {
@@ -1126,40 +1133,27 @@ sub start_Instance {
}
sub end_Instance {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- return '';
}
sub start_InstanceText {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my $instance_id=$Apache::bridgetask::instance[-1];
+ my $text=&Apache::lonxml::get_all_text('/instancetext',$parser);
if ($target eq 'web' || $target eq 'webgrade') {
- &Apache::lonxml::startredirection();
+ $dimension{$instance_id.'.text'}=$text;
}
return '';
}
sub end_InstanceText {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- my $instance_id=$Apache::bridgetask::instance[-1];
- if ($target eq 'web' || $target eq 'webgrade') {
- $dimension{$instance_id.'.text'}=&Apache::lonxml::endredirection();
- }
return '';
}
sub start_Criteria {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') {
- &Apache::lonxml::startredirection();
- }
- return '';
-}
-
-sub end_Criteria {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $instance_id=$Apache::bridgetask::instance[-1];
+ my $criteria=&Apache::lonxml::get_all_text('/criteria',$parser);
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') {
- my $criteria=&Apache::lonxml::endredirection();
my $id=&get_id($parstack,$safeeval);
$dimension{$instance_id.'.criteria.'.$id}=$criteria;
$dimension{$instance_id.'.criteria.'.$id.'.mandatory'}=
@@ -1169,6 +1163,9 @@ sub end_Criteria {
return '';
}
+sub end_Criteria {
+}
+
sub proctor_validation_screen {
my ($slot) = @_;
my (undef,undef,$domain,$user) = &Apache::lonxml::whichuser();
@@ -1180,6 +1177,7 @@ sub proctor_validation_screen {
$msg=''.&mt("Failed to authenticate the proctor.")
.'
';
}
+ if (!$env{'form.proctordomain'}) { $env{'form.proctordomain'}=$domain; }
my $result= (<Proctor Validation
Your room's proctor needs to validate your access to this resource.