\n";
+
+ my %lt=&Apache::lonlocal::texthash('done' => 'Done',
+ 'stop' => 'Stop',
+ );
+
+ my $result=<
+
+
+ $file_list
+
+INFO
+ return $result;
+}
+
sub start_Task {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my ($status,$accessmsg,$slot);
if ($target ne 'webgrade') {
+ &Apache::structuretags::init_problem_globals('Task');
&Apache::structuretags::initialize_storage();
&Apache::lonhomework::showhash(%Apache::lonhomework::history);
+ if ($env{'request.state'} eq 'construct') {
+ &Apache::structuretags::setup_rndseed($safeeval);
+ }
}
$Apache::lonhomework::parsing_a_task=1;
@@ -348,7 +405,7 @@ sub start_Task {
my ($result,$head_tag_start,$body_tag_start,$form_tag_start)=
&Apache::structuretags::page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);
- if ($target eq 'web') {
+ if ($target eq 'web' && $env{'request.state'} ne 'construct') {
if ($Apache::lonhomework::modifygrades) {
$body_tag_start.='';
+ $result.=<
+
+
+
+DONEBUTTON
+ }
if (&show_task($status,$previous) &&
- $Apache::lonhomework::history{"resource.$version.status"} =~ /^(pass|fail)$/) {
- my $bt_status=$Apache::lonhomework::history{"resource.$version.status"};
+ $Apache::lonhomework::history{"resource.$version.0.status"} =~ /^(pass|fail)$/) {
+ my $bt_status=$Apache::lonhomework::history{"resource.$version.0.status"};
my $title=&Apache::lonnet::gettitle();
- my %slot=&Apache::lonnet::get_slot($Apache::inputtags::slot_name);
+
+ my $slot_name=
+ $Apache::lonhomework::history{"resource.$version.0.checkedin.slot"};
+ my %slot=&Apache::lonnet::get_slot($slot_name);
my $start_time=
&Apache::lonlocal::locallocaltime($slot{'starttime'});
- my $status;
- $status.="\n
\n";
+ my $status = "\n
\n";
if ($bt_status eq 'pass') {
$status.='
You passed the '.$title.' given on '.
- $start_time.'.
';
+ $start_time.'';
}
if ($bt_status eq 'fail') {
$status.='
You did not pass the '.$title.' given on '.
- $start_time.'.
';
+ $start_time.'';
if (!$previous) {
$status.=&add_request_another_attempt_button();
}
@@ -653,7 +767,7 @@ sub end_Task {
if ($Apache::bridgetask::dimensionmandatory{$dim_id}
eq 'N') {
$opt_count++;
- if ($Apache::lonhomework::history{"resource.$version.$dim_id.status"} eq 'pass') {
+ if ($Apache::lonhomework::history{"resource.$version.0.$dim_id.status"} eq 'pass') {
$opt_passed++;
}
} else {
@@ -663,7 +777,7 @@ sub end_Task {
my $opt_req=&Apache::lonxml::get_param('OptionalRequired',
$parstack,$safeeval);
if ($opt_req !~ /\S/) { $opt_req='0'; }
- $status.="\n
".&mt('You needed to pass all of the [_1] mandatory components and [_2] of the [_3] optional components on the bridge task.',$man_count,$opt_req,$opt_count)."
\n";
+ $status.="\n
".&mt('You needed to pass all of the [_1] mandatory components and [_2] of the [_3] optional components, of which you passed [_4].',$man_count,$opt_req,$opt_count,$opt_passed)."
\n";
my $internal_location=&internal_location();
$result=~s/\Q$internal_location\E/$status/;
@@ -688,12 +802,18 @@ sub end_Task {
$award;
$Apache::lonhomework::results{"resource.0.submission"}=
$Apache::lonhomework::results{"resource.$version.0.submission"}='';
+ } else {
+ delete($Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"});
+ $award = '';
}
&Apache::lonhomework::showhash(%Apache::lonhomework::results);
&Apache::structuretags::finalize_storage();
- if ($award eq 'SUBMITTED') {
- &add_to_queue('gradingqueue',$Apache::inputtags::slot_name);
+ if ($award eq 'SUBMITTED'
+ && defined($Apache::inputtags::slot_name)) {
+ &add_to_queue('gradingqueue',[$Apache::inputtags::slot_name]);
}
+ } elsif ($Apache::lonhomework::results{'INTERNAL_store'}) {
+ &Apache::structuretags::finalize_storage();
}
if ($target eq 'grade' && $env{'form.webgrade'} eq 'yes') {
my $optional_required=
@@ -706,7 +826,7 @@ sub end_Task {
&Apache::lonhomework::showhash(%Apache::lonhomework::results);
foreach my $dim_id (@Apache::bridgetask::dimensionlist) {
my $status=
- $Apache::lonhomework::results{"resource.$version.$dim_id.status"};
+ $Apache::lonhomework::results{"resource.$version.0.$dim_id.status"};
my $mandatory=
($Apache::bridgetask::dimensionmandatory{$dim_id} ne 'N');
if ($status eq 'pass') {
@@ -725,10 +845,10 @@ sub end_Task {
$mandatory_failed++;
}
&Apache::lonxml::debug("all dim ".join(':',@Apache::bridgetask::dimensionlist)."results -> m_f $mandatory_failed o_p $optional_passed u $ungraded r $review");
- $Apache::lonhomework::results{'resource.grader'}=
+ $Apache::lonhomework::results{'resource.0.regrader'}=
$env{'user.name'}.'@'.$env{'user.domain'};
if ($review) {
- $Apache::lonhomework::results{"resource.$version.status"}='review';
+ $Apache::lonhomework::results{"resource.$version.0.status"}='review';
if ($env{'form.queue'} eq 'reviewqueue') {
&check_queue_unlock($env{'form.queue'});
&Apache::lonxml::debug(" still needs review not changing status.");
@@ -736,7 +856,7 @@ sub end_Task {
&move_between_queues($env{'form.queue'},'reviewqueue');
}
} elsif ($ungraded) {
- $Apache::lonhomework::results{"resource.$version.status"}='ungraded';
+ $Apache::lonhomework::results{"resource.$version.0.status"}='ungraded';
if ($env{'form.queue'} eq 'reviewqueue' ||
$env{'form.queue'} eq 'none' ) {
&Apache::lonxml::debug("moving back.");
@@ -745,7 +865,7 @@ sub end_Task {
&check_queue_unlock($env{'form.queue'});
}
} elsif ($mandatory_failed) {
- $Apache::lonhomework::results{"resource.$version.status"}='fail';
+ $Apache::lonhomework::results{"resource.$version.0.status"}='fail';
$Apache::lonhomework::results{"resource.$version.0.solved"}='incorrect_by_override';
$Apache::lonhomework::results{"resource.$version.0.award"}='INCORRECT';
$Apache::lonhomework::results{"resource.$version.0.awarded"}='0';
@@ -763,7 +883,7 @@ sub end_Task {
["$version.0.bridgetask"]);
}
} else {
- $Apache::lonhomework::results{"resource.$version.status"}='pass';
+ $Apache::lonhomework::results{"resource.$version.0.status"}='pass';
$Apache::lonhomework::results{"resource.$version.0.solved"}='correct_by_override';
$Apache::lonhomework::results{"resource.$version.0.award"}='EXACT_ANS';
$Apache::lonhomework::results{"resource.$version.0.awarded"}='1';
@@ -780,8 +900,8 @@ sub end_Task {
["$version.0.bridgetask"]);
}
}
- $Apache::lonhomework::results{"resource.status"}=
- $Apache::lonhomework::results{"resource.$version.status"};
+ $Apache::lonhomework::results{"resource.0.status"}=
+ $Apache::lonhomework::results{"resource.$version.0.status"};
if (defined($Apache::lonhomework::results{"resource.$version.0.awarded"})) {
$Apache::lonhomework::results{"resource.0.award"}=
$Apache::lonhomework::results{"resource.$version.0.award"};
@@ -790,6 +910,7 @@ sub end_Task {
$Apache::lonhomework::results{"resource.0.solved"}=
$Apache::lonhomework::results{"resource.$version.0.solved"};
}
+ &minimize_storage();
&Apache::structuretags::finalize_storage();
}
} elsif ($target eq 'webgrade') {
@@ -804,9 +925,15 @@ sub end_Task {
# &mt('Save Partial Grade and Continue Grading').'" /> ';
$result.=''.&Apache::loncommon::endbodytag().'