--- loncom/homework/bridgetask.pm 2005/04/05 15:39:41 1.10
+++ loncom/homework/bridgetask.pm 2005/05/10 20:58:38 1.23
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.10 2005/04/05 15:39:41 albertel Exp $
+# $Id: bridgetask.pm,v 1.23 2005/05/10 20:58:38 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,25 +48,34 @@ sub initialize_bridgetask {
$Apache::bridgetask::dimension='';
# list of all Dimension ids seen
@Apache::bridgetask::dimensionlist=();
+ # mandatory attribute of all Dimensions seen
+ %Apache::bridgetask::dimensionmandatory=();
# list of all current Instance ids
@Apache::bridgetask::instance=();
# list of all Instance ids seen in this problem
@Apache::bridgetask::instancelist=();
+ # key of queud user data that we are currently grading
+ $Apache::bridgetask::queue_key='';
}
sub proctor_check_auth {
- my ($slot)=@_;
- my $user=$ENV{'form.proctorname'};
- my $domain=$ENV{'form.proctordomain'};
+ my ($slot_name,$slot)=@_;
+ my $user=$env{'form.proctorname'};
+ my $domain=$env{'form.proctordomain'};
my @allowed=split(",",$slot->{'proctor'});
foreach my $possible (@allowed) {
my ($puser,$pdom)=(split('@',$possible));
if ($puser eq $user && $pdom eq $domain) {
- my $authhost=&Apache::lonnet::authenticate($puser,$ENV{'form.proctorpassword'},$pdom);
+ my $authhost=&Apache::lonnet::authenticate($puser,$env{'form.proctorpassword'},$pdom);
if ($authhost ne 'no_host') {
- $Apache::lonhomework::results{'resource.checkedin'}=
+ my $version=
+ $Apache::lonhomework::results{'resource.version'}=
+ $Apache::lonhomework::history{'resource.version'}++;
+ $Apache::lonhomework::results{"resource.$version.checkedin"}=
$user.'@'.$domain;
+ $Apache::lonhomework::results{"resource.$version.checkedin.slot"}=
+ $slot_name;
return 1;
}
}
@@ -82,28 +91,49 @@ sub add_previous_version_button {
return $result;
}
+sub add_grading_button {
+ my $result;
+ $result.=' ';
+ $result.='';
+ return $result;
+}
+
+sub add_request_another_attempt_button {
+
+}
+
sub start_Task {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- &Apache::structuretags::initialize_storage();
- &Apache::lonhomework::showhash(%Apache::lonhomework::history);
-
my ($status,$accessmsg,$slot);
+ if ($target ne 'webgrade') {
+ &Apache::structuretags::initialize_storage();
+ &Apache::lonhomework::showhash(%Apache::lonhomework::history);
+ }
+
$Apache::lonhomework::parsing_a_task=1;
#should get back a or the neccesary stuff to start XML/MathML
my ($result,$head_tag_start,$body_tag_start,$form_tag_start)=
&Apache::structuretags::page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);
-
+
if ($target eq 'web') {
$body_tag_start.=&add_previous_version_button();
+ if ($Apache::lonhomework::modifygrades) {
+ $body_tag_start.='
'.&mt('Your submission is in the grading queue.').'
';
} elsif ($status ne 'NOT_YET_VIEWED') {
$msg.='
'.&mt('Not open to be viewed').'
';
}
@@ -137,12 +170,15 @@ sub start_Task {
} else {
$result.=&mt('Problem is not open to be viewed. It')." $accessmsg \\vskip 0 mm ";
}
- } elsif ($target eq 'grade') {
+ } elsif ($target eq 'grade' && !$env{'form.webgrade'}) {
if ($status eq 'NEEDS_CHECKIN') {
- if (&proctor_check_auth($slot)) {
+ if (&proctor_check_auth($slot_name,$slot)) {
#FIXME immeadiatly add this to the grading queue
# with slot->{'endtime'} for when grading can
# begin on this resource
+ # FIXME I think the above is done by default,
+ # need to check that
+ # failure doesn't do this.
}
}
}
@@ -152,12 +188,45 @@ sub start_Task {
$body_tag_start \n $form_tag_start".
'';
# if we are viewing someone else preserve that info
- if (defined $ENV{'form.grade_symb'}) {
+ if (defined $env{'form.grade_symb'}) {
foreach my $field ('symb','courseid','domain','username') {
$result .= ''."\n";
+ '" value="'.$env{"form.grade_$field"}.'" />'."\n";
}
}
+ if ($Apache::lonhomework::history{'resource.status'} eq 'fail') {
+ $result.='