--- loncom/homework/bridgetask.pm 2005/08/15 19:41:16 1.41
+++ loncom/homework/bridgetask.pm 2005/09/14 21:03:48 1.48
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.41 2005/08/15 19:41:16 albertel Exp $
+# $Id: bridgetask.pm,v 1.48 2005/09/14 21:03:48 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -148,8 +148,6 @@ sub add_grading_button {
&mt("Get a submission to grade").'" />';
$result.=' ';
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
- # FIXME need a permission for limiting this to 'powerful users'
-
my ($entries,$ready,$locks)=&get_queue_counts('gradingqueue');
$result.='
'.&mt("Grading Queue has [_1] entries. [_2] of them are ready to be graded and [_3] of them are currently being graded",$entries,$ready,$locks);
@@ -464,7 +462,10 @@ sub end_Task {
$result.="\n".'
'.
&Apache::inputtags::file_selector("$version.0",
"bridgetask","*",
- 'portfolioonly').
+ 'portfolioonly',
+ '
+'.&mt('Submit Portfolio Files for Grading').'
+'.&mt('Indicate the files from your portfolio to be evaluated in grading this task.').'
').
"
";
$result.=&Apache::inputtags::gradestatus('0');
}
@@ -986,7 +987,10 @@ sub get_instance {
my $instance=&get_instance();
my $version=&get_version();
if ($target eq 'web') {
- $result=$dimension{'intro'}.$dimension{$instance.'.text'};
+ @Apache::scripttag::parser_env = @_;
+ $result.=&Apache::scripttag::xmlparse($dimension{'intro'});
+ @Apache::scripttag::parser_env = @_;
+ $result.=&Apache::scripttag::xmlparse($dimension{$instance.'.text'});
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'pass' ||
$Apache::lonhomework::history{"resource.$version.status"} eq 'fail') {
foreach my $id (@{$dimension{$instance.'.criterias'}}) {
@@ -1009,20 +1013,28 @@ sub get_instance {
}
}
} elsif ($target eq 'webgrade') {
+ # in case of any side effects that we need
+ @Apache::scripttag::parser_env = @_;
+ &Apache::scripttag::xmlparse($dimension{'intro'});
+ @Apache::scripttag::parser_env = @_;
+ &Apache::scripttag::xmlparse($dimension{$instance.'.text'});
foreach my $id (@{$dimension{$instance.'.criterias'}}) {
my $link='criteria_'.$instance.'_'.$id;
my $status=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"};
$result.=''.
' '.
' '.
- ' '.
+ ' '.
#$dimension{$instance.'.criteria.'.$id}.
' '.
'Additional Comment for Student '.
''.
' '.
''.
- ' '.&mt('Ungraded').' '.
+ ' '.&mt('Ungraded').' '.
' '.&mt('Pass').' '.
' '.&mt('Fail').' '.
' '.&mt('Review').' '.
@@ -1038,12 +1050,12 @@ sub get_instance {
$result.=' ';
my (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser();
my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio';
- foreach my $partial_file (split(',',$Apache::lonhomework::history{"resource.$version.bridgetask.portfiles"})) {
+ foreach my $partial_file (split(',',$Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"})) {
my $file=$file_url.$partial_file;
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file);
- $result.=' '.$file.
- ' ';
+ ' ';
}
$result.=' ';
$last_link=$link;
@@ -1066,7 +1078,7 @@ sub get_instance {
} elsif ($status eq 'ungraded') {
$ungraded++;
} else {
- &Apache::lonxml::error("got weird status --$status--");
+ $ungraded++;
}
}
if ($optional_passed < $dimension{$instance.'.optionalrequired'}) {
@@ -1095,22 +1107,18 @@ sub start_IntroParagraph {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $result;
if ($target eq 'web' || $target eq 'webgrade') {
- if ($tagstack->[-2] eq 'Dimension' || $target eq 'webgrade') {
- &Apache::lonxml::startredirection();
+ if ($tagstack->[-2] eq 'Dimension') {
+ $dimension{'intro'}=&Apache::lonxml::get_all_text('/introparagraph',$parser);
+
+ } elsif ($target eq 'webgrade') {
+ &Apache::lonxml::get_all_text('/introparagraph',$parser);
}
+
}
return $result;
}
sub end_IntroParagraph {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- my $result;
- if ($target eq 'web' || $target eq 'webgrade') {
- if ($tagstack->[-2] eq 'Dimension' || $target eq 'webgrade') {
- $dimension{'intro'}=&Apache::lonxml::endredirection();
- }
- }
- return $result;
}
sub start_Instance {
@@ -1125,40 +1133,27 @@ sub start_Instance {
}
sub end_Instance {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- return '';
}
sub start_InstanceText {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my $instance_id=$Apache::bridgetask::instance[-1];
+ my $text=&Apache::lonxml::get_all_text('/instancetext',$parser);
if ($target eq 'web' || $target eq 'webgrade') {
- &Apache::lonxml::startredirection();
+ $dimension{$instance_id.'.text'}=$text;
}
return '';
}
sub end_InstanceText {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- my $instance_id=$Apache::bridgetask::instance[-1];
- if ($target eq 'web' || $target eq 'webgrade') {
- $dimension{$instance_id.'.text'}=&Apache::lonxml::endredirection();
- }
return '';
}
sub start_Criteria {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') {
- &Apache::lonxml::startredirection();
- }
- return '';
-}
-
-sub end_Criteria {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $instance_id=$Apache::bridgetask::instance[-1];
+ my $criteria=&Apache::lonxml::get_all_text('/criteria',$parser);
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') {
- my $criteria=&Apache::lonxml::endredirection();
my $id=&get_id($parstack,$safeeval);
$dimension{$instance_id.'.criteria.'.$id}=$criteria;
$dimension{$instance_id.'.criteria.'.$id.'.mandatory'}=
@@ -1168,17 +1163,21 @@ sub end_Criteria {
return '';
}
+sub end_Criteria {
+}
+
sub proctor_validation_screen {
my ($slot) = @_;
my (undef,undef,$domain,$user) = &Apache::lonxml::whichuser();
my $url=&Apache::lonnet::studentphoto($domain,$user,'jpg');
- $user=$env{'form.proctorname'};
- if ($env{'form.proctordomain'}) { $domain=$env{'form.proctordomain'}; }
+ my $name=&Apache::loncommon::plainname($user,$domain);
+
my $msg;
if ($env{'form.proctorpassword'}) {
$msg=''.&mt("Failed to authenticate the proctor.")
.'
';
}
+ if (!$env{'form.proctordomain'}) { $env{'form.proctordomain'}=$domain; }
my $result= (<Proctor Validation
Your room's proctor needs to validate your access to this resource.
@@ -1187,13 +1186,22 @@ sub proctor_validation_screen {
-Student who should be logged in is:
-
+
+
+
+ Student who should be logged in is:
+ Name: $name
+ Student ID: $env{'environment.id'}
+ Usename $user\@$domain
+
+
+
+
ENDCHECKOUT
return $result;