Diff for /loncom/homework/structuretags.pm between versions 1.546 and 1.549

version 1.546, 2016/04/02 04:30:39 version 1.549, 2016/04/04 17:34:01
Line 1605  sub start_problem { Line 1605  sub start_problem {
         } elsif (($env{'request.state'} ne "construct") &&          } elsif (($env{'request.state'} ne "construct") &&
                  ($Apache::lonhomework::type eq 'randomizetry') &&                   ($Apache::lonhomework::type eq 'randomizetry') &&
                  ($status eq 'CAN_ANSWER') &&                   ($status eq 'CAN_ANSWER') &&
                  ($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement')) {                   ($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 $reqtries = &Apache::lonnet::EXT("resource.$Apache::inputtags::part.randomizeontries");
             my $problemstatus = &get_problem_status($Apache::inputtags::part);              my $problemstatus = &get_problem_status($Apache::inputtags::part);
             $form_tag_start.=&randomizetry_problem_header($problemstatus,$reqtries);              $form_tag_start.=&randomizetry_problem_header($problemstatus,$reqtries);
Line 1926  sub end_problem { Line 1928  sub end_problem {
                 # <script></script> so document will be valid xhtml.                  # <script></script> so document will be valid xhtml.
                 #                  #
                 my $showdisc = 1;                  my $showdisc = 1;
                 if ($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') {                   if (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') &&
                       (!$env{'request.role.adv'})) { 
   # For Placement Tests footer with "Post Discussion" and "Send Feedback" links is suppressed.
                     $showdisc = 0;                      $showdisc = 0;
                       my ($symb)= &Apache::lonnet::whichuser();
                       if ($symb) {
                           my $navmap = Apache::lonnavmaps::navmap->new();
                           if (ref($navmap)) {
                               my $hastries = &Apache::lonplacementtest::has_tries($symb,$navmap);  
   # For Placement Tests test status is displayed if this is the last resource in the course
   # and there are no tries left
                               unless ($hastries) {
                                   if (&Apache::lonplacementtest::is_lastres($symb,$navmap)) {
                                       my ($score,$incomplete) = 
                                           &Apache::lonplacementtest::check_completion(undef,undef,1);
                                       if (!$incomplete) {
                                           $result .= &Apache::lonplacementtest::showresult(1,1);
                                       } elsif ($incomplete < 100) { 
                                           $result.= &Apache::lonplacementtest::showincomplete($incomplete,1);
                                       }
                                   } else {
   # For Placement Tests score is displayed if test has just been completed
                                       my ($score,$incomplete) = &Apache::lonplacementtest::check_completion(undef,undef,1);
                                       if (!$incomplete) {
                                           $result.= &Apache::lonplacementtest::showresult(1,1);
                                       }
                                   }
                               }
                           }
                       }
                 }                  }
  $result.= &Apache::loncommon::end_page({'discussion' => $showdisc,   $result.= &Apache::loncommon::end_page({'discussion' => $showdisc,
  'notbody'    => 1});   'notbody'    => 1});

Removed from v.1.546  
changed lines
  Added in v.1.549


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>