\E)/
$1$idprefix$2$3$4/g;
+ $output=~
+ s/(\Q
)/$1$idprefix$2$3$4/g;
+ if ($nuploads) {
+ ($turninpaths{$prefix},$multiresps{$prefix}) =
+ &Apache::loncommon::get_turnedin_filepath($symb,$env{'user.name'},$env{'user.domain'});
+ if ($turninparent eq '') {
+ $turninparent = $turninpaths{$prefix};
+ $turninparent =~ s{(/[^/]+)$}{};
+ }
+ }
+ $output=~
+ s/\<((?:input|select)[^\>]+\Qjavascript:setSubmittedPart\E)\(\s*[\'\"]([^\'\"]+)[\'\"]*\s*\)/\<$1('$2','$prefix')/gsi;
+ $output=~
+ s/\<(input[^\>]+\Qonfocus=\"javascript:disableAutoComplete\E)\(\'([^\']+)\'\)(;\")/\<$1('$idprefix$2')$3/gsi;
+ unless ($hastimer) {
+ if ($plainsrc =~ /$LONCAPA::assess_re/) {
+ %Apache::lonhomework::history =
+ &Apache::lonnet::restore($symb,$courseid,$domain,$name);
+ my $type = 'problem';
+ if ($extension eq 'task') {
+ $type = 'Task';
+ }
+ my ($status,$accessmsg,$slot_name,$slot) =
+ &Apache::lonhomework::check_slot_access('0',$type,$symb);
+ undef(%Apache::lonhomework::history);
+ my $probstatus = &Apache::lonnet::EXT("resource.0.problemstatus",$symb);
+ if (($status eq 'CAN_ANSWER') || (($status eq 'CANNOT_ANSWER') &&
+ (($probstatus eq 'no') || ($probstatus eq 'no_feedback_ever')))) {
+ my ($slothastime,$timerhastime);
+ if ($slot_name ne '') {
+ if (ref($slot) eq 'HASH') {
+ if (($slot->{'starttime'} < $now) &&
+ ($slot->{'endtime'} > $now)) {
+ $slothastime = $now - $slot->{'endtime'};
+ }
+ }
+ }
+ my $duedate = &Apache::lonnet::EXT("resource.0.duedate",$symb);
+ my @interval=&Apache::lonnet::EXT("resource.0.interval",$symb);
+ if (@interval > 1) {
+ my $first_access=&Apache::lonnet::get_first_access($interval[1],$symb);
+ if ($first_access > 0) {
+ my $timeremains = $first_access+$interval[0] - $now;
+ if ($timeremains > 0) {
+ $timerhastime = $timeremains;
+ }
+ }
+ }
+ if (($duedate && $duedate > $now) ||
+ (!$duedate && $timerhastime > 0) ||
+ ($slot_name ne '' && $slothastime)) {
+ if ((@interval > 1 && $timerhastime) ||
+ ($type eq 'Task' && $slothastime)) {
+ $countdowndisp{$symb} = 'inline';
+ if ((@interval > 1) && ($timerhastime)) {
+ $hastimeleft{$symb} = $timerhastime;
+ } else {
+ $hastimeleft{$symb} = $slothastime;
+ }
+ } else {
+ $hastimeleft{$symb} = $duedate - $now;
+ $countdowndisp{$symb} = 'none';
+ }
+ }
+ }
+ }
+ }
}
$thisdir=~s/\/[^\/]*$//;
foreach (@rlinks) {
- unless (($_=~/^http:\/\//i) ||
+ unless (($_=~/^https?\:\/\//i) ||
($_=~/^\//) ||
($_=~/^javascript:/i) ||
($_=~/^mailto:/i) ||
@@ -450,6 +575,28 @@ sub handler {
$output=~s/(\"|\'|\=\s*)$_(\"|\'|\s|\>)/$1$newlocation$2/;
}
}
+ foreach my $css_href (@css_hrefs) {
+ next if ($css_href eq '');
+ unless ($css_href =~ m{https?://}) {
+ my $proburl = &Apache::lonnet::clutter($plainsrc);
+ unless ($css_href =~ m{^/}) {
+ my $probdir = $proburl;
+ $probdir=~s/\/[^\/]*$//;
+ $css_href = &Apache::lonnet::hreflocation($probdir,$css_href);
+ }
+ if ($css_href =~ m{^/(res|uploaded)/}) {
+ unless (($env{'httpref.'.$css_href}) ||
+ ($httpref{'httpref.'.$css_href}) ||
+ (&Apache::lonnet::is_on_map($css_href))) {
+ if ($env{'httpref.'.$proburl}) {
+ $proburl = $env{'httpref.'.$proburl};
+ }
+ $httpref{'httpref.'.$css_href} = $proburl;
+ }
+ }
+ }
+ $cssrefs{$css_href} = 1;
+ }
# -------------------------------------------------- Deal with Applet codebases
$output=~s/(\ |