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

raeburn raeburn at source.lon-capa.org
Thu Nov 30 07:45:56 EST 2017


raeburn		Thu Nov 30 12:45:56 2017 EDT

  Modified files:              
    /loncom/interface	lonconfigsettings.pm 
  Log:
  - LON-CAPA as LTI Consumer.
    - Domain configuration to specify how long after launch the two items can
      be used -- days for passback of grades; seconds for retrieval of roster.
  
  
Index: loncom/interface/lonconfigsettings.pm
diff -u loncom/interface/lonconfigsettings.pm:1.38 loncom/interface/lonconfigsettings.pm:1.39
--- loncom/interface/lonconfigsettings.pm:1.38	Sun Oct 15 04:05:10 2017
+++ loncom/interface/lonconfigsettings.pm	Thu Nov 30 12:45:55 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: lonconfigsettings.pm,v 1.38 2017/10/15 04:05:10 raeburn Exp $
+# $Id: lonconfigsettings.pm,v 1.39 2017/11/30 12:45:55 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -40,7 +40,7 @@
 use LONCAPA qw(:DEFAULT :match); 
 
 sub print_header {
-    my ($r,$phase,$context,$jscript,$container,$instcode,$dom) = @_;
+    my ($r,$phase,$context,$jscript,$container,$instcode,$dom,$values) = @_;
     my ($pagetitle,$brcrumtitle,$action,$call_category_check,$instcode_check,
         $crstype, at actions, at code_order);
     if ($phase eq 'display') {
@@ -215,6 +215,19 @@
                 my $optionsprefix = 'LC_options_helpdesk_';
                 $onload .= "toggleHelpdeskRow(document.display,'overrides','$customclass','$optionsprefix');";
             }
+            if (grep(/^ltitools$/, at actions)) {
+                $onload .= "toggleLTITools(document.display,'passback','add');".
+                           "toggleLTITools(document.display,'roster','add');";
+                if (ref($values) eq 'HASH') {
+                    if (ref($values->{'ltitools'}) eq 'HASH') {
+                        my $numltitools = scalar(keys(%{$values->{'ltitools'}}));
+                        for (my $i=0; $i<$numltitools; $i++) {
+                            $onload .= "toggleLTITools(document.display,'passback','$i');".
+                                       "toggleLTITools(document.display,'roster','$i');";
+                        }
+                    }
+                }
+            }
             if ($onload) {
                 my %loaditems = (
                                   'onload' => $onload,
@@ -378,7 +391,7 @@
     if (ref($values) eq 'HASH') {
         $instcode = $values->{'internal.coursecode'};
     }
-    &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom);
+    &print_header($r,$phase,$context,$jscript,$container,$instcode,$dom,$values);
     my $divwidth = 900;
     if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { 
         if (@actions > 0) {




More information about the LON-CAPA-cvs mailing list