';
my $subject = &mt('Submission message for [_1]',$title);
my ($message_status,$comment_status);
my $setting = $env{'course.'.$env{'request.course.id'}.'.task_messages'};
@@ -572,15 +641,11 @@ sub done_screen {
$comment_status = '
'.&mt('Message sent to instructor: [_1]',
$comment_status).'
'
-.$message_status
-.$comment_status;
-
+ .$shown
+ .$message_status
+ .$comment_status;
}
sub start_Task {
@@ -610,35 +675,24 @@ sub start_Task {
&Apache::structuretags::page_start($target,$token,$tagstack,
$parstack,$parser,$safeeval,
$name,&style($target));
+
+ }
+ if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
+ $target eq 'tex') {
+ if ($env{'form.markaccess'}) {
+ my @interval=&Apache::lonnet::EXT("resource.0.interval");
+ &Apache::lonnet::set_first_access($interval[1]);
+ }
}
if ($target eq 'web' && $env{'request.state'} ne 'construct') {
if ($Apache::lonhomework::queuegrade
|| $Apache::lonhomework::modifygrades) {
- $result.='\n";
+ $result .= &add_grading_button();
my $symb=&Apache::lonnet::symbread();
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})
|| &Apache::lonnet::allowed('mgq',$env{'request.course.id'}.'/'.$env{'request.course.sec'})) {
- $result.='';
- my $target_id =
- &Apache::lonstathelpers::make_target_id({symb => $symb,
- part => '0'});
- if (!§ion_restricted()) {
- $result.='';
- }
+ $result .= &add_slotlist_button();
}
}
}
@@ -652,19 +706,26 @@ sub start_Task {
my ($version,$previous)=&get_version();
($status,$accessmsg,my $slot_name,$slot) =
&Apache::lonhomework::check_slot_access('0','Task');
- if ($status eq 'CAN_ANSWER' && $version eq '') {
- # CAN_ANSWER mode, and no current version, unproctored access
+ if ((($status eq 'CAN_ANSWER') || ($status eq 'NOT_YET_VIEWED')) && ($version eq '')) {
+ # CAN_ANSWER or NOT_YET_VIEWED mode, and no current version, unproctored access
# thus self-checkedin
- &check_in('Task',undef,undef,$slot_name);
+ my $check = &check_in('Task',undef,undef,$slot_name);
+ if ($check =~ /^error: /) {
+ my $symb=&Apache::lonnet::symbread();
+ &Apache::lonnet::logthis("Error during self-checkin of version $version of Task (symb: $symb) using slot: $slot_name");
+ }
&add_to_queue('gradingqueue',{'type' => 'Task',
'time' => time,
'slot' => $slot_name});
($version,$previous)=&get_version();
}
- my $status_id =
- ($previous || $status eq 'SHOW_ANSWER') ? 'LC_task_feedback'
- : 'LC_task_take';
+ my $status_id = 'LC_task_take';
+ if ($previous && $target eq 'answer') {
+ $status_id = 'LC_task_answer';
+ } elsif ($previous || $status eq 'SHOW_ANSWER') {
+ $status_id = 'LC_task_feedback';
+ }
$result .= '
'."\n";
push(@Apache::inputtags::status,$status);
@@ -685,7 +746,7 @@ sub start_Task {
$msg.='
'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'
';
} elsif ($status eq 'NOT_IN_A_SLOT') {
$msg.='
'.&mt('You are not currently signed up to work at this time and/or place.').'
';
- $msg.=&add_request_another_attempt_button("Sign up for time to work.");
+ $msg.=&add_request_another_attempt_button("Sign up for time to work");
} elsif ($status eq 'NEEDS_CHECKIN') {
$msg.='
'.&mt('You need the Proctor to validate you.').
'
'.&proctor_validation_screen($slot);
@@ -693,7 +754,10 @@ sub start_Task {
$msg.='
'.&mt('Your submission is in the grading queue.').'
';
}
if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') {
@@ -701,7 +765,7 @@ sub start_Task {
}
$result.=$msg.' ';
} elsif ($target eq 'tex') {
- $result.='\begin{document}\noindent \vskip 1 mm \begin{minipage}{\textwidth}\vskip 0 mm';
+ $result.='\noindent \vskip 1 mm \begin{minipage}{\textwidth}\vskip 0 mm';
if ($status eq 'UNAVAILABLE') {
$result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm ';
} else {
@@ -771,6 +835,11 @@ sub start_Task {
$result.=''.&mt("Stopped grading.").''.$back;
} elsif ($status_code eq 'cancel') {
$result.=''.&mt("Cancelled grading.").''.$back;
+ } elsif ($status_code eq 'terminated') {
+ $result.= ''.&mt('Terminated grading').' '.
+ ''.
+ &mt('Grading for [_1] has not been saved because of a grading key mismatch.',
+ ''.$env{'form.terminated'}.'').' '.$back;
} elsif ($status_code eq 'never_versioned') {
$result.=''.
&mt("Requested user has never accessed the task.").
@@ -991,6 +1060,8 @@ sub get_key_todo {
return (undef,'stop');
} elsif ($env{'form.cancel'}) {
return (undef,'cancel');
+ } elsif ($env{'form.terminated'}) {
+ return (undef, 'terminated');
} elsif ($env{'form.next'}) {
return (undef,'select_user');
}
@@ -1036,13 +1107,17 @@ sub get_key_todo {
if ($env{'form.queuemode'} ne 'selected') {
# don't get something new from the queue if they hit the stop button
- if (!(($env{'form.cancel'} || $env{'form.stop'})
+ if (!(($env{'form.cancel'} || $env{'form.stop'} || $env{'form.terminated'})
&& $target eq 'webgrade')
&& !$env{'form.gradingaction'}) {
&Apache::lonxml::debug("Getting anew $queue");
return (&get_from_queue($queue));
} else {
- return (undef,'stop');
+ if ($env{'form.terminated'}) {
+ return (undef,'terminated');
+ } else {
+ return (undef,'stop');
+ }
}
}
return (undef,undef)
@@ -1072,14 +1147,21 @@ sub end_Task {
}
if ($status eq 'CAN_ANSWER' && !$previous &&
!$env{'form.donescreen'}) {
- $result.="\n".'
'.
+ my ($portheader,$porttext);
+ if ($Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"}) {
+ $portheader = &mt('Submit Additional Portfolio Files for Grading');
+ $porttext = &mt('Indicate which additional files from your portfolio are to be evaluated in grading this task.');
+ } else {
+ $portheader = &mt('Submit Portfolio Files for Grading');
+ $porttext = &mt('Indicate the files from your portfolio to be evaluated in grading this task.');
+ }
+ $result.="\n".'