'."\n";
push(@Apache::inputtags::status,$status);
$Apache::inputtags::slot_name=$slot_name;
@@ -706,6 +711,7 @@ sub start_Task {
$target eq 'webgrade') {
my $webgrade='yes';
if ($target eq 'webgrade') {
+ $result .= '
'."\n";
$result.= "\n".'
'."\n".
'';
@@ -1116,7 +1122,8 @@ DONEBUTTON
}
- if ($target eq 'grade' && !$env{'form.webgrade'} && !$previous) {
+ if ($target eq 'grade' && !$env{'form.webgrade'} && !$previous
+ && $status eq 'CAN_ANSWER') {
my $award='SUBMITTED';
&Apache::essayresponse::file_submission("$version.0",'bridgetask',
'portfiles',\$award);
@@ -1577,17 +1584,16 @@ sub show_queue {
my $ekey=&escape($key);
my ($action,$description,$status)=('select',&mt('Select'));
if (exists($queue{"$key\0locked"})) {
- my $locker = $queue{"$key\0locked"};
- my $time;
- if (ref($queue{"$key\0locked"}) eq 'ARRAY') {
- ($locker, $time) = @{$queue{"$key\0locked"}};
+ my ($locker,$time) =
+ &get_lock_info($queue{"$key\0locked"});
+ if ($time) {
$time =
&Apache::lonnavmaps::timeToHumanString($time,
'start');
}
my $me=$env{'user.name'}.':'.$env{'user.domain'};
$status=&mt('Locked by [_1] [_2]',$locker,$time);
- if ($me eq $queue{"$key\0locked"}) {
+ if ($me eq $locker) {
($action,$description)=('resume',&mt('Resume'));
} else {
($action,$description)=('unlock',&mt('Unlock'));
@@ -1697,7 +1703,7 @@ sub queue_key_locked {
my ($key_locked,$value)=
&Apache::lonnet::get($queue,["$key\0locked"],$cdom,$cnum);
if ($key_locked eq "$key\0locked") {
- return $value;
+ return &get_lock_info($value);
}
return undef;
}
@@ -1778,6 +1784,24 @@ sub pick_from_queue_data {
return undef;
}
+sub get_lock_info {
+ my ($lock_info) = @_;
+ if (wantarray) {
+ if (ref($lock_info) eq 'ARRAY') {
+ return @{$lock_info};
+ } else {
+ return ($lock_info);
+ }
+ } else {
+ if (ref($lock_info) eq 'ARRAY') {
+ return $lock_info->[0];
+ } else {
+ return $lock_info;
+ }
+ }
+ return;
+}
+
sub find_mid_grade {
my ($queue,$symb,$cdom,$cnum)=@_;
my $todo=&unescape($env{'form.gradingkey'});
@@ -1789,7 +1813,7 @@ sub find_mid_grade {
my $regexp="^$symb\0.*\0locked\$";
my %locks=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp);
foreach my $key (keys(%locks)) {
- my $who=$locks{$key};
+ my $who= &get_lock_info($locks{$key});
if ($who eq $me) {
$todo=$key;
$todo=~s/\0locked$//;
@@ -2221,7 +2245,6 @@ sub end_Dimension {
my $result=&Apache::lonxml::endredirection();
my $dim=&get_id($parstack,$safeeval);
if (&skip_dimension_parsing($dim)) {
- &disable_dimension_parsing($dim);
pop(@Apache::bridgetask::dimension);
return;
}
@@ -2266,10 +2289,10 @@ sub end_Dimension {
('sub' x $dimension{$dim}{'depth'}).'question';
$ucquestion =~ s/^(.)/uc($1)/e;
if ($dim_status eq 'pass') {
- $dim_info.='
'.$ucquestion.' : you passed the above '.$mandatory.' '.$question.'
';
+ $dim_info.=''.$ucquestion.' : you passed this '.$mandatory.' '.$question.'
';
}
if ($dim_status eq 'fail') {
- $dim_info.=''.$ucquestion.' : you did not pass the above '.$mandatory.' '.$question.'
';
+ $dim_info.=''.$ucquestion.' : you did not pass this '.$mandatory.' '.$question.'
';
}
my %counts = &get_counts($dim,$instance,$parstack,
$safeeval);
@@ -2462,7 +2485,15 @@ sub question_status_message {
$status .= '.';
if ($counts->{'opt'}) {
$status .= ' You were required to pass '.$counts->{'opt_req'}.
- ' optional component'.($counts->{'opt_req'} == 1?'':'s');
+ ' optional ';
+ if ($counts->{'opt_dim'} + $counts->{'man_dim'} < 1) {
+ $status .=
+ ($counts->{'opt_req'} == 1?'criterion':'criteria');
+ } else {
+ $status .=
+ 'component'.($counts->{'opt_req'} == 1?'':'s');
+ }
+ $status .= '.';
}
return $status;
}