";
$result.=&Apache::inputtags::gradestatus('0');
@@ -260,11 +287,11 @@ sub end_Task {
&Apache::essayresponse::file_submission('0','bridgetask',
'portfiles',\$award);
if ($award eq 'SUBMITTED' &&
- $Apache::lonhomework::results{"resource.0.bridgetask.portfiles"}) {
- $Apache::lonhomework::results{"resource.0.tries"}=
- 1+$Apache::lonhomework::history{"resource.0.tries"};
+ $Apache::lonhomework::results{"resource.$version.bridgetask.portfiles"}) {
+ $Apache::lonhomework::results{"resource.$version.tries"}=
+ 1+$Apache::lonhomework::history{"resource.$version.tries"};
}
- $Apache::lonhomework::results{"resource.0.award"}=$award;
+ $Apache::lonhomework::results{"resource.$version.award"}=$award;
&Apache::lonhomework::showhash(%Apache::lonhomework::results);
&Apache::structuretags::finalize_storage();
if ($award eq 'SUBMITTED') {
@@ -282,7 +309,7 @@ sub end_Task {
&Apache::lonhomework::showhash(%Apache::lonhomework::results);
foreach my $dim_id (@Apache::bridgetask::dimensionlist) {
my $status=
- $Apache::lonhomework::results{"resource.$dim_id.status"};
+ $Apache::lonhomework::results{"resource.$version.$dim_id.status"};
my $mandatory=
($Apache::bridgetask::dimensionmandatory{$dim_id} ne 'N');
if ($status eq 'pass') {
@@ -302,20 +329,34 @@ sub end_Task {
$Apache::lonhomework::results{'resource.grader'}=
$env{'user.name'}.'@'.$env{'user.domain'};
if ($review) {
- $Apache::lonhomework::results{'resource.status'}='review';
+ $Apache::lonhomework::results{"resource.$version.status"}='review';
&move_to_review_queue();
} elsif ($ungraded) {
- $Apache::lonhomework::results{'resource.status'}='ungraded';
+ $Apache::lonhomework::results{"resource.$version.status"}='ungraded';
&check_queue_unlock();
} elsif ($mandatory_failed) {
- $Apache::lonhomework::results{'resource.status'}='fail';
- $Apache::lonhomework::results{"resource.0.award"}='EXACT_ANS';
+ $Apache::lonhomework::results{"resource.$version.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';
&remove_from_queue();
} else {
- $Apache::lonhomework::results{'resource.status'}='pass';
- $Apache::lonhomework::results{"resource.0.award"}='INCORRECT';
+ $Apache::lonhomework::results{"resource.$version.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';
&remove_from_queue();
}
+ $Apache::lonhomework::results{'resource.status'}=
+ $Apache::lonhomework::results{'resource.$version.status'};
+ if (defined($Apache::lonhomework::results{'resource.$version.awarded'})) {
+ $Apache::lonhomework::results{'resource.0.award'}=
+ $Apache::lonhomework::results{'resource.$version.award'};
+ $Apache::lonhomework::results{'resource.0.awarded'}=
+ $Apache::lonhomework::results{'resource.$version.awarded'};
+ $Apache::lonhomework::results{'resource.0.solved'}=
+ $Apache::lonhomework::results{'resource.$version.solved'};
+ }
&Apache::structuretags::finalize_storage();
}
} elsif ($target eq 'webgrade') {
@@ -592,15 +633,16 @@ sub get_instance {
sub end_Dimension {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $result;
- my $dim_id=&get_id($parstack,$safeeval);
+ my $dim=&get_id($parstack,$safeeval);
my $instance=&get_instance();
+ my $version=&get_version();
if ($target eq 'web') {
$result=$dimension{'intro'}.$dimension{$instance.'.text'};
- if ($Apache::lonhomework::history{'resource.status'} eq 'pass' ||
- $Apache::lonhomework::history{'resource.status'} eq 'fail') {
+ if ($Apache::lonhomework::history{'resource.$version.status'} eq 'pass' ||
+ $Apache::lonhomework::history{'resource.$version.status'} eq 'fail') {
foreach my $id (@{$dimension{$instance.'.criterias'}}) {
- my $status=$Apache::lonhomework::history{"resource.$dim_id.$instance.$id.status"};
- my $comment=$Apache::lonhomework::history{"resource.$dim_id.$instance.$id.comment"};
+ my $status=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"};
+ my $comment=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"};
$result.='
';
if ($status eq 'fail') {
$result.=''.&mt('Did not pass').'';
@@ -610,8 +652,8 @@ sub get_instance {
&Apache::lonxml::error("Student viewing a graded bridgetask was show a status of $status");
}
$result.='
';
- if ($Apache::lonhomework::history{"resource.$dim_id.$instance.$id.comment"}) {
- $result.=&mt('Comment from grader: ').$Apache::lonhomework::history{"resource.$dim_id.$instance.$id.comment"}.'
';
+ if ($Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"}) {
+ $result.=&mt('Comment from grader: ').$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"}.'