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

raeburn raeburn at source.lon-capa.org
Mon Dec 18 18:20:49 EST 2017


raeburn		Mon Dec 18 23:20:49 2017 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm lonfeedback.pm lonmsgdisplay.pm 
  Log:
  - Bug 6754 LON-CAPA as LTI Consumer
    - Inline menu can include "Communicate" icon for External Tools
    - Functions menu for course personnel can include "Content Grades"
      item if External Tool instance is set to "gradable". 
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.483 loncom/interface/lonmenu.pm:1.484
--- loncom/interface/lonmenu.pm:1.483	Sat Oct  7 23:14:49 2017
+++ loncom/interface/lonmenu.pm	Mon Dec 18 23:20:48 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.483 2017/10/07 23:14:49 raeburn Exp $
+# $Id: lonmenu.pm,v 1.484 2017/12/18 23:20:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -805,8 +805,14 @@
         $perms{'mdc'} = &Apache::lonnet::allowed('mdc',$env{'request.course.id'});
         $perms{'cev'} = &Apache::lonnet::allowed('cev',$env{'request.course.id'});
         my @privs;
+        my $gradable_exttool;
         if ($env{'request.symb'} ne '') {
-             if ($env{'request.filename'}=~/$LONCAPA::assess_re/) {
+             if ($env{'request.noversionuri'} =~ m{^/adm/$cdom/$cnum/(\d+)/ext\.tool$}) {
+                 if (&Apache::lonnet::EXT('resource.0.gradable') =~ /^yes$/i) {
+                     $gradable_exttool = 1;
+                     push(@privs,('mgr','vgr'));
+                 }
+             } elsif ($env{'request.filename'}=~/$LONCAPA::assess_re/) {
                  push(@privs,('mgr','vgr'));
              }
              push(@privs,('opa','vpa'));
@@ -821,8 +827,8 @@
 #
 # Determine whether or not to show Grades and Submissions buttons
 #
-        if ($env{'request.symb'} ne '' &&
-            $env{'request.filename'}=~/$LONCAPA::assess_re/) {
+        if (($env{'request.symb'} ne '') &&
+            (($env{'request.filename'}=~/$LONCAPA::assess_re/) || ($gradable_exttool))) {
             if ($perms{'mgr'}) {
                 &switch('','',7,2,'pgrd.png','Content Grades','grades[_4]',
                         "gocmd('/adm/grades','gradingmenu')",
@@ -964,14 +970,15 @@
     $is_mobile = 1;
 }
 
-            unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio|ext\.tool)(\?|$)/) {
-		if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/}) && ($env{'request.noversionuri'} !~ m{^/uploaded/$match_domain/$match_courseid/docs/})) {
+            unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {
+		if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/}) && ($env{'request.noversionuri'} !~ m{^/uploaded/$match_domain/$match_courseid/docs/}) && ($env{'request.noversionuri'} !~ m{^/adm/.+/ext\.tool$})) {
 		    $menuitems.=(<<ENDREALRES);
 s&6&3&catalog.png&Info&info[_1]&catalog_info('$is_mobile')&Show Metadata
 ENDREALRES
                 }
                 unless (($env{'request.noversionuri'} =~ m{^/uploaded/$match_domain/$match_courseid/docs/}) ||
-                        ($env{'request.noversionuri'} =~ m{^\Q/adm/wrapper/\E(ext|uploaded)/})) {  
+                        ($env{'request.noversionuri'} =~ m{^\Q/adm/wrapper/\E(ext|uploaded)/}) ||
+                        ($env{'request.noversionuri'} =~ m{^/adm/.+/ext\.tool$})) {
                     $menuitems.=(<<ENDREALRES);
 s&8&1&eval.png&Evaluate&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource
 ENDREALRES
@@ -2700,7 +2707,9 @@
 
 sub countdown_timer {
     if (($env{'request.course.id'}) && ($env{'request.symb'} ne '') &&
-        ($env{'request.filename'}=~/$LONCAPA::assess_re/)) {
+        (($env{'request.filename'}=~/$LONCAPA::assess_re/) ||
+         (($env{'request.symb'} =~ /ext\.tool$/) &&
+         (&Apache::lonnet::EXT('resource.0.gradable',$env{'request.symb'}) =~ /^yes$/i)))) {
         my ($type,$hastimeleft,$slothastime);
         my $now = time;
         if ($env{'request.filename'} =~ /\.task$/) {
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.377 loncom/interface/lonfeedback.pm:1.378
--- loncom/interface/lonfeedback.pm:1.377	Mon Dec 18 22:36:52 2017
+++ loncom/interface/lonfeedback.pm	Mon Dec 18 23:20:48 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.377 2017/12/18 22:36:52 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.378 2017/12/18 23:20:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4552,6 +4552,8 @@
 	  ($env{'request.course.id'} && ($feedurl!~m:^/adm:))
 	  ||
 	  ($env{'request.course.id'} && ($symb=~/^bulletin\_\_\_/))
+          ||
+          (($env{'request.course.id'} && ($feedurl =~ /ext\.tool$/)))
 	  ) {
 	  &Apache::loncommon::content_type($r,'text/html');
 	  $r->send_http_header;
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.185 loncom/interface/lonmsgdisplay.pm:1.186
--- loncom/interface/lonmsgdisplay.pm:1.185	Mon Aug  7 20:22:13 2017
+++ loncom/interface/lonmsgdisplay.pm	Mon Dec 18 23:20:48 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.185 2017/08/07 20:22:13 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.186 2017/12/18 23:20:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2653,6 +2653,13 @@
         }
 # Could not get a symb, give up
 	unless ($symb) { return $content{'citation'}; }
+        if ($symb =~ /ext\.tool$/) {
+            return '<h2>'.&mt('Current transactions for student (if applicable)').'</h2>'.
+            &Apache::loncommon::get_previous_attempt($symb,
+                                                     $content{'sendername'},
+                                                     $content{'senderdomain'},
+                                                     $content{'courseid'});
+        }
 # Have a symb, can render
 	return '<h2>'.&mt('Current attempts of student (if applicable)').'</h2>'.
 	    &Apache::loncommon::get_previous_attempt($symb,




More information about the LON-CAPA-cvs mailing list