--- loncom/homework/bridgetask.pm 2006/06/13 20:28:49 1.169
+++ loncom/homework/bridgetask.pm 2020/09/01 17:48:33 1.264.6.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.169 2006/06/13 20:28:49 albertel Exp $
+# $Id: bridgetask.pm,v 1.264.6.2 2020/09/01 17:48:33 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,22 +37,22 @@ use Apache::lonmenu;
use Apache::lonlocal;
use Apache::lonxml;
use Apache::slotrequest();
+use Apache::structuretags();
use Time::HiRes qw( gettimeofday tv_interval );
-use lib '/home/httpd/lib/perl/';
use LONCAPA;
BEGIN {
- &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','QuestionText','Setup','Instance','InstanceText','Criteria','ClosingParagraph'));
+ &Apache::lonxml::register('Apache::bridgetask',('Task','IntroParagraph','Dimension','Question','QuestionText','Setup','Instance','InstanceText','Criteria','CriteriaText','GraderNote','ClosingParagraph'));
}
my %dimension;
+my $top = 'top';
+
sub initialize_bridgetask {
# id of current Dimension, 0 means that no dimension is current
# (inside only)
- %Apache::bridgetask::dimension=();
- # list of all Dimension ids seen
- %Apache::bridgetask::top_dimensionlist=();
+ @Apache::bridgetask::dimension=();
# list of all current Instance ids
%Apache::bridgetask::instance=();
# list of all Instance ids seen in this problem
@@ -65,8 +65,9 @@ sub initialize_bridgetask {
sub proctor_check_auth {
my ($slot_name,$slot,$type)=@_;
my $user=$env{'form.proctorname'};
+ $user =~ s/^\s+|\s+$//g;
my $domain=$env{'form.proctordomain'};
-
+
my @allowed=split(",",$slot->{'proctor'});
foreach my $possible (@allowed) {
my ($puser,$pdom)=(split(':',$possible));
@@ -83,7 +84,10 @@ sub proctor_check_auth {
}
}
if ($authenticated) {
- &create_new_version($type,$user,$domain,$slot_name);
+ my $check = &check_in($type,$user,$domain,$slot_name);
+ if ($check =~ /^error:/) {
+ return 0;
+ }
return 1;
}
}
@@ -91,8 +95,50 @@ sub proctor_check_auth {
return 0;
}
+sub check_in {
+ my ($type,$user,$domain,$slot_name) = @_;
+ my $useslots = &Apache::lonnet::EXT("resource.0.useslots");
+ if ( $useslots eq 'map_map') {
+ my $result = &check_in_sequence($user,$domain,$slot_name);
+ if ($result =~ /^error: /) {
+ return $result;
+ }
+ } else {
+ &create_new_version($type,$user,$domain,$slot_name);
+ &Apache::structuretags::finalize_storage();
+ }
+ return 1;
+}
+
+sub check_in_sequence {
+ my ($user,$domain,$slot_name) = @_;
+ my $navmap = Apache::lonnavmaps::navmap->new();
+ if (!defined($navmap)) {
+ return 'error: ';
+ }
+ my ($symb) = &Apache::lonnet::whichuser();
+ my ($map) = &Apache::lonnet::decode_symb($symb);
+ my @resources =
+ $navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0);
+ my %old_history = %Apache::lonhomework::history;
+ my %old_results = %Apache::lonhomework::results;
+
+ foreach my $res (@resources) {
+ &Apache::lonxml::debug("doing ".$res->src);
+ &Apache::structuretags::initialize_storage($res->symb);
+ my $type = ($res->is_task()) ? 'Task' : 'problem';
+ &create_new_version($type,$user,$domain,$slot_name);
+ &Apache::structuretags::finalize_storage($res->symb);
+ }
+
+ %Apache::lonhomework::history = %old_history;
+ %Apache::lonhomework::results = %old_results;
+}
+
sub create_new_version {
my ($type,$user,$domain,$slot_name) = @_;
+
+ my $id = '0';
if ($type eq 'Task') {
# increment version
my $version=
@@ -107,28 +153,27 @@ sub create_new_version {
}
#setup new version and who did it
- $Apache::lonhomework::results{'resource.0.version'}=$version;
- if (defined($user) && defined($domain)) {
- $Apache::lonhomework::results{"resource.$version.0.checkedin"}=
- $user.':'.$domain;
- } else {
- $Apache::lonhomework::results{"resource.$version.0.checkedin"}=
- $env{'user.name'}.':'.$env{'user.domain'};
- }
- if (defined($slot_name)) {
- $Apache::lonhomework::results{"resource.$version.0.checkedin.slot"}=
- $slot_name;
+ $Apache::lonhomework::results{'resource.0.version'}=$version;
+ $id = "$version.0";
+ if (!defined($user) || !defined($domain)) {
+ $user = $env{'user.name'};
+ $domain = $env{'user.domain'};
}
+
} elsif ($type eq 'problem') {
&Apache::lonxml::debug("authed $slot_name");
- if (defined($user) && defined($domain)) {
- $Apache::lonhomework::results{"resource.0.checkedin"}=
- $user.':'.$domain;
- }
- if (defined($slot_name)) {
- $Apache::lonhomework::results{"resource.0.checkedin.slot"}=
- $slot_name;
- }
+ }
+ if (!defined($user) || !defined($domain)) {
+ $user = $env{'user.name'};
+ $domain = $env{'user.domain'};
+ }
+
+ $Apache::lonhomework::results{"resource.$id.checkedin"}=
+ $user.':'.$domain;
+
+ if (defined($slot_name)) {
+ $Apache::lonhomework::results{"resource.$id.checkedin.slot"}=
+ $slot_name;
}
}
@@ -155,6 +200,10 @@ sub get_version {
sub add_previous_version_button {
my ($status)=@_;
+ my (undef,undef,$udom,$uname)=&Apache::lonnet::whichuser();
+ if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
+ return;
+ }
my $result;
if ($Apache::lonhomework::history{'resource.0.version'} eq '') {
return '';
@@ -191,7 +240,10 @@ sub add_previous_version_button {
}
sub add_grading_button {
- my (undef,$cid)=&Apache::lonxml::whichuser();
+ my (undef,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
+ if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
+ return;
+ }
my $cnum=$env{'course.'.$cid.'.num'};
my $cdom=$env{'course.'.$cid.'.domain'};
my %sections = &Apache::loncommon::get_sections($cdom,$cnum);
@@ -200,36 +252,56 @@ sub add_grading_button {
if (scalar(keys(%sections)) < 3) {
$size=scalar(keys(%sections))+2;
}
- my $sec_select = '\n";
+
+ my $uri=$env{'request.uri'};
+ if ($env{'request.enc'}) { $uri=&Apache::lonenc::encrypted($uri); }
+ my $result =
+ '
'."\n";
+ }
+ $result .= ''."\n";
+ return $result;
+}
+
+sub add_slotlist_button {
+ my (undef,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
+ if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
+ return;
+ }
+ my $symb=&Apache::lonnet::symbread();
+ my $result;
+ 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.='';
+ }
}
return $result;
}
sub add_request_another_attempt_button {
my ($text)=@_;
- if (!$text) { $text="Request another attempt"; }
+ my (undef,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
+ if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
+ return;
+ }
+ if (!$text) { $text=&mt('Request another attempt'); }
my $result;
my $symb=&Apache::lonnet::symbread();
# not a slot access based resource
@@ -256,23 +363,25 @@ sub add_request_another_attempt_button {
my ($slot_name,$slot)=&Apache::slotrequest::check_for_reservation($symb);
my $action='get_reservation';
if ($slot_name) {
- $text="Change reservation.";
+ $text=&mt('Change reservation');
$action='change_reservation';
my $description=&Apache::slotrequest::get_description($slot_name,
$slot);
- $result.=(< Will be next available: $description
-STUFF
+ $result.='
'
+ .&mt('Will be next available:')
+ .' '.$description
+ .'
';
}
if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); }
$symb=&escape($symb);
- $result.='';
+ $text.'" />'."\n\t".
+ ''."\n";
return $result;
}
@@ -292,9 +401,22 @@ sub style {
my ($target) = @_;
if ($target eq 'web'
|| $target eq 'webgrade') {
- return (<
STYLE
+ if ($env{'browser.type'} eq 'explorer'
+ && $env{'browser.os'} eq 'win' ) {
+ if ($env{'browser.version'} < 7) {
+ $style .= (<
+STYLE
+ } else {
+ $style .= (<
+STYLE
+ }
+ }
+ return $style;
}
return;
}
@@ -306,6 +428,7 @@ sub show_task {
( $status eq 'BANNED') ||
( $status eq 'UNAVAILABLE') ||
( $status eq 'NOT_IN_A_SLOT') ||
+ ( $status eq 'NOT_YET_VIEWED') ||
( $status eq 'NEEDS_CHECKIN') ||
( $status eq 'WAITING_FOR_GRADE') ||
( $status eq 'INVALID_ACCESS') ||
@@ -316,18 +439,59 @@ sub show_task {
return 1;
}
+my @delay;
+sub nest {
+ if (@delay) {
+ return $delay[-1];
+ } else {
+ return;
+ }
+}
+
+sub start_delay {
+ push(@delay,1);
+}
+sub end_delay {
+ pop(@delay);
+}
+
+sub nested_parse {
+ my ($str,$env,$args) = @_;
+ my @old_env = @Apache::scripttag::parser_env;
+ @Apache::scripttag::parser_env = @$env;
+ if (exists($args->{'set_dim_id'})) {
+ &enable_dimension_parsing($args->{'set_dim_id'});
+ }
+ push(@delay,(($args->{'delayed_dim_results'})? 1 : 0));
+ my $result = &Apache::scripttag::xmlparse($$str);
+ pop(@delay);
+ if (exists($args->{'set_dim_id'})) {
+ &disable_dimension_parsing();
+ }
+ @Apache::scripttag::parser_env = @old_env;
+ if ($args->{'delayed_dim_results'}) {
+ my $dim = &get_dim_id();
+ &Apache::lonxml::debug(" tossing out $result ");
+ &Apache::lonxml::debug(" usining out $dim 's ". $dimension{$dim}{'result'});
+ return $dimension{$dim}{'result'};
+ }
+ return $result;
+}
+
sub internal_location {
my ($id)=@_;
return '';
}
sub submission_time_stamp {
- my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
+ my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser();
my $submissiontime;
my $version=$Apache::lonhomework::history{'resource.0.version'};
for (my $v=$Apache::lonhomework::history{'version'};$v>0;$v--) {
- if (defined($Apache::lonhomework::history{$v.':resource.'.$version.'.0.bridgetask.portfiles'})) {
+ if (defined($Apache::lonhomework::history{$v.':resource.'.$version.'.0.bridgetask.portfiles'})
+ && defined($Apache::lonhomework::history{$v.':resource.'.$version.'.0.tries'})) {
$submissiontime=$Apache::lonhomework::history{$v.':timestamp'};
+ last;
}
}
my $result;
@@ -338,16 +502,18 @@ sub submission_time_stamp {
my ($color,$when)=('#FF6666','after');
if ($diff > 0) { ($color,$when)=('#336600','before'); }
my $info;
+ $diff = abs($diff);
if ($diff%60) { $info=($diff%60).' seconds'; }
$diff=int($diff/60);
if ($diff%60) { $info=($diff%60).' minutes '.$info; }
$diff=int($diff/60);
if ($diff) { $info=$diff.' hours '.$info; }
$result='
'.
- &mt('Student submitted [_1] [_2] the deadline.
- (Submission was at [_3], end of period was [_4].)',
- $info,$when,scalar(localtime($submissiontime)),
- scalar(localtime($slot{'endtime'}))).
+ &mt('Student submitted [_1] [_2] the deadline. '.
+ '(Submission was at [_3], end of period was [_4].)',
+ $info,$when,
+ &Apache::lonlocal::locallocaltime($submissiontime),
+ &Apache::lonlocal::locallocaltime($slot{'endtime'})).
'
';
}
return $result;
@@ -356,7 +522,7 @@ sub submission_time_stamp {
sub file_list {
my ($files,$uname,$udom) = @_;
if (!defined($uname) || !defined($udom)) {
- (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser();
+ (undef,undef,$udom,$uname) = &Apache::lonnet::whichuser();
}
my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio/';
@@ -365,7 +531,7 @@ sub file_list {
my $file=$file_url.$partial_file;
$file=~s|/+|/|g;
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file);
- $file_list.='
';
}
if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') {
$msg.='The problem '.$accessmsg;
}
$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 {
@@ -597,8 +798,8 @@ sub start_Task {
} elsif ($target eq 'web') {
$result.=&preserve_grade_info();
- $result.=&internal_location();
- $result.=$form_tag_start.
+ $result.=&internal_location();
+ $result.=$form_tag_start."\t".
'';
&Apache::lonxml::startredirection();
}
@@ -606,24 +807,25 @@ sub start_Task {
$target eq 'webgrade') {
my $webgrade='yes';
if ($target eq 'webgrade') {
+ $result .= '
'."\n";
$result.= "\n".'
'."\n".
'';
#$result.=' Review'.&show_queue('reviewqueue');
#$result.=' Grade'.&show_queue('gradingqueue');
}
- # 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,$msg)=&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('Grading [_1] for [_2] at [_3]',
+ &Apache::lonnet::gettitle($symb),$uname,$udom).'
';
$form_tag_start.=
'';
@@ -643,6 +845,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.").
@@ -689,26 +896,42 @@ sub start_Task {
$result.='';
}
- if ($env{'form.chosensections'}) {
- my @chosen_sections=
- &Apache::loncommon::get_env_multiple('form.chosensections');
+ if ($env{'form.chosensections'} || §ion_restricted()) {
+ my @chosen_sections = &get_allowed_sections();
foreach my $sec (@chosen_sections) {
$result.='';
}
}
if ($webgrade eq 'yes') { $result.=&webgrade_standard_info(); }
+ } elsif ($target eq 'webgrade'
+ && $env{'request.state'} eq 'construct') {
+ $result.=$form_tag_start;
+ $result.='';
+ $result.=&webgrade_standard_info();
}
if ($target eq 'webgrade') {
$result.="\n".'
';
+ &Apache::lonxml::startredirection();
+ &start_delay();
+ $dimension{$top}{'result'}=$result;
+ undef($result);
}
} elsif ($target eq 'edit') {
$result.=$form_tag_start.
&Apache::structuretags::problem_edit_header();
$Apache::lonxml::warnings_error_header=
&mt("Editor Errors - these errors might not effect the running of the problem, but they will likely cause problems with further use of the Edit mode. Please use the EditXML mode to fix these errors.")." ";
- my $temp=&Apache::edit::insertlist($target,$token);
- $result.=$temp;
+ $result.= &Apache::edit::text_arg('Required number of passed optional elements to pass the Task:','OptionalRequired',$token,10)." \n";
+ $result.= &Apache::edit::insertlist($target,$token);
+ } elsif ($target eq 'modified') {
+ my $constructtag=
+ &Apache::edit::get_new_args($token,$parstack,$safeeval,
+ 'OptionalRequired');
+ if ($constructtag) {
+ $result = &Apache::edit::rebuild_tag($token);
+ }
} else {
# page_start returned a starting result, delete it if we don't need it
$result = '';
@@ -734,6 +957,12 @@ sub get_key_todo {
my ($target)=@_;
my $todo;
+ if ($env{'request.state'} eq 'construct') {
+ my ($symb,$cid,$udom,$uname) = &Apache::lonnet::whichuser();
+ my $gradingkey=&encode_queue_key($symb,$udom,$uname);
+ return ($gradingkey);
+ }
+
if (defined($env{'form.reviewasubmission'})) {
&Apache::lonxml::debug("review a submission....");
$env{'form.queue'}='reviewqueue';
@@ -759,12 +988,19 @@ sub get_key_todo {
if (defined($env{'form.regradeaspecificsubmission'}) &&
defined($env{'form.gradinguser'}) &&
defined($env{'form.gradingdomain'}) ) {
- my ($symb,$cid)=&Apache::lonxml::whichuser();
+ my ($symb,$cid)=&Apache::lonnet::whichuser();
my $cnum = $env{'course.'.$cid.'.num'};
my $cdom = $env{'course.'.$cid.'.domain'};
- my $uname = $env{'form.gradinguser'};
- my $udom = $env{'form.gradingdomain'};
-
+ my $uname = &LONCAPA::clean_username($env{'form.gradinguser'});
+ my $udom = &LONCAPA::clean_domain($env{'form.gradingdomain'});
+
+ if (§ion_restricted()) {
+ my $classlist=&get_limited_classlist();
+ if (!&allow_grade_user($classlist->{$uname.':'.$udom})) {
+ return (undef,'not_allowed',
+ &mt("Requested student ([_1]) is in a section you aren't allowed to grade.",$uname.':'.$udom));
+ }
+ }
my $gradingkey=&encode_queue_key($symb,$udom,$uname);
my $queue;
@@ -834,6 +1070,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');
}
@@ -879,13 +1117,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)
@@ -915,32 +1157,44 @@ 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".'
You did not pass the '.$title.' given on '.
- $start_time.'
';
+ $status.='
'
+ .&mt('You did not pass the [_1] given on [_2].',$title,$start_time)
+ .'
';
+ $status.=$question_status;
if (!$previous) {
$status.=&add_request_another_attempt_button();
}
}
- my $man_count=0;
- my $opt_count=0;
- my $opt_passed=0;
- foreach my $dim (keys(%Apache::bridgetask::top_dimensionlist)) {
- if ($Apache::bridgetask::top_dimensionlist{$dim}{'manadatory'}
- eq 'N') {
- $opt_count++;
- if ($Apache::lonhomework::history{"resource.$version.0.$dim.status"} eq 'pass') {
- $opt_passed++;
- }
- } else {
- $man_count++;
+
+ $status.="\n".'
'."\n";
+
+ foreach my $id (@{$dimension{$dim}{'criterias'}}) {
+ my $type = $dimension{$dim}{'criteria.'.$id.'.type'};
+ if ($type eq 'dimension') {
+ $result.=$dimension{$id}{'result'};
+ next;
}
+ my $criteria =
+ &nested_parse(\$dimension{$dim}{'criteria.'.$id},
+ [@_]);
+ $status .= &layout_web_Criteria($dim,$id,$criteria);
}
-
- 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, of which you passed [_4].',$man_count,$opt_req,$opt_count,$opt_passed)."
\n";
my $internal_location=&internal_location();
$result=~s/\Q$internal_location\E/$status/;
}
$result.="\n
";
#$result.=' ';
#$result.='{$student}[&Apache::loncoursedata::CL_SECTION()];
- if (! grep($section,@{ $sections })) {
+ if (! grep {$_ eq $section} (@{ $sections })) {
delete($classlist->{$student});
}
}
@@ -1333,18 +1688,19 @@ sub get_limited_classlist {
sub show_queue {
my ($queue,$with_selects)=@_;
my $result;
- my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
+ my ($symb,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
my $cnum=$env{'course.'.$cid.'.num'};
my $cdom=$env{'course.'.$cid.'.domain'};
- my @chosen_sections=
- &Apache::loncommon::get_env_multiple('form.chosensections');
+ my @chosen_sections = &get_allowed_sections();
my $classlist = &get_limited_classlist(\@chosen_sections);
if (!(grep(/^all$/,@chosen_sections))) {
- $result.='
Showing only sections '.join(', ',@chosen_sections).
- '.
".
+ $result.=
&Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row();
- if ($with_selects) { $result.="
Status
"; }
- $result.="
user
data
".
+ if ($with_selects) { $result.='
'.&mt('Status').'
'; }
+ $result.='
'.&mt('User').'
'.&mt('Data').'
'.
&Apache::loncommon::end_data_table_header_row();
foreach my $key (sort(keys(%queue))) {
my ($symb,$uname,$udom) = &decode_queue_key($key);
- if (!defined($classlist->{$uname.':'.$udom})) { next; }
+ next if (!defined($classlist->{$uname.':'.$udom}));
+ next if (!&allow_grade_user($classlist->{$uname.':'.$udom}));
my $section = $classlist->{$uname.':'.$udom}[&Apache::loncoursedata::CL_SECTION()];
@@ -1412,9 +1774,16 @@ sub show_queue {
my $ekey=&escape($key);
my ($action,$description,$status)=('select',&mt('Select'));
if (exists($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]',$queue{"$key\0locked"});
- if ($me eq $queue{"$key\0locked"}) {
+ $status=&mt('Locked by [_1] [_2]',''.$locker.'',$time);
+ if ($me eq $locker) {
($action,$description)=('resume',&mt('Resume'));
} else {
($action,$description)=('unlock',&mt('Unlock'));
@@ -1429,7 +1798,7 @@ sub show_queue {
$result.=(<