'.
+ &mt('Grading [_1] for [_2] at [_3]',
+ &Apache::lonnet::gettitle($symb),$uname,$udom).'
';
$form_tag_start.=
'';
@@ -847,6 +869,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';
@@ -1039,7 +1067,7 @@ sub end_Task {
}
if (!$previous && $status ne 'SHOW_ANSWER' &&
&show_task($status,$previous)) {
- $result.=&Apache::inputtags::gradestatus('0');
+ $result.=&Apache::inputtags::gradestatus('0',$target,1);
}
$result.='';
@@ -1057,8 +1085,7 @@ DONEBUTTON
if (&show_task($status,$previous) &&
$Apache::lonhomework::history{"resource.$version.0.status"} =~ /^(pass|fail)$/) {
my $bt_status=$Apache::lonhomework::history{"resource.$version.0.status"};
- my $title=&Apache::lonnet::gettitle();
-
+ my $title=&Apache::lonnet::gettitle($env{'request.uri'});
my $start_time;
my $slot_name=
@@ -1535,19 +1562,25 @@ sub show_queue {
}
}
+ $result .=
+ '
'.
+ &mt('Return to resource').'
'.
+ "\n
Current Queue - $queue
";
my $regexp="^$symb\0";
my %queue=&Apache::lonnet::dump($queue,$cdom,$cnum,$regexp);
my ($tmp)=%queue;
if ($tmp=~/^error: 2 /) {
- return "\n
Current Queue - $queue
".
+ $result.=
+
&Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_row().
'
'.&mt('Empty').' | '.
&Apache::loncommon::end_data_table_row().
&Apache::loncommon::end_data_table();
+ return $result;
}
my $title=&Apache::lonnet::gettitle($symb);
- $result.="\n
Current Queue - $title $queue
".
+ $result.=
&Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row();
if ($with_selects) { $result.="
Status | | "; }
@@ -1555,7 +1588,8 @@ sub show_queue {
&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 (§ion_restricted($classlist->{$uname.':'.$udom}));
my $section = $classlist->{$uname.':'.$udom}[&Apache::loncoursedata::CL_SECTION()];
@@ -1641,6 +1675,18 @@ FORM
return $result;
}
+sub section_restricted {
+ my ($classlist_entry) = @_;
+ my $cid =(&Apache::lonnet::whichuser())[1];
+ if (lc($env{'course.'.$cid.'.task_grading'}) eq 'section'
+ && $env{'request.course.sec'}
+ && $env{'request.course.sec'} ne
+ $classlist_entry->[&Apache::loncoursedata::CL_SECTION()]) {
+ return 1;
+ }
+ return 0;
+}
+
sub get_queue_counts {
my ($queue)=@_;
my $result;
@@ -1656,11 +1702,14 @@ sub get_queue_counts {
if ($tmp=~/^error: 2 /) {
return (0,0,0);
}
+
my ($entries,$ready_to_grade,$locks)=(0,0,0);
my %slot_cache;
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 (§ion_restricted($classlist->{$uname.':'.$udom}));
+
if ($key=~/locked$/) {
$locks++;
} elsif ($key=~/timestamp$/) {
@@ -1737,7 +1786,8 @@ sub pick_from_queue_data {
if ($key =~ /\0timestamp$/) { next; }
my ($symb,$uname,$udom)=&decode_queue_key($key);
- if (!defined($classlist->{$uname.':'.$udom})) { next; }
+ next if (!defined($classlist->{$uname.':'.$udom}));
+ next if (§ion_restricted($classlist->{$uname.':'.$udom}));
if ($check_section) {
my $section =
@@ -1846,7 +1896,7 @@ sub lock_key {
sub get_queue_symb_status {
my ($queue,$symb,$cdom,$cnum) = @_;
if (!defined($cdom) || !defined($cnum)) {
- my (undef,$cid)=&Apache::lonnet::whichuser();
+ my (undef,$cid) =&Apache::lonnet::whichuser();
$cnum=$env{'course.'.$cid.'.num'};
$cdom=$env{'course.'.$cid.'.domain'};
}
@@ -1862,6 +1912,7 @@ sub get_queue_symb_status {
next if ($key=~/timestamp$/);
my ($symb,$uname,$udom) = &decode_queue_key($key);
next if (!defined($classlist->{$uname.':'.$udom}));
+ next if (§ion_restricted($classlist->{$uname.':'.$udom}));
push(@users,"$uname:$udom");
}
return @users;
@@ -2200,8 +2251,8 @@ sub start_Dimension {
$result.=
&Apache::edit::text_arg('Id:','id',$token,10).' '.
&Apache::edit::select_arg('Passing is Mandatory:','Mandatory',
- [['yes', 'Yes'],
- ['no','No'],],
+ [['Y', 'Yes'],
+ ['N','No'],],
$token).'
'.
&Apache::edit::text_arg('Required number of passed optional elements to pass the '.$token->[1].':',
'OptionalRequired',$token,4).
@@ -2665,7 +2716,8 @@ sub end_Setup {
sub grading_history {
my ($version,$dim,$id) = @_;
- if (!&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
+ if (!&Apache::lonnet::allowed('mgq',$env{'request.course.id'})
+ && !&Apache::lonnet::allowed('mgq',$env{'request.course.id'}.'/'.$env{'request.course.sec'})) {
return '';
}
my ($result,$grader);
@@ -2843,8 +2895,8 @@ sub start_Criteria {
$result.=
&Apache::edit::text_arg('Id:','id',$token,10).' '.
&Apache::edit::select_arg('Passing is Mandatory:','Mandatory',
- [['yes', 'Yes'],
- ['no','No'],],
+ [['Y', 'Yes'],
+ ['N','No'],],
$token)
.'
'.&Apache::edit::end_row().
&Apache::edit::start_spanning_row();
@@ -3015,13 +3067,35 @@ sub proctor_validation_screen {
my ($slot) = @_;
my (undef,undef,$domain,$user) = &Apache::lonnet::whichuser();
my $url=&Apache::lonnet::studentphoto($domain,$user,'jpg');
+ if ($url ne '/adm/lonKaputt/lonlogo_broken.gif') {
+ $url = "
|
";
+ } else {
+ undef($url);
+ }
+
my $name=&Apache::loncommon::plainname($user,$domain);
my $msg;
if ($env{'form.proctorpassword'}) {
- $msg='
'.&mt("Failed to authenticate the proctor.")
- .'
';
+ $msg.='
'
+ .&mt("Failed to authenticate the proctor.")
+ .'
';
+ }
+
+ my $valid;
+ my @possible_proctors=split(",",$slot->{'proctor'});
+ foreach my $proctor (@possible_proctors) {
+ if ($proctor =~ /$LONCAPA::username_re:$LONCAPA::domain_re/) {
+ $valid = 1;
+ last;
+ }
}
+ if (!$valid) {
+ $msg.='
'
+ .&mt("No valid poctors are defined.")
+ .'
';
+ }
+
if (!$env{'form.proctordomain'}) { $env{'form.proctordomain'}=$domain; }
my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'});
$uri = &HTML::Entities::encode($uri,'<>&"');
@@ -3045,7 +3119,7 @@ sub proctor_validation_screen {
Name: | $name |
Student ID: | $env{'environment.id'} |
Usename | $user:$domain |
-
|
+ $url