'.&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 $files='
+DONESCREEN
} elsif ($status ne 'NOT_YET_VIEWED') {
$msg.='
'.&mt('Not open to be viewed').'
';
}
@@ -243,85 +461,97 @@ sub start_Task {
}
} elsif ($target eq 'grade' && !$env{'form.webgrade'}) {
if ($status eq 'NEEDS_CHECKIN') {
- 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.
- }
+ &proctor_check_auth($slot_name,$slot);
}
}
} elsif ($target eq 'web') {
my $name= &Apache::structuretags::get_resource_name($parstack,$safeeval);
$result.="$head_tag_start$name
- $body_tag_start \n $form_tag_start".
- '';
+ $body_tag_start \n".&style();
+
$result.=&preserve_grade_info();
- my ($version,$previous)=&get_version();
- if ($Apache::lonhomework::history{"resource.$version.status"} eq 'fail') {
- $result.='
'.&mt('Did not pass').'
';
- if (!$previous) {
- $result.=&add_request_another_attempt_button();
- }
- }
- if ($Apache::lonhomework::history{"resource.$version.status"} eq 'pass') {
- $result.='
'.&mt('Passed').'
';
- }
+ $result.=&internal_location();
+ $result.=$form_tag_start.
+ '';
+ &Apache::lonxml::startredirection();
}
} elsif ( ($target eq 'grade' && $env{'form.webgrade'}) ||
$target eq 'webgrade') {
my $webgrade='yes';
if ($target eq 'webgrade') {
- #FIXME FORM conflcit with the 'show queue',1
$result.=$head_tag_start.$body_tag_start;
- $result.=' Review'.&show_queue('reviewqueue');
- $result.=' Before'.&show_queue('gradingqueue');
+ #$result.=' Review'.&show_queue('reviewqueue');
+ #$result.=' Grade'.&show_queue('gradingqueue');
}
- if (defined($env{'form.reviewasubmission'})) {
- $result.=&show_queue('reviewqueue',1);
- my $bodytext=&Apache::lonxml::get_all_text("/task",$parser);
- } else {
- my ($todo,$status_code)=&get_key_todo($target);
- if ($todo) {
- &setup_env_for_other_user($todo,$safeeval);
- my ($symb,$uname,$udom)=&decode_queue_key($todo);
- $result.="\n".'
Found '.
- &Apache::lonnet::gettitle($symb).' for '.$uname.' at '.$udom.'
';
+ # FIXME Blast! still need to reorg this, need to reshow the
+ # queue being reviewed once done with the grade pass...
+ # Hrrm, vaildation pass should perhaps say 'not_locked'
+ # perhaps do a search if there is a key that is mine and if
+ # there isn't reshow the queue....
+ my ($todo,$status_code)=&get_key_todo($target);
+
+ if ($todo) {
+ &setup_env_for_other_user($todo,$safeeval);
+ my ($symb,$uname,$udom)=&decode_queue_key($todo);
+ $result.="\n".'
Found '.
+ &Apache::lonnet::gettitle($symb).' for '.$uname.' at '.$udom.'
'.&mt('Indicate the files from your portfolio to be evaluated in grading this task.').'
').
"
";
$result.=&Apache::inputtags::gradestatus('0');
+ $result.='';
+ $result.=<
+
+
+
+DONEBUTTON
+ }
+ if (&show_task($status,$previous) &&
+ $Apache::lonhomework::history{"resource.$version.status"} =~ /^(pass|fail)$/) {
+ my $bt_status=$Apache::lonhomework::history{"resource.$version.status"};
+ my $title=&Apache::lonnet::gettitle();
+ my %slot=&Apache::lonnet::get_slot($Apache::inputtags::slot_name);
+ my $start_time=
+ &Apache::lonlocal::locallocaltime($slot{'starttime'});
+
+ my $status;
+ $status.="\n
\n";
+
+ if ($bt_status eq 'pass') {
+ $status.='
You passed the '.$title.' given on '.
+ $start_time.'.
';
+ }
+ if ($bt_status eq 'fail') {
+ $status.='
You did not pass the '.$title.' given on '.
+ $start_time.'.
';
+ if (!$previous) {
+ $status.=&add_request_another_attempt_button();
+ }
+ }
+ my $man_count=0;
+ my $opt_count=0;
+ my $opt_passed=0;
+ foreach my $dim_id (@Apache::bridgetask::dimensionlist) {
+ if ($Apache::bridgetask::dimensionmandatory{$dim_id}
+ eq 'N') {
+ $opt_count++;
+ if ($Apache::lonhomework::history{"resource.$version.$dim_id.status"} eq 'pass') {
+ $opt_passed++;
+ }
+ } else {
+ $man_count++;
+ }
+ }
+ 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";
+
+ my $internal_location=&internal_location();
+ $result=~s/\Q$internal_location\E/$status/;
}
}
if ($target eq 'web' || $target eq 'webgrade') {
@@ -403,6 +745,10 @@ sub end_Task {
$Apache::lonhomework::results{"resource.0.award"}=
$Apache::lonhomework::results{"resource.$version.0.award"}=
$award;
+ $Apache::lonhomework::results{"resource.0.submission"}=
+ $Apache::lonhomework::results{"resource.$version.0.submission"}='';
+ } else {
+ delete($Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"});
}
&Apache::lonhomework::showhash(%Apache::lonhomework::results);
&Apache::structuretags::finalize_storage();
@@ -432,7 +778,9 @@ sub end_Task {
$ungraded++;
} elsif ($status eq 'review') {
$review++;
- }
+ } else {
+ $ungraded++;
+ }
}
if ($optional_passed < $optional_required) {
$mandatory_failed++;
@@ -442,34 +790,66 @@ sub end_Task {
$env{'user.name'}.'@'.$env{'user.domain'};
if ($review) {
$Apache::lonhomework::results{"resource.$version.status"}='review';
- # FIXME won't work well when already in review queues
- &move_between_queues('gradingqueue','reviewqueue');
+ if ($env{'form.queue'} eq 'reviewqueue') {
+ &check_queue_unlock($env{'form.queue'});
+ &Apache::lonxml::debug(" still needs review not changing status.");
+ } else {
+ &move_between_queues($env{'form.queue'},'reviewqueue');
+ }
} elsif ($ungraded) {
$Apache::lonhomework::results{"resource.$version.status"}='ungraded';
- # FIXME if in review queue need to move back to grading queue
- &check_queue_unlock($env{'form.queue'});
+ if ($env{'form.queue'} eq 'reviewqueue' ||
+ $env{'form.queue'} eq 'none' ) {
+ &Apache::lonxml::debug("moving back.");
+ &move_between_queues($env{'form.queue'},'gradingqueue');
+ } else {
+ &check_queue_unlock($env{'form.queue'});
+ }
} elsif ($mandatory_failed) {
$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($env{'form.queue'});
+ &remove_from_queue($env{'form.queue'});
+
+ my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
+
+ if ($env{'form.regrade'} ne 'yes') {
+ $Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}=
+ $Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"};
+ &Apache::grades::version_portfiles(
+ \%Apache::lonhomework::results,
+ ["$version.0.bridgetask"],$courseid,
+ $symb,$udom,$uname,
+ ["$version.0.bridgetask"]);
+ }
} else {
$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($env{'form.queue'});
+
+ my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
+ if ($env{'form.regrade'} ne 'yes') {
+ $Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}=
+ $Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"};
+ &Apache::grades::version_portfiles(
+ \%Apache::lonhomework::results,
+ ["$version.0.bridgetask"],$courseid,
+ $symb,$udom,$uname,
+ ["$version.0.bridgetask"]);
+ }
}
$Apache::lonhomework::results{"resource.status"}=
$Apache::lonhomework::results{"resource.$version.status"};
if (defined($Apache::lonhomework::results{"resource.$version.0.awarded"})) {
$Apache::lonhomework::results{"resource.0.award"}=
- $Apache::lonhomework::results{"resource.$version.award"};
+ $Apache::lonhomework::results{"resource.$version.0.award"};
$Apache::lonhomework::results{"resource.0.awarded"}=
- $Apache::lonhomework::results{"resource.$version.awarded"};
+ $Apache::lonhomework::results{"resource.$version.0.awarded"};
$Apache::lonhomework::results{"resource.0.solved"}=
- $Apache::lonhomework::results{"resource.$version.solved"};
+ $Apache::lonhomework::results{"resource.$version.0.solved"};
}
&Apache::structuretags::finalize_storage();
}
@@ -485,9 +865,14 @@ sub end_Task {
# &mt('Save Partial Grade and Continue Grading').'" /> ';
$result.=''.&Apache::loncommon::endbodytag().'