--- loncom/homework/bridgetask.pm 2006/09/28 18:59:11 1.182
+++ loncom/homework/bridgetask.pm 2006/10/31 21:22:33 1.187
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.182 2006/09/28 18:59:11 albertel Exp $
+# $Id: bridgetask.pm,v 1.187 2006/10/31 21:22:33 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,7 +43,7 @@ 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','GraderNote','ClosingParagraph'));
}
my %dimension;
@@ -105,7 +105,7 @@ sub check_in {
sub check_in_sequence {
my ($user,$domain,$slot_name) = @_;
my $navmap = Apache::lonnavmaps::navmap->new();
- my ($symb) = &Apache::lonxml::whichuser();
+ my ($symb) = &Apache::lonnet::whichuser();
my ($map) = &Apache::lonnet::decode_symb($symb);
my @resources =
$navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0);
@@ -225,7 +225,7 @@ sub add_previous_version_button {
}
sub add_grading_button {
- my (undef,$cid)=&Apache::lonxml::whichuser();
+ my (undef,$cid)=&Apache::lonnet::whichuser();
my $cnum=$env{'course.'.$cid.'.num'};
my $cdom=$env{'course.'.$cid.'.domain'};
my %sections = &Apache::loncommon::get_sections($cdom,$cnum);
@@ -388,11 +388,12 @@ sub internal_location {
}
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;
}
@@ -425,7 +426,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/';
@@ -486,7 +487,7 @@ sub done_screen {
my ($version) = @_;
my $title=&Apache::lonnet::gettitle();
my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'});
- my (undef,undef,$domain,$user)= &Apache::lonxml::whichuser();
+ my (undef,undef,$domain,$user)= &Apache::lonnet::whichuser();
my $files = '
';
my $msg;
foreach my $file (@files) {
@@ -830,7 +831,7 @@ 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'};
@@ -1101,8 +1102,6 @@ DONEBUTTON
if ($award eq 'SUBMITTED') {
&add_to_queue('gradingqueue',\%queue_data);
}
- } elsif ($Apache::lonhomework::results{'INTERNAL_store'}) {
- &Apache::structuretags::finalize_storage();
}
if ($target eq 'grade' && $env{'form.webgrade'} eq 'yes'
&& exists($env{'form.cancel'})) {
@@ -1171,7 +1170,7 @@ DONEBUTTON
$Apache::lonhomework::results{"resource.$version.0.awarded"}='0';
&remove_from_queue($env{'form.queue'});
- my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
+ my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser();
if ($env{'form.regrade'} ne 'yes') {
$Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}=
@@ -1189,7 +1188,7 @@ DONEBUTTON
$Apache::lonhomework::results{"resource.$version.0.awarded"}='1';
&remove_from_queue($env{'form.queue'});
- my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
+ my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser();
if ($env{'form.regrade'} ne 'yes') {
$Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}=
$Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"};
@@ -1213,6 +1212,10 @@ DONEBUTTON
&minimize_storage();
&Apache::structuretags::finalize_storage();
}
+ if (exists($Apache::lonhomework::results{'INTERNAL_store'})) {
+ # instance generation occured and hasn't yet been stored
+ &Apache::structuretags::finalize_storage();
+ }
} elsif ($target eq 'webgrade') {
$result.="";
#$result.=' $me},
@@ -1728,7 +1731,7 @@ sub lock_key {
sub get_queue_symb_status {
my ($queue,$symb,$cdom,$cnum) = @_;
if (!defined($cdom) || !defined($cnum)) {
- my (undef,$cid)=&Apache::lonxml::whichuser();
+ my (undef,$cid)=&Apache::lonnet::whichuser();
$cnum=$env{'course.'.$cid.'.num'};
$cdom=$env{'course.'.$cid.'.domain'};
}
@@ -1752,7 +1755,7 @@ sub get_queue_symb_status {
sub get_from_queue {
my ($queue)=@_;
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 $todo=&find_mid_grade($queue,$symb,$cdom,$cnum);
@@ -1828,7 +1831,7 @@ sub get_from_queue {
}
sub select_user {
- my ($symb,$cid)=&Apache::lonxml::whichuser();
+ my ($symb,$cid)=&Apache::lonnet::whichuser();
my @chosen_sections=
&Apache::loncommon::get_env_multiple('form.chosensections');
@@ -2513,9 +2516,31 @@ sub start_Criteria {
sub end_Criteria {
}
+sub start_GraderNote {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+
+ if ($target eq 'webgrade') {
+ return '
'.
+ &mt('Note to graders:').'';
+ }
+ my $note=&Apache::lonxml::get_all_text('/gradernote',$parser,$style);
+ return;
+}
+
+sub end_GraderNote {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+
+ if ($target eq 'webgrade') {
+ return '
';
+ }
+ return;
+}
+
+
+
sub proctor_validation_screen {
my ($slot) = @_;
- my (undef,undef,$domain,$user) = &Apache::lonxml::whichuser();
+ my (undef,undef,$domain,$user) = &Apache::lonnet::whichuser();
my $url=&Apache::lonnet::studentphoto($domain,$user,'jpg');
my $name=&Apache::loncommon::plainname($user,$domain);