--- loncom/homework/bridgetask.pm 2005/10/01 04:52:21 1.64
+++ loncom/homework/bridgetask.pm 2005/10/12 14:45:44 1.69
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.64 2005/10/01 04:52:21 albertel Exp $
+# $Id: bridgetask.pm,v 1.69 2005/10/12 14:45:44 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -395,12 +395,12 @@ sub start_Task {
$msg.='
'.&mt('Your submission is in the grading queue.').'
';
} elsif ($env{'form.donescreen'}) {
my $title=&Apache::lonnet::gettitle();
- my $files=$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'};
- $result.= $head_tag_start.''.$body_tag_start;
+ my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'});
+ my $files='';
$result.=<$title
Files submitted: $files
- You are now done with the Bridge Task
+ You are now done with this Bridge Task
Logout
Change to a different course
@@ -618,10 +618,7 @@ sub end_Task {
my ($version,$previous)=&get_version();
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
$target eq 'tex') {
- if (
- (($target eq 'web') && ($env{'request.state'} ne 'construct')) ||
- ($target eq 'answer') || ($target eq 'tex')
- ) {
+ if ($target eq 'web' || $target eq 'answer' || $target eq 'tex') {
if ($target eq 'web') {
if (&show_task($status,$previous)) {
$result.=&Apache::lonxml::endredirection();
@@ -1089,6 +1086,8 @@ sub queue_key_locked {
sub pick_from_queue_data {
my ($queue,$check_section,$queuedata,$cdom,$cnum)=@_;
foreach my $key (keys(%$queuedata)) {
+ if ($key =~ /\0locked$/) { next; }
+ if ($key =~ /\0timestamp$/) { next; }
my ($symb,$uname,$udom)=&decode_queue_key($key);
if ($check_section) {
my $section=&Apache::lonnet::getsection($uname,$udom);
@@ -1403,6 +1402,7 @@ sub get_instance {
$dim_info.='Question : you did not pass this '.$mandatory.' question
';
}
my $man_count=0;
+ my $man_passed=0;
my $opt_count=0;
my $opt_passed=0;
foreach my $id (@{$dimension{$instance.'.criterias'}}) {
@@ -1414,12 +1414,15 @@ sub get_instance {
}
} else {
$man_count++;
+ if ($Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"} eq 'pass') {
+ $man_passed++;
+ }
}
}
- my $opt_req=&Apache::lonxml::get_param('OptionalRequired',
- $parstack,$safeeval);
+ if ($man_passed eq $man_count) { $man_passed='all'; }
+ my $opt_req=$dimension{$instance.'.optionalrequired'};
if ($opt_req !~ /\S/) { $opt_req='0'; }
- $dim_info.="\n".&mt('You passed all of the mandatory components and [_1] of the [_2] optional components, of which you were required to pass [_3].',$opt_passed,$opt_count,$opt_req)."
\n";
+ $dim_info.="\n".&mt('You passed [_1] of the [_2] mandatory components and [_3] of the [_4] optional components, of which you were required to pass [_5].',$man_passed,$man_count,$opt_passed,$opt_count,$opt_req)."
\n";
my $internal_location=&internal_location($dim);
$result=~s/\Q$internal_location\E/$dim_info/;
@@ -1539,6 +1542,9 @@ sub get_instance {
$Apache::lonhomework::results{"resource.$version.$dim.status"}=
'pass';
}
+ } else {
+ # any other targets no output
+ undef($result);
}
return $result;
}