--- loncom/homework/bridgetask.pm 2006/06/01 19:20:56 1.159
+++ loncom/homework/bridgetask.pm 2006/06/13 15:45:54 1.168
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.159 2006/06/01 19:20:56 albertel Exp $
+# $Id: bridgetask.pm,v 1.168 2006/06/13 15:45:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,23 +43,23 @@ use LONCAPA;
BEGIN {
- &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','Instance','InstanceText','Criteria','ClosingParagraph'));
+ &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','QuestionText','Setup','Instance','InstanceText','Criteria','ClosingParagraph'));
}
+my %dimension_info;
sub initialize_bridgetask {
# id of current Dimension, 0 means that no dimension is current
# (inside Submitted non-existant file $file Submitted file $file '.&mt('Message sent to user: [_1]',
+ $message_status).' '.&mt('Message sent to instructor: [_1]',
+ $comment_status).' Files submitted: $files You are now done with this Bridge Task Files submitted: $files You are now done with this Bridge Task '.$file.
- '
'.$file.
+ '
'.
+ $msg,$user,$domain);
+ $comment_status = '
+
+
+$message_status
+$comment_status
+DONESCREEN
+
+}
+
sub start_Task {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
@@ -455,8 +525,10 @@ sub start_Task {
if ($target eq 'web' && $env{'request.state'} eq 'construct') {
$form_tag_start.=&Apache::structuretags::problem_web_to_edit_header($env{'form.rndseed'});
}
- if ($target eq 'web' || ($target eq 'grade' && !$env{'form.webgrade'}) || $target eq 'answer' ||
- $target eq 'tex') {
+ if ($target eq 'web'
+ || ($target eq 'grade' && !$env{'form.webgrade'})
+ || $target eq 'answer'
+ || $target eq 'tex') {
my ($version,$previous)=&get_version();
($status,$accessmsg,my $slot_name,$slot) =
&Apache::lonhomework::check_slot_access('0','Task');
@@ -493,30 +565,7 @@ sub start_Task {
} elsif ($status eq 'WAITING_FOR_GRADE') {
$msg.=''.&mt('Your submission is in the grading queue.').'
';
} elsif ($env{'form.donescreen'}) {
- my $title=&Apache::lonnet::gettitle();
- my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'});
- my (undef,undef,$domain,$user)=
- &Apache::lonxml::whichuser();
- my $files = '';
- foreach my $file (@files) {
- my $url="/uploaded/$domain/$user/portfolio$file";
- if (! &Apache::lonnet::stat_file($url)) {
- $file = &mt(' Nonexistant file: [_1]',$file);
- } else {
- $file = ''.$file.'';
- }
- $files .= '
';
-
- $result.=<
-
-
-DONESCREEN
+ $result .= &done_screen($version);
} elsif ($status ne 'NOT_YET_VIEWED') {
$msg.=''.&mt('Not open to be viewed').'
';
}
@@ -592,6 +641,17 @@ DONESCREEN
&mt('Return to resource').'
'; @Apache::scripttag::parser_env = @_; - $result.=&Apache::scripttag::xmlparse($dimension{'criteria.'.$id}); + $result.=&Apache::scripttag::xmlparse($dimension_info{$dim}{'criteria.'.$id}); $result.='
'.$status_display.'
'; if ($Apache::lonhomework::history{"resource.$version.0.$dim.$id.comment"}) { $result.=''.&mt('Comment: [_1]',$Apache::lonhomework::history{"resource.$version.0.$dim.$id.comment"}).'
'; @@ -1949,19 +2087,21 @@ 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::xmlparse($dimension_info{$dim}{'intro'}); @Apache::scripttag::parser_env = @_; - &Apache::scripttag::xmlparse($dimension{$instance.'.text'}); - foreach my $id (@{$dimension{$instance.'.criterias'}}, - @{$dimension{'criterias'}} ) { + &Apache::scripttag::xmlparse($dimension_info{$dim}{$instance.'.text'}); + @Apache::scripttag::parser_env = @_; + &Apache::scripttag::xmlparse($dimension_info{$dim}{'questiontext'}); + foreach my $id (@{$dimension_info{$dim}{$instance.'.criterias'}}, + @{$dimension_info{$dim}{'criterias'}} ) { my $link=&link($id); my $status=$Apache::lonhomework::history{"resource.$version.0.$dim.$id.status"}; $result.='