\E)/
$1$idprefix$2$3$4/g;
+ $output=~
+ s/(\Q
)/$1$idprefix$2$3$4/g;
if ($nuploads) {
$output=~
s/\<(input[^\>]+name=\"\Q$prefix\EHWFILE[^\>]+)\s*id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\)]*)\>/\<$1 id="$prefix$2" $3\>/gsi;
@@ -381,6 +415,8 @@ ENDEXT
}
$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;
}
$thisdir=~s/\/[^\/]*$//;
foreach (@rlinks) {
@@ -431,6 +467,22 @@ ENDEXT
if (($nforms) && ($nuploads)) {
$allscript .= &Apache::lonhtmlcommon::file_submissionchk_js(\%turninpaths,\%multiresps);
}
+ if (($nforms) && (&Apache::lonhtmlcommon::htmlareabrowser())) {
+ my %textarea_args = (
+ dragmath => 'math',
+ );
+ $allscript .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);
+ }
+ if ($ntimers) {
+ $allscript .= '\n";
+ }
# ------------------------------------------------------------------ Start body
$r->print(&Apache::loncommon::start_page(undef,$allscript,
{'force_register' => 1,
@@ -447,7 +499,7 @@ ENDEXT
}
$fmtag .= ' action="'.
&Apache::lonenc::check_encrypt($requrl)
- .'">';
+ .'" id="LC_page">';
$r->print($fmtag);
}
} elsif (($target eq 'tex') || ($target eq 'tex_answer')) {
@@ -480,7 +532,6 @@ ENDEXT
my $avespan=$lcm/($#colcont+1);
for ($j=0;$j<=$#colcont;$j++) {
my $rid=$colcont[$j];
-
my $metainfo =&get_buttons(\%hash,$rid).' ';
unless (($target eq 'tex') || ($target eq 'tex_answer')) {
$r->print(' | print('>'.$metainfo.'');
} elsif (&Apache::lonnet::declutter($hash{'src_'.$rid}) !~/\.(sequence|page)$/) {
- $r->print($metainfo.''.$hash{'title_'.$rid}.' '.
- &mt('It is recommended that you use an up-to-date virus scanner before handling this file.').''.
- &Apache::londocs::entryline(0,&mt("Click to download or use your browser's Save Link function"),'/'.&Apache::lonnet::declutter($hash{'src_'.$rid})).' ');
+ $r->print($metainfo.''.$hash{'title_'.$rid}.' ');
+ unless ($cellemb{$rid} eq 'wrp') {
+ $r->print(&mt('It is recommended that you use an up-to-date virus scanner before handling this file.'));
+ }
+ $r->print(''.
+ &Apache::londocs::entryline(0,
+ &mt("Click to download or use your browser's Save Link function"),
+ '/'.&Apache::lonnet::declutter($hash{'src_'.$rid})).
+ ' ');
}
unless (($target eq 'tex') || ($target eq 'tex_answer')) {
$r->print(' | ');
@@ -554,9 +611,19 @@ ENDEXT
}
# ---------------------------------------------------------------- Submit, etc.
if ($nforms) {
+ my $class;
+ if ($nforms > 1) {
+ $class = ' class="LC_hwk_submit"';
+ if ($ntimers) {
+ $nforms = 1;
+ $class = '';
+ }
+ }
$r->print(
- '
');
+ '
'.
+ '
'.
+ &mt('Processing your submission ...').'
');
}
unless (($target eq 'tex') || ($target eq 'tex_answer')) {
$r->print(&Apache::loncommon::end_page({'discussion'
@@ -601,6 +668,11 @@ sub get_buttons {
my $symb=&Apache::lonnet::encode_symb($hash->{'map_id_'.$mapid},
$resid,
$hash->{'src_'.$rid});
+ unless ($env{'request.role.adv'}) {
+ if (&Apache::lonnet::EXT('resource.0.buttonshide',$symb)) {
+ return;
+ }
+ }
if ($hash->{'encrypted_'.$rid}) {
$symb=&Apache::lonenc::encrypted($symb);
$esrc=&Apache::lonenc::encrypted($esrc);
@@ -612,7 +684,9 @@ sub get_buttons {
|| !$hash->{'encrypted_'.$rid})) {
$metainfo .='
'.
'
'.
- ''.
+ ''.
'';
}
if (($hash->{'src_'.$rid} !~ m{^/uploaded/}) &&
@@ -620,7 +694,9 @@ sub get_buttons {
$metainfo .= '
'.
- ''.
+ ''.
'';
}
if (($hash->{'src_'.$rid}=~/$LONCAPA::assess_re/) &&
@@ -631,12 +707,16 @@ sub get_buttons {
'
'.
'&command=submission">'.
- ''.
+ ''.
''.
'
'.
'&command=gradingmenu">'.
- ''.
+ ''.
'';
}
if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) {
@@ -644,10 +724,32 @@ sub get_buttons {
'
'.
'" >'.
- ''.
+ ''.
'';
}
}
+ if (($env{'request.course.id'}) && (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $file=&Apache::lonnet::declutter($hash->{'src_'.$rid});
+ my ($cfile,$home,$switchserver,$forceedit,$forceview) =
+ &Apache::lonnet::can_edit_resource($file,$cnum,$cdom,$hash->{'src_'.$rid},$symb);
+ if ($cfile ne '') {
+ my $jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver,
+ $forceedit,1,$symb,undef,
+ &escape($env{'form.title'}));
+ if ($jscall) {
+ my $icon = 'pcstr.png';
+ my $label = &mt('Edit');
+ my $title = &mt('Edit this resource');
+ my $pic = '
';
+ $metainfo .= '
'.$pic.'';
+ }
+ }
+ }
return $metainfo;
}