--- loncom/homework/bridgetask.pm 2005/10/05 20:24:59 1.68
+++ loncom/homework/bridgetask.pm 2005/10/14 17:27:23 1.71
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.68 2005/10/05 20:24:59 albertel Exp $
+# $Id: bridgetask.pm,v 1.71 2005/10/14 17:27:23 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -317,8 +317,8 @@ sub submission_time_stamp {
my $slot_name=$Apache::lonhomework::history{'resource.'.$version.'.checkedin.slot'};
my %slot=&Apache::lonnet::get_slot($slot_name);
my $diff = $slot{'endtime'} - $submissiontime;
- my ($color,$when)=('red','after');
- if ($diff > 0) { ($color,$when)=('green','before'); }
+ my ($color,$when)=('#FF6666','after');
+ if ($diff > 0) { ($color,$when)=('#336600','before'); }
my $info;
if ($diff%60) { $info=($diff%60).' seconds'; }
$diff=int($diff/60);
@@ -335,11 +335,41 @@ sub submission_time_stamp {
return $result;
}
+sub webgrade_standard_info {
+ my ($version)=&get_version();
+ my (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser();
+ my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio/';
+ my $file_list="
\n";
+ foreach my $partial_file (split(',',$Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"})) {
+ my $file=$file_url.$partial_file;
+ $file=~s|/+|/|g;
+ &Apache::lonnet::allowuploaded('/adm/bridgetask',$file);
+ $file_list.='
'.$file.
+ ' '."\n";
+ }
+ $file_list.="
\n";
+
+ my %lt=&Apache::lonlocal::texthash('done' => 'Done',
+ 'stop' => 'Stop',
+ );
+
+ my $result=<
+
+
+ $file_list
+
+INFO
+ return $result;
+}
+
sub start_Task {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my ($status,$accessmsg,$slot);
if ($target ne 'webgrade') {
+ &Apache::structuretags::init_problem_globals('Task');
&Apache::structuretags::initialize_storage();
&Apache::lonhomework::showhash(%Apache::lonhomework::history);
}
@@ -511,6 +541,7 @@ DONESCREEN
value="'.$sec.'" />';
}
}
+ if ($webgrade eq 'yes') { $result.=&webgrade_standard_info(); }
}
} else {
# page_start returned a starting result, delete it if we don't need it
@@ -618,10 +649,7 @@ sub end_Task {
my ($version,$previous)=&get_version();
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
$target eq 'tex') {
- if (
- (($target eq 'web') && ($env{'request.state'} ne 'construct')) ||
- ($target eq 'answer') || ($target eq 'tex')
- ) {
+ if ($target eq 'web' || $target eq 'answer' || $target eq 'tex') {
if ($target eq 'web') {
if (&show_task($status,$previous)) {
$result.=&Apache::lonxml::endredirection();
@@ -827,9 +855,14 @@ DONEBUTTON
# &mt('Save Partial Grade and Continue Grading').'" /> ';
$result.=''.&Apache::loncommon::endbodytag().'