--- loncom/homework/bridgetask.pm 2005/09/07 19:54:54 1.43
+++ 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.43 2005/09/07 19:54:54 albertel Exp $
+# $Id: bridgetask.pm,v 1.48 2005/09/14 21:03:48 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -462,7 +462,10 @@ sub end_Task {
$result.="\n".'
'.
&Apache::inputtags::file_selector("$version.0",
"bridgetask","*",
- 'portfolioonly').
+ 'portfolioonly',
+ '
+'.&mt('Submit Portfolio Files for Grading').'
+'.&mt('Indicate the files from your portfolio to be evaluated in grading this task.').'
').
"
";
$result.=&Apache::inputtags::gradestatus('0');
}
@@ -984,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'}}) {
@@ -1007,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 '.
''.
' | '.
''.
- ' '.
+ ' '.
' '.
' '.
' '.
@@ -1039,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.=' '.$file.
- '';
+ ' ';
}
$result.=' |
';
$last_link=$link;
@@ -1064,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'}) {
@@ -1093,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 {
@@ -1123,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'}=
@@ -1166,17 +1163,21 @@ sub end_Criteria {
return '';
}
+sub end_Criteria {
+}
+
sub proctor_validation_screen {
my ($slot) = @_;
my (undef,undef,$domain,$user) = &Apache::lonxml::whichuser();
my $url=&Apache::lonnet::studentphoto($domain,$user,'jpg');
- $user=$env{'form.proctorname'};
- if ($env{'form.proctordomain'}) { $domain=$env{'form.proctordomain'}; }
+ my $name=&Apache::loncommon::plainname($user,$domain);
+
my $msg;
if ($env{'form.proctorpassword'}) {
$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.
@@ -1185,13 +1186,22 @@ sub proctor_validation_screen {
-Student who should be logged in is:
-
+
+
+
+ Student who should be logged in is: |
+ Name: | $name |
+ Student ID: | $env{'environment.id'} |
+ Usename | $user\@$domain |
+  |
+
+ |
+
ENDCHECKOUT
return $result;