[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonmenu.pm

raeburn raeburn at source.lon-capa.org
Mon Apr 4 22:02:29 EDT 2016


raeburn		Tue Apr  5 02:02:29 2016 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonmenu.pm 
  Log:
  - Bug 6808. New course container -- "Placement" for Placement Tests.
    - Completion status shown to students in place of icons on right side 
      of inline menu.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1239 loncom/interface/loncommon.pm:1.1240
--- loncom/interface/loncommon.pm:1.1239	Mon Apr  4 01:09:47 2016
+++ loncom/interface/loncommon.pm	Tue Apr  5 02:02:27 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1239 2016/04/04 01:09:47 raeburn Exp $
+# $Id: loncommon.pm,v 1.1240 2016/04/05 02:02:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5996,6 +5996,12 @@
     float: right;
 }
 
+.LC_placement_prog {
+    padding-right: 20px;
+    font-weight: bold;
+    font-size: 90%;
+}
+
 table#LC_title_bar td {
   background: $tabbg;
 }
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.444 loncom/interface/lonmenu.pm:1.445
--- loncom/interface/lonmenu.pm:1.444	Mon Apr  4 17:24:05 2016
+++ loncom/interface/lonmenu.pm	Tue Apr  5 02:02:28 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.444 2016/04/04 17:24:05 raeburn Exp $
+# $Id: lonmenu.pm,v 1.445 2016/04/05 02:02:28 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -947,9 +947,14 @@
                 }
             }
         }
+        my $showprogress;
+        if (($crstype eq 'Placement') && (!$env{'request.role.adv'})) {
+            $showprogress = &placement_progress();
+        }
+
+	my $addremote=0;
+	foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
 
-	    my $addremote=0;
-	    foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
     if ($addremote) {
         my $countdown;
         if ($env{'request.filename'} =~ /\.page$/) {
@@ -969,6 +974,9 @@
             if ($countdown) {
                 &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);
             }
+            if ($showprogress) {
+                &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$showprogress);
+            }
         } else {
             my @tools = @inlineremote[93,91,81,82,83];
             if ($countdown) {
@@ -987,6 +995,10 @@
             }
             &advtools_crumbs(@inlineremote);
         }
+    } else {
+        if ($showprogress) {
+            &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$showprogress);
+        }
     }
     my ($topic_help,$topic_help_text);
     if ($is_const_dir == 2) {
@@ -2534,6 +2546,13 @@
     return;
 }
 
+sub placement_progress {
+    my ($totalpoints,$incomplete) = &Apache::lonplacementtest::check_completion(undef,undef,1);
+    my $complete = 100 - $incomplete;
+    return '<span class="LC_placement_prog">'.
+           &mt('Test is [_1]% complete',$complete).'</span>';
+}
+
 # ================================================================ Main Program
 
 BEGIN {




More information about the LON-CAPA-cvs mailing list