--- loncom/homework/bridgetask.pm 2005/08/15 19:41:43 1.42
+++ loncom/homework/bridgetask.pm 2005/09/14 18:25:40 1.47
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.42 2005/08/15 19:41:43 albertel Exp $
+# $Id: bridgetask.pm,v 1.47 2005/09/14 18:25:40 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 '.
''.
' | '.
''.
- ' '.
+ ' '.
' '.
' '.
' '.
@@ -1036,7 +1050,7 @@ sub get_instance {
$result.=' |
';
my (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser();
my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio';
- foreach my $partial_file (split(',',$Apache::lonhomework::history{"resource.$version.bridgetask.portfiles"})) {
+ 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.=' [-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:
-![]($url)
+
+
+
+ Student who should be logged in is: |
+ Name: | $name |
+ Student ID: | $env{'environment.id'} |
+ Usename | $user\@$domain |
+ ![]($url) |
+
+ |
+
ENDCHECKOUT
return $result;
|