'.&mt('Your submission is in the grading queue.').'
';
} elsif ($status ne 'NOT_YET_VIEWED') {
$msg.='
'.&mt('Not open to be viewed').'
';
}
@@ -158,12 +167,15 @@ sub start_Task {
} else {
$result.=&mt('Problem is not open to be viewed. It')." $accessmsg \\vskip 0 mm ";
}
- } elsif ($target eq 'grade') {
+ } elsif ($target eq 'grade' && !$env{'form.webgrade'}) {
if ($status eq 'NEEDS_CHECKIN') {
- if (&proctor_check_auth($slot)) {
+ if (&proctor_check_auth($slot_name,$slot)) {
#FIXME immeadiatly add this to the grading queue
# with slot->{'endtime'} for when grading can
# begin on this resource
+ # FIXME I think the above is done by default,
+ # need to check that
+ # failure doesn't do this.
}
}
}
@@ -179,11 +191,21 @@ sub start_Task {
'" value="'.$env{"form.grade_$field"}.'" />'."\n";
}
}
+ if ($Apache::lonhomework::history{'resource.status'} eq 'fail') {
+ $result.='
';
+ }
my $bodytext=&Apache::lonxml::get_all_text("/task",$parser);
}
-
} else {
# page_start returned a starting result, delete it if we don't need it
$result = '';
@@ -256,9 +279,10 @@ sub end_Task {
my $mandatory_failed=0;
my $ungraded=0;
my $review=0;
+ &Apache::lonhomework::showhash(%Apache::lonhomework::results);
foreach my $dim_id (@Apache::bridgetask::dimensionlist) {
my $status=
- $Apache::lonhomeork::results{"resource.$dim_id.status"};
+ $Apache::lonhomework::results{"resource.$dim_id.status"};
my $mandatory=
($Apache::bridgetask::dimensionmandatory{$dim_id} ne 'N');
if ($status eq 'pass') {
@@ -274,23 +298,25 @@ sub end_Task {
if ($optional_passed < $optional_required) {
$mandatory_failed++;
}
- $Apache::lonhomeork::results{'resource.grader'}=
+ &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'}=
$env{'user.name'}.'@'.$env{'user.domain'};
if ($review) {
- $Apache::lonhomeork::results{'resource.status'}='review';
+ $Apache::lonhomework::results{'resource.status'}='review';
&move_to_review_queue();
} elsif ($ungraded) {
- $Apache::lonhomeork::results{'resource.status'}='ungraded';
+ $Apache::lonhomework::results{'resource.status'}='ungraded';
&check_queue_unlock();
} elsif ($mandatory_failed) {
- $Apache::lonhomeork::results{'resource.status'}='fail';
+ $Apache::lonhomework::results{'resource.status'}='fail';
$Apache::lonhomework::results{"resource.0.award"}='EXACT_ANS';
&remove_from_queue();
} else {
- $Apache::lonhomeork::results{'resource.status'}='pass';
+ $Apache::lonhomework::results{'resource.status'}='pass';
$Apache::lonhomework::results{"resource.0.award"}='INCORRECT';
&remove_from_queue();
}
+ &Apache::structuretags::finalize_storage();
}
} elsif ($target eq 'webgrade') {
$result.="
\n";
@@ -312,6 +338,18 @@ sub end_Task {
return $result;
}
+sub move_to_review_queue {
+ &Apache::lonxml::debug("Want to move");
+}
+
+sub check_queue_unlock {
+ &Apache::lonxml::debug("Want to unlock?");
+}
+
+sub remove_from_queue {
+ &Apache::lonxml::debug("Want to remove. Done?");
+}
+
sub setup_env_for_other_user {
my ($queue_key,$safeeval)=@_;
my ($symb,$uname,$udom)=&decode_queue_key($queue_key);
@@ -554,13 +592,35 @@ sub get_instance {
sub end_Dimension {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $result;
+ my $dim_id=&get_id($parstack,$safeeval);
my $instance=&get_instance();
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') {
+ 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"};
+ $result.='
';
+ if ($status eq 'fail') {
+ $result.=''.&mt('Did not pass').'';
+ } elsif ($status eq 'pass') {
+ $result.=''.&mt('Passed').'';
+ } else {
+ &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"}.'