[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm /interface lonmenu.pm lonplacementtest.pm

raeburn raeburn at source.lon-capa.org
Mon Apr 4 13:24:20 EDT 2016


raeburn		Mon Apr  4 17:24:20 2016 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm lonplacementtest.pm 
    /loncom/homework	structuretags.pm 
  Log:
  - Bug 6808. New course container -- "Placement" for Placement Tests.
    - No forward arrow displayed for final resource.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.443 loncom/interface/lonmenu.pm:1.444
--- loncom/interface/lonmenu.pm:1.443	Sat Apr  2 04:30:20 2016
+++ loncom/interface/lonmenu.pm	Mon Apr  4 17:24:05 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.443 2016/04/02 04:30:20 raeburn Exp $
+# $Id: lonmenu.pm,v 1.444 2016/04/04 17:24:05 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -840,11 +840,27 @@
             $menuitems = "c&3&1";
             if (($crstype ne 'Placement') || ($env{'request.role.adv'})) {
                 $menuitems.="
-s&2&1&back.png&&&gopost('/adm/flip','back:'+currentURL)&Previous content resource&&1";
+s&2&1&back.png&&&gopost('/adm/flip','back:'+currentURL)&Previous content resource&&1
+s&2&3&forw.png&&&gopost('/adm/flip','forward:'+currentURL)&Next content resource&&3";
+            } else {
+# Suppress display of backward arrow for Placement Tests
+# Suppress display of forward arrow for Placement Tests if this is the last resource.
+                my $showforw = 1;
+                if ($env{'request.symb'}) {
+                    my $navmap = Apache::lonnavmaps::navmap->new();
+                    if (ref($navmap)) {
+                        if (&Apache::lonplacementtest::is_lastres($env{'request.symb'},$navmap)) {
+                            $showforw = 0;
+                        }
+                    }
+                }
+                if ($showforw) {
+                    $menuitems.="
+s&2&3&forw.png&&&gopost('/adm/flip','forward:'+currentURL)&Next content resource&&3";
+                }
             }
 	    $menuitems .= (<<ENDMENUITEMS);
 
-s&2&3&forw.png&&&gopost('/adm/flip','forward:'+currentURL)&Next content resource&&3
 c&6&3
 c&8&1
 c&8&2
Index: loncom/interface/lonplacementtest.pm
diff -u loncom/interface/lonplacementtest.pm:1.2 loncom/interface/lonplacementtest.pm:1.3
--- loncom/interface/lonplacementtest.pm:1.2	Mon Apr  4 15:56:58 2016
+++ loncom/interface/lonplacementtest.pm	Mon Apr  4 17:24:05 2016
@@ -2,7 +2,7 @@
 # Handler to manage dependencies for HTML files uploaded directly
 # to a course.
 #
-# $Id: lonplacementtest.pm,v 1.2 2016/04/04 15:56:58 raeburn Exp $
+# $Id: lonplacementtest.pm,v 1.3 2016/04/04 17:24:05 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -245,7 +245,9 @@
     my ($score) = &Apache::lonplacementtest::check_completion(1,undef,1);
     my %aclt = &test_action_text();
     my $output;
-    unless ($inhibitmenu) {
+    if ($inhibitmenu) {
+        $output = '<hr />';
+    } else {
         my $brcrum = [{'href' => '/adm/flip?postdata=firstres%3a',
                        'text' => 'Test Status'},];
         $output = &Apache::loncommon::start_page('Placement Test Completed',
@@ -270,7 +272,9 @@
     my %aclt = &test_action_text();
     my $output;
     if ($incomplete == 100) {
-        unless ($inhibitmenu) {
+        if ($inhibitmenu) {
+            $output = '<hr />';
+        } else {
             my $brcrum = [{'href' => '/adm/flip?postdata=firstres%3a',
                            'text' => 'Test Status'},];
             $output = &Apache::loncommon::start_page('Placement Test Unattempted',
@@ -284,7 +288,9 @@
                        '<a href="/adm/logout">'.$aclt{'exit'}.'</a></li>',
                       ]);
     } elsif ($incomplete) {
-        unless ($inhibitmenu) {
+        if ($inhibitmenu) {
+            $output = '<hr />';
+        } else {
             my $brcrum = [{'href' => '/adm/flip?postdata=endplacement%3a',
                            'text' => 'Test Status'},];
             $output .=  &Apache::loncommon::start_page('Incomplete Placement Test',
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.547 loncom/homework/structuretags.pm:1.548
--- loncom/homework/structuretags.pm:1.547	Mon Apr  4 15:57:07 2016
+++ loncom/homework/structuretags.pm	Mon Apr  4 17:24:18 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.547 2016/04/04 15:57:07 raeburn Exp $
+# $Id: structuretags.pm,v 1.548 2016/04/04 17:24:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1606,6 +1606,7 @@
                  ($Apache::lonhomework::type eq 'randomizetry') &&
                  ($status eq 'CAN_ANSWER') &&
                  ($env{'course.'.$env{'request.course.id'}.'.type'} ne 'Placement')) {
+# "New Problem Variation Each Try" header suppressed for Placement Tests.
             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);




More information about the LON-CAPA-cvs mailing list