--- loncom/homework/structuretags.pm 2019/10/31 15:01:22 1.564 +++ loncom/homework/structuretags.pm 2019/11/04 13:21:25 1.565 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.564 2019/10/31 15:01:22 raeburn Exp $ +# $Id: structuretags.pm,v 1.565 2019/11/04 13:21:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -703,7 +703,7 @@ sub setup_rndseed { $env{'form.rndseed'}=$rndseed; } } - if (($env{'request.state'} eq "construct") && + if ((($env{'request.state'} eq "construct") || ($symb eq '')) && ($Apache::lonhomework::type eq 'randomizetry')) { if ($numtries) { if (($reqtries =~ /^\d+$/) && ($reqtries > 1)) { @@ -1848,8 +1848,12 @@ sub start_problem { if ($env{'request.state'} ne "construct" && ($symb eq '' || $Apache::lonhomework::type eq 'practice')) { + my $rndseedval = $rndseed; + if (($symb eq '') && ($Apache::lonhomework::type eq 'randomizetry')) { + $rndseedval = $env{'form.rndseed'}; + } $form_tag_start.=''. + $rndseedval.'" />'. ''; if (exists($env{'form.username'})) { @@ -1871,11 +1875,12 @@ sub start_problem { $form_tag_start.=&practice_problem_header(); } $form_tag_start.='
'; - } elsif (($env{'request.state'} ne "construct") && - ($Apache::lonhomework::type eq 'randomizetry') && - ($status eq 'CAN_ANSWER') && - ($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement') && - (!$env{'request.role.adv'})) { + } + if (($env{'request.state'} ne "construct") && + ($Apache::lonhomework::type eq 'randomizetry') && + ($status eq 'CAN_ANSWER') && + ($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement') && + (!$env{'request.role.adv'})) { # "New Problem Variation Each Try" header suppressed for Placement Tests, unless course personnel. my $reqtries = &Apache::lonnet::EXT("resource.$Apache::inputtags::part.randomizeontries"); my $problemstatus = &get_problem_status($Apache::inputtags::part);