--- loncom/homework/bridgetask.pm 2006/06/14 15:47:58 1.172
+++ loncom/homework/bridgetask.pm 2007/01/10 21:46:24 1.216
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: bridgetask.pm,v 1.172 2006/06/14 15:47:58 albertel Exp $
+# $Id: bridgetask.pm,v 1.216 2007/01/10 21:46:24 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,16 +43,16 @@ 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;
+my $top = 'top';
+
sub initialize_bridgetask {
# id of current Dimension, 0 means that no dimension is current
# (inside '."\n";
- $result.='';
+ $entries,$ready,$locks).''."\n\t\t".''."\n";
+ $result.="\n\t\t".' '.
+ "\n\t\t".'';
+ $result.= "\n\t\t".'';
$result.=&Apache::loncommon::select_dom_form($env{'user.domain'},
'gradingdomain');
$result.=' '.
@@ -237,7 +279,7 @@ sub add_grading_button {
'gradinguser',
'gradingdomain');
$result.=&Apache::loncommon::studentbrowser_javascript();
- $result.= '
'."\n";
- $result.='';
- $result.=' Specify a section: '.$sec_select.' ';
- $result.=''.' '."\n\t\t".' ';
+ $result.="\n\t\t\t".' '."\n";
+ $result.= "\n\t\t\t\t".&mt("[_1] entries, [_2] ready, [_3] being graded",$entries,$ready,$locks).''."\n\t\t".''."\n";
($entries,$ready,$locks)=&get_queue_counts('reviewqueue');
- $result.='Specify a section: '.
+ "\n\t\t\t".''.$sec_select."\n\t\t\t".' ';
+ $result.="\n\t\t\t".''.' ';
- $result.= &mt("[_1] entries, [_2] ready, [_3] being graded",$entries,$ready,$locks).' '."\n";
- $result.=''.
- ' '.
+ "\n\t\t\t".' '.
+ "\n\t\t\t\t".' ';
$result.=&mt("[_1] entries, [_2] ready, [_3] being graded",
- $entries,$ready,$locks).' '.
+ "\n\t\t\t".' '
+ ."\n\t".''."\n";
+ $result.="\n\t".''.
+ "\n\t\t\t\t".' '
+ ."\n\t\t".'
Will be next available: $description
STUFF } if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } $symb=&escape($symb); - $result.=''; + &mt($text).'" />'."\n\t". + ''."\n"; return $result; } @@ -292,9 +335,22 @@ sub style { my ($target) = @_; if ($target eq 'web' || $target eq 'webgrade') { - return (< STYLE + if ($env{'browser.type'} eq 'explorer' + && $env{'browser.os'} eq 'win' ) { + if ($env{'browser.version'} < 7) { + $style .= (< +STYLE + } else { + $style .= (< +STYLE + } + } + return $style; } return; } @@ -316,18 +372,59 @@ sub show_task { return 1; } +my @delay; +sub nest { + if (@delay) { + return $delay[-1]; + } else { + return; + } +} + +sub start_delay { + push(@delay,1); +} +sub end_delay { + pop(@delay); +} + +sub nested_parse { + my ($str,$env,$args) = @_; + my @old_env = @Apache::scripttag::parser_env; + @Apache::scripttag::parser_env = @$env; + if (exists($args->{'set_dim_id'})) { + &enable_dimension_parsing($args->{'set_dim_id'}); + } + push(@delay,(($args->{'delayed_dim_results'})? 1 : 0)); + my $result = &Apache::scripttag::xmlparse($$str); + pop(@delay); + if (exists($args->{'set_dim_id'})) { + &disable_dimension_parsing(); + } + @Apache::scripttag::parser_env = @old_env; + if ($args->{'delayed_dim_results'}) { + my $dim = &get_dim_id(); + &Apache::lonxml::debug(" tossing out $result "); + &Apache::lonxml::debug(" usining out $dim 's ". $dimension{$dim}{'result'}); + return $dimension{$dim}{'result'}; + } + return $result; +} + sub internal_location { my ($id)=@_; return ''; } 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; } } my $result; @@ -338,16 +435,18 @@ sub submission_time_stamp { my ($color,$when)=('#FF6666','after'); if ($diff > 0) { ($color,$when)=('#336600','before'); } my $info; + $diff = abs($diff); if ($diff%60) { $info=($diff%60).' seconds'; } $diff=int($diff/60); if ($diff%60) { $info=($diff%60).' minutes '.$info; } $diff=int($diff/60); if ($diff) { $info=$diff.' hours '.$info; } $result=''. - &mt('Student submitted [_1] [_2] the deadline. - (Submission was at [_3], end of period was [_4].)', - $info,$when,scalar(localtime($submissiontime)), - scalar(localtime($slot{'endtime'}))). + &mt('Student submitted [_1] [_2] the deadline. '. + '(Submission was at [_3], end of period was [_4].)', + $info,$when, + &Apache::lonlocal::locallocaltime($submissiontime), + &Apache::lonlocal::locallocaltime($slot{'endtime'})). '
'; } return $result; @@ -356,7 +455,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/'; @@ -417,7 +516,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 = '