'."\n";
+ }
return $result;
}
@@ -223,6 +289,12 @@ sub add_request_another_attempt_button {
if (!$text) { $text="Request another attempt"; }
my $result;
my $symb=&Apache::lonnet::symbread();
+ # not a slot access based resource
+ my $useslots = &Apache::lonnet::EXT("resource.0.useslots",$symb);
+ if ($useslots =~ /^\s*no\s*$/i) {
+ return '';
+ }
+
my ($slot_name,$slot)=&Apache::slotrequest::check_for_reservation($symb);
my $action='get_reservation';
if ($slot_name) {
@@ -231,18 +303,19 @@ sub add_request_another_attempt_button {
my $description=&Apache::slotrequest::get_description($slot_name,
$slot);
$result.=(< Will be next available: $description
+
Will be next available: $description
STUFF
}
if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); }
- $symb=&Apache::lonnet::escape($symb);
- $result.='';
+ &mt($text).'" />'."\n\t".
+ ''."\n";
return $result;
}
@@ -262,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;
}
@@ -278,25 +364,67 @@ sub show_task {
( $status eq 'NOT_IN_A_SLOT') ||
( $status eq 'NEEDS_CHECKIN') ||
( $status eq 'WAITING_FOR_GRADE') ||
- ( $status eq 'INVALID_ACCESS') )) {
+ ( $status eq 'INVALID_ACCESS') ||
+ ( &get_version() eq ''))) {
return 0;
}
if ($env{'form.donescreen'}) { return 0; }
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;
@@ -307,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;
@@ -325,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/';
@@ -334,39 +464,112 @@ sub file_list {
my $file=$file_url.$partial_file;
$file=~s|/+|/|g;
&Apache::lonnet::allowuploaded('/adm/bridgetask',$file);
- $file_list.='
+$message_status
+$comment_status
+DONESCREEN
+
+}
+
sub start_Task {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my ($status,$accessmsg,$slot);
+ &Apache::structuretags::init_problem_globals('Task');
if ($target ne 'webgrade') {
- &Apache::structuretags::init_problem_globals('Task');
&Apache::structuretags::initialize_storage();
&Apache::lonhomework::showhash(%Apache::lonhomework::history);
if ($env{'request.state'} eq 'construct') {
@@ -375,28 +578,31 @@ sub start_Task {
}
$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);
-
- $head_tag_start .= &style($target);
- $body_tag_start .= '
'."\n";
+ my $name;
if ($target eq 'web' || $target eq 'webgrade') {
- $head_tag_start.=''.
- &Apache::structuretags::get_resource_name($parstack,$safeeval).
- '';
+ $name = &Apache::structuretags::get_resource_name($parstack,$safeeval);
+ }
+
+ my ($result,$form_tag_start);
+ if ($target eq 'web' || $target eq 'webgrade' || $target eq 'tex'
+ || $target eq 'edit') {
+ ($result,$form_tag_start) =
+ &Apache::structuretags::page_start($target,$token,$tagstack,
+ $parstack,$parser,$safeeval,
+ $name,&style($target));
}
if ($target eq 'web' && $env{'request.state'} ne 'construct') {
- if ($Apache::lonhomework::modifygrades) {
- $body_tag_start.='";
+ $result.=$uri.'">'.&add_grading_button()."\n";
my $symb=&Apache::lonnet::symbread();
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
- $body_tag_start.='