--- loncom/homework/structuretags.pm 2004/10/12 22:55:22 1.270 +++ loncom/homework/structuretags.pm 2004/12/10 17:54:54 1.276 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.270 2004/10/12 22:55:22 albertel Exp $ +# $Id: structuretags.pm,v 1.276 2004/12/10 17:54:54 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -88,7 +88,11 @@ sub page_start { &Apache::lonxml::fontsettings(); } my $body_tag_start; - if (!defined($found{'body'})) { + if (!defined($found{'body'}) && $ENV{'request.state'} eq 'construct' + && $ENV{'environment.remote'} eq 'off') { + $body_tag_start=&Apache::loncommon::bodytag(); + $body_tag_start.=&Apache::lonxml::message_location(); + } elsif (!defined($found{'body'})) { $body_tag_start=''; + $form_tag_start='
'; } return ($result,$head_tag_start,$body_tag_start,$form_tag_start); } @@ -575,6 +581,8 @@ sub start_problem { $allow_print_points=1; } } + my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); + if (defined($maxtries) && $maxtries < 0) { $allow_print_points=0; } my $duedate = &Apache::lonnet::EXT("resource.$id.duedate"); $duedate = POSIX::strftime("%c",localtime($duedate)); my $temp_file; @@ -1121,6 +1129,10 @@ sub start_part { if ($1 ne '0') {$allow_print_points=1;} } } + my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries"); + if (defined($maxtries) && $maxtries < 0) { + $allow_print_points=0; + } if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} } elsif ($target eq 'web') { $result.=''; @@ -1358,12 +1370,13 @@ sub delete_startouttext { sub start_simpleeditbutton { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result=''; - if (($target eq 'web') && + if (($ENV{'form.simple_edit_button'} ne 'off') && + ($target eq 'web') && (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) { my $url=$ENV{'request.noversionuri'}; $url=~s/\?.*$//; $result='
'. - ''.&mt('Simple Problem Editor').' - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). + ''.&mt('Edit').' - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). &Apache::loncommon::help_open_topic('Caching').'

'; } return $result;