--- loncom/homework/structuretags.pm 2015/12/07 08:11:55 1.542 +++ loncom/homework/structuretags.pm 2016/04/02 04:30:39 1.546 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.542 2015/12/07 08:11:55 raeburn Exp $ +# $Id: structuretags.pm,v 1.546 2016/04/02 04:30:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -226,9 +226,11 @@ sub end_tex { sub homework_js { my ($postsubmit,$timeout); if (($env{'request.course.id'}) && ($env{'request.state'} ne 'construct')) { - my $crstype; - if (&Apache::loncommon::course_type() eq 'Community') { + my $crstype = &Apache::loncommon::course_type(); + if ($crstype eq 'Community') { $crstype = 'community'; + } elsif ($crstype eq 'Placement') { + $crstype = 'placement'; } else { if ($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'}) { $crstype = 'official'; @@ -980,8 +982,7 @@ $show_all 'onclick="javascript:setmode(this.form,'."'editxml'".')" />'; if ($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9) { my $uri = $env{'request.uri'}; - my $daxeurl = '/adm/daxe/daxe.html?config=config/loncapa_config.xml&file=/daxeopen'.$uri. - '&save=/daxesave'; + my $daxeurl = '/daxepage'.$uri; $result .= ''; } @@ -1287,7 +1288,7 @@ sub store_aggregates { } else { $anoncounter{$symb."\0".$part} = 1; } - my $needsrelease = $Apache::lonnet::needsrelease{'parameter:type:'.$Apache::lonhomework::results{'resource.'.$part.'.type'}.':'}; + my $needsrelease = $Apache::lonnet::needsrelease{'parameter:type:'.$Apache::lonhomework::results{'resource.'.$part.'.type'}.'::'}; if ($needsrelease) { my $curr_required = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'}; if ($curr_required eq '') { @@ -1603,7 +1604,8 @@ sub start_problem { $form_tag_start.='
'; } elsif (($env{'request.state'} ne "construct") && ($Apache::lonhomework::type eq 'randomizetry') && - ($status eq 'CAN_ANSWER')) { + ($status eq 'CAN_ANSWER') && + ($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement')) { my $reqtries = &Apache::lonnet::EXT("resource.$Apache::inputtags::part.randomizeontries"); my $problemstatus = &get_problem_status($Apache::inputtags::part); $form_tag_start.=&randomizetry_problem_header($problemstatus,$reqtries); @@ -1732,7 +1734,10 @@ sub start_problem { ''; # create a page header and exit if ($env{'request.state'} eq "construct") { - unless ($env{'form.inhibitmenu'} eq 'yes') { + if ($env{'form.inhibitmenu'} eq 'yes') { + # error messages can be useful in any case + $result.= &Apache::lonxml::message_location(); + } else { $result.= &problem_web_to_edit_header($env{'form.rndseed'}); } if ($Apache::lonhomework::type eq 'practice') { @@ -1920,7 +1925,11 @@ sub end_problem { # Added separately at end of this routine, after added # so document will be valid xhtml. # - $result.= &Apache::loncommon::end_page({'discussion' => 1, + my $showdisc = 1; + if ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') { + $showdisc = 0; + } + $result.= &Apache::loncommon::end_page({'discussion' => $showdisc, 'notbody' => 1}); } elsif ($target eq 'tex') { my $endminipage = '';