[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 17 Jul 2006 20:35:11 -0000
albertel Mon Jul 17 16:35:11 2006 EDT
Modified files:
/loncom/homework bridgetask.pm
Log:
- when regrading users and then need to be reinserted into the queue need to recreate the queue_data that originally was there
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.180 loncom/homework/bridgetask.pm:1.181
--- loncom/homework/bridgetask.pm:1.180 Wed Jun 28 17:46:53 2006
+++ loncom/homework/bridgetask.pm Mon Jul 17 16:35:11 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.180 2006/06/28 21:46:53 albertel Exp $
+# $Id: bridgetask.pm,v 1.181 2006/07/17 20:35:11 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -152,11 +152,14 @@
} elsif ($type eq 'problem') {
&Apache::lonxml::debug("authed $slot_name");
}
-
- if (defined($user) && defined($domain)) {
- $Apache::lonhomework::results{"resource.$id.checkedin"}=
- $user.':'.$domain;
+ 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;
@@ -1060,6 +1063,17 @@
&Apache::loncommon::end_page({'discussion' => 1});
}
}
+
+ my $useslots = &Apache::lonnet::EXT("resource.0.useslots");
+ my %queue_data = ('type' => 'Task',
+ 'time' => time,);
+ if (defined($Apache::inputtags::slot_name)) {
+ $queue_data{'slot'} = $Apache::inputtags::slot_name;
+ } elsif (defined($Apache::lonhomework::history{"resource.$version.0.checkedin.slot"})) {
+ $queue_data{'slot'} = $Apache::lonhomework::history{"resource.$version.0.checkedin.slot"};
+ }
+
+
if ($target eq 'grade' && !$env{'form.webgrade'} && !$previous) {
my $award='SUBMITTED';
&Apache::essayresponse::file_submission("$version.0",'bridgetask',
@@ -1082,17 +1096,7 @@
&Apache::lonhomework::showhash(%Apache::lonhomework::results);
&Apache::structuretags::finalize_storage();
if ($award eq 'SUBMITTED') {
- my $useslots = &Apache::lonnet::EXT("resource.0.useslots");
- if ($useslots =~ /^\s*no\s*$/i) {
- &add_to_queue('gradingqueue',
- {'type' => 'Task',
- 'time' => time});
- } elsif (defined($Apache::inputtags::slot_name)) {
- &add_to_queue('gradingqueue',
- {'type' => 'Task',
- 'time' => time,
- 'slot' => $Apache::inputtags::slot_name});
- }
+ &add_to_queue('gradingqueue',\%queue_data);
}
} elsif ($Apache::lonhomework::results{'INTERNAL_store'}) {
&Apache::structuretags::finalize_storage();
@@ -1140,14 +1144,20 @@
&check_queue_unlock($env{'form.queue'});
&Apache::lonxml::debug(" still needs review not changing status.");
} else {
- &move_between_queues($env{'form.queue'},'reviewqueue');
+ if ($env{'form.queue'} ne 'none') {
+ &move_between_queues($env{'form.queue'},'reviewqueue');
+ } else {
+ &add_to_queue('reviewqueue',\%queue_data);
+ }
}
} elsif ($ungraded) {
$Apache::lonhomework::results{"resource.$version.0.status"}='ungraded';
- if ($env{'form.queue'} eq 'reviewqueue' ||
- $env{'form.queue'} eq 'none' ) {
+ if ($env{'form.queue'} eq 'reviewqueue') {
&Apache::lonxml::debug("moving back.");
- &move_between_queues($env{'form.queue'},'gradingqueue');
+ &move_between_queues($env{'form.queue'},
+ 'gradingqueue');
+ } elsif ($env{'form.queue'} eq 'none' ) {
+ &add_to_queue('gradingqueue',\%queue_data);
} else {
&check_queue_unlock($env{'form.queue'});
}