[LON-CAPA-cvs] cvs: rat / lonpageflip.pm lonuserstate.pm /client parameter.html loncom/interface lonnavmaps.pm lonparmset.pm lonquickgrades.pm loncom/misc releaseslist.xml loncom/publisher packages.tab

raeburn raeburn at source.lon-capa.org
Mon Nov 12 22:59:17 EST 2018


raeburn		Tue Nov 13 03:59:17 2018 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm lonparmset.pm lonquickgrades.pm 
    /loncom/publisher	packages.tab 
    /loncom/misc	releaseslist.xml 
    /rat/client	parameter.html 
    /rat	lonuserstate.pm lonpageflip.pm 
  Log:
  - Bug 6400
    - deeplink parameter determines whether deep-linked items are listed in
      and/or linked to in Course Contents and student's view of Grades  
  
  
-------------- next part --------------
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.542 loncom/interface/lonnavmaps.pm:1.543
--- loncom/interface/lonnavmaps.pm:1.542	Sat Apr 14 17:52:43 2018
+++ loncom/interface/lonnavmaps.pm	Tue Nov 13 03:59:00 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.542 2018/04/14 17:52:43 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.543 2018/11/13 03:59:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -963,32 +963,32 @@
         $newBranchText = "<img src='$location/branch.gif' alt=".mt('Branch')." />";
     }
 
-    # links to open and close the folder
-
     my $whitespace = $location.'/whitespace_21.gif';
-    my $linkopen = "<img src='$whitespace' alt='' />";
-    my $nomodal;
-    if (($params->{'modalLink'}) && (!$resource->is_sequence())) {
-        if ($link =~m{^(?:|/adm/wrapper)/ext/([^#]+)}) {
-            my $exturl = $1;
-            if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) {
+    my ($nomodal,$linkopen,$linkclose);
+    unless ($resource->is_map() || $params->{'resource_nolink'}) {
+        $linkopen = "<img src='$whitespace' alt='' />";
+        $linkclose = "</a>";
+        if (($params->{'modalLink'}) && (!$resource->is_sequence())) {
+            if ($link =~m{^(?:|/adm/wrapper)/ext/([^#]+)}) {
+                my $exturl = $1;
+                if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) {
+                    $nomodal = 1;
+                }
+            } elsif (($link eq "/public/$LONCAPA::match_domain/$LONCAPA::match_courseid/syllabus") &&
+                     ($env{'request.course.id'}) && ($ENV{'SERVER_PORT'} == 443) &&
+                     ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
                 $nomodal = 1;
             }
-        } elsif (($link eq "/public/$LONCAPA::match_domain/$LONCAPA::match_courseid/syllabus") &&
-                 ($env{'request.course.id'}) && ($ENV{'SERVER_PORT'} == 443) &&
-                 ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
-             $nomodal = 1;
-        }
-        my $esclink = &js_escape($link);
-        if ($nomodal) {
-            $linkopen .= "<a href=\"#\" onclick=\"javascript:window.open('$esclink','resourcepreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1'); return false;\" />";
+            my $esclink = &js_escape($link);
+            if ($nomodal) {
+                $linkopen .= "<a href=\"#\" onclick=\"javascript:window.open('$esclink','resourcepreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1'); return false;\" />";
+            } else {
+                $linkopen .= "<a href=\"$link\" onclick=\"javascript:openMyModal('$esclink',600,500,'yes','true'); return false;\">";
+            }
         } else {
-            $linkopen .= "<a href=\"$link\" onclick=\"javascript:openMyModal('$esclink',600,500,'yes','true'); return false;\">";
+            $linkopen .= "<a href=\"$link\">";
         }
-    } else {
-        $linkopen .= "<a href=\"$link\">";
     }
-    my $linkclose = "</a>";
 
     # Default icon: unknown page
     my $icon = "<img class=\"LC_contentImage\" src='$location/unknown.gif' alt='' />";
@@ -1036,13 +1036,14 @@
                 '&jump=' .
                 &escape($resource->symb()) . 
                 "&folderManip=1\">";
-
+            $linkclose = '</a>';
         } else {
             # Don't allow users to manipulate folder
             $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
             $icon = "<img class=\"LC_space\" src='$whitespace' alt='' />"."<img class=\"LC_contentImage\" src='$location/$icon' alt=\"".($nowOpen ? &mt('Open Folder') : &mt('Close Folder')).' '.$title."\" />";
             if ($params->{'caller'} eq 'sequence') {
                 $linkopen = "<a href=\"$link\">";
+                $linkclose = '</a>';
             } else {
                 $linkopen = "";
                 $linkclose = "";
@@ -1061,10 +1062,15 @@
         }
         if ($params->{'mapHidden'} || $resource->randomout()) {
             $nonLinkedText .= ' <span class="LC_warning">('.&mt('hidden').')</span> ';
+        } elsif ($params->{'mapUnlisted'}) {
+            $nonLinkedText .= ' <span class="LC_warning">('.&mt('unlisted').')</span> ';
         }
     } else {
         if ($resource->randomout()) {
             $nonLinkedText .= ' <span class="LC_warning">('.&mt('hidden').')</span> ';
+        } elsif (($resource->deeplink($params->{caller}) eq 'absent') ||
+                 ($resource->deeplink($params->{caller}) eq 'grades')) {
+            $nonLinkedText .= ' <span class="LC_warning">('.&mt('unlisted').')</span> ';
         }
     }
     if (!$resource->condval()) {
@@ -1388,7 +1394,9 @@
         # Without renaming the filterfunc, the server seems to go into
         # an infinite loop
         my $oldFilterFunc = $filterFunc;
-        $filterFunc = sub { my $res = shift; return !$res->randomout() && 
+        $filterFunc = sub { my $res = shift; return !$res->randomout() &&
+                                ($res->deeplink($args->{'caller'}) ne 'absent') &&
+                                ($res->deeplink($args->{'caller'}) ne 'grades') &&
                                 &$oldFilterFunc($res);};
     }
 
@@ -1805,6 +1813,7 @@
 
         # If this is an empty sequence and we're filtering them, continue on
         $args->{'mapHidden'} = 0;
+        $args->{'mapUnlisted'} = 0;
         if (($curRes->is_map()) && (!$curRes->{DATA}->{HAS_VISIBLE_CHILDREN})) {
             if ($args->{'suppressEmptySequences'}) {
                 next;
@@ -1817,6 +1826,15 @@
                     } else {
                         next;
                     }
+                } else {
+                    my $deeplink = $navmap->get_mapparam(undef,$mapname,"0.deeplink");
+                    if (($deeplink eq 'absent') || ($deeplink eq 'grades')) {
+                        if ($userCanSeeHidden) {
+                            $args->{'mapUnlisted'} = 1;
+                        } else {
+                            next;
+                        }
+                    }
                 }
             }
         }
@@ -1879,8 +1897,17 @@
 		    $args->{'condensed'} = 1;
 		}
             }
-        } 
-            
+        }
+        # If deep-link parameter is set (and is not set to full) suppress link
+        # unless priviliged user, or calling context is sequence, and parameter
+        # set at map level
+        if ((!$curRes->deeplink($args->{'caller'})) ||
+            ($curRes->deeplink($args->{'caller'}) eq 'full') || &advancedUser()) {
+            $args->{'resource_nolink'} = 0;
+        } else {
+            $args->{'resource_nolink'} = 1;
+        }
+
         # If the multipart problem was condensed, "forget" it was multipart
         if (scalar(@parts) == 1) {
             $args->{'multipart'} = 0;
@@ -4692,7 +4719,6 @@
 
 sub is_empty_sequence {
     my $self=shift;
-    my $src = $self->src();
     return !$self->is_page() && $self->navHash("is_map_", 1) && !$self->navHash("map_type_" . $self->map_pc());
 }
 
@@ -5112,6 +5138,17 @@
     my $available = $self->parmval("available", $part); 
     return ($useslots,$availablestudent,$available);
 }
+sub deeplink {
+    my ($self,$caller) = @_;
+    if ($caller eq 'sequence') {
+        my @deeplink = $self->parmval("deeplink");
+        if ($deeplink[1] eq 'resource') {
+            return $deeplink[0];
+        }
+    } else {
+        return $self->parmval("deeplink");
+    }
+}
 
 # Multiple things need this
 sub getReturnHash {
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.586 loncom/interface/lonparmset.pm:1.587
--- loncom/interface/lonparmset.pm:1.586	Fri Sep 14 18:27:49 2018
+++ loncom/interface/lonparmset.pm	Tue Nov 13 03:59:00 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.586 2018/09/14 18:27:49 raeburn Exp $
+# $Id: lonparmset.pm,v 1.587 2018/11/13 03:59:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2101,6 +2101,7 @@
         'buttonshide' => 'hiding',
         'turnoffeditor' => 'hiding',
         'encrypturl' => 'hiding',
+        'deeplink' => 'hiding',
         'randomorder' => 'high_level_randomization',
         'randompick' => 'high_level_randomization',
         'available' => 'slots',
@@ -4660,8 +4661,15 @@
                  ['no','No']],
      'string_ip'
              => [['_allowfrom_','Hostname(s), or IP(s) from which access is allowed'],
-                 ['_denyfrom_',], 'Hostname(s) or IP(s) from which access is disallowed'], 
-     );
+                 ['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']], 
+     'string_deeplink'
+             => [['full','Displayed (linked) in Contents and Grades'],
+                 ['absent','Not displayed in Contents or Grades'],
+                 ['grades','Displayed in Grades only'],
+                 ['details','Displayed (unlinked) in Contents and Grades'],
+                 ['datestatus','Displayed (with status), but unlinked in Contents and Grades']],
+    );
+   
 
 my %stringmatches = (
          'string_lenient'
@@ -4678,6 +4686,7 @@
                     discussvote  => 'string_discussvote',
                     examcode     => 'string_examcode',
                     acc          => 'string_ip',
+                    deeplink     => 'string_deeplink',
                   );
 
 # Returns the possible values and titles for a given string type, or undef if there are none.
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.113 loncom/interface/lonquickgrades.pm:1.114
--- loncom/interface/lonquickgrades.pm:1.113	Sun Dec 31 15:49:03 2017
+++ loncom/interface/lonquickgrades.pm	Tue Nov 13 03:59:00 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Quick Student Grades Display
 #
-# $Id: lonquickgrades.pm,v 1.113 2017/12/31 15:49:03 raeburn Exp $
+# $Id: lonquickgrades.pm,v 1.114 2018/11/13 03:59:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -444,7 +444,8 @@
         if ($curRes == $iterator->BEGIN_MAP()) {$depth++;}
         if ($curRes == $iterator->END_MAP()) { $depth--; }
 
-        if (ref($curRes) && $curRes->is_gradable() && !$curRes->randomout)
+        if (ref($curRes) && $curRes->is_gradable() && !$curRes->randomout && 
+            ($curRes->deeplink ne 'absent'))
         {
             # Get number of correct, incorrect parts
             my $parts = $curRes->parts();
Index: loncom/publisher/packages.tab
diff -u loncom/publisher/packages.tab:1.78 loncom/publisher/packages.tab:1.79
--- loncom/publisher/packages.tab:1.78	Mon Dec 18 23:13:58 2017
+++ loncom/publisher/packages.tab	Tue Nov 13 03:59:04 2018
@@ -70,6 +70,8 @@
 part_0&buttonshide&display:Hide buttons from students
 part_0&buttonshide&type:string_yesno
 part_0&buttonshide&default:no
+part_0&deeplink&display:Deep-linked items
+part_0&deeplink&type:string_deeplink
 numericalhint&tol&display:Numerical Tolerance
 numericalhint&tol&type:tolerance
 numericalhint&tol&default:5%
@@ -166,6 +168,8 @@
 extension_page&randomorder&display:Randomly Order Resources
 extension_page&examcode&type:string_examcode
 extension_page&examcode&display:Exam Code (graded CODEd exam containing randomorder/randompick).
+extension_page&deeplink&display:Deep-linked items
+extension_page&deeplink&type:string_deeplink
 
 import_defaults&extension_html:1
 extension_html&cssfile&display:CSS file to link
@@ -263,6 +267,8 @@
 default&buttonshide&display:Hide buttons from students
 default&buttonshide&type:string_yesno
 default&buttonshide&default:no
+default&deeplink&display:Deep-linked items
+default&deeplink&type:string_deeplink
 default&acc&display:Client IP/Name Access Control
 default&acc&type:string_ip
 #default&hiddenresource&hidden:parm
@@ -313,4 +319,7 @@
 Task_0&availablestudent&type:string
 Task_0&cssfile&display:CSS file to link
 Task_0&cssfile&type:string
+Task_0&deeplink&display:Deep-linked items
+Task_0&deeplink&type:string_deeplink
+
 
Index: loncom/misc/releaseslist.xml
diff -u loncom/misc/releaseslist.xml:1.17 loncom/misc/releaseslist.xml:1.18
--- loncom/misc/releaseslist.xml:1.17	Tue Jan  2 14:43:24 2018
+++ loncom/misc/releaseslist.xml	Tue Nov 13 03:59:08 2018
@@ -24,6 +24,11 @@
 <parameter name="acc" valuematch="_denyfrom_">2.12</parameter>
 <parameter name="interval" valuematch="done">2.12</parameter>
 <parameter name="" namematch="maplevelrecurse" value="">2.12</parameter>
+<parameter name="deeplink" value="full">2.12</parameter>
+<parameter name="deeplink" value="absent">2.12</parameter>
+<parameter name="deeplink" value="grades">2.12</parameter>
+<parameter name="deeplink" value="details">2.12</parameter>
+<parameter name="deeplink" value="datestatus">2.12</parameter>
 <resourcetag name="responsetype" value="custom">2.1</resourcetag>
 <resourcetag name="responsetype" value="math">2.2</resourcetag>
 <resourcetag name="responsetype" value="functionplot">2.10</resourcetag>
Index: rat/client/parameter.html
diff -u rat/client/parameter.html:1.77 rat/client/parameter.html:1.78
--- rat/client/parameter.html:1.77	Sat Jul 15 02:19:00 2017
+++ rat/client/parameter.html	Tue Nov 13 03:59:12 2018
@@ -5,7 +5,7 @@
 The LearningOnline Network with CAPA
 Parameter Input Window
 //
-// $Id: parameter.html,v 1.77 2017/07/15 02:19:00 raeburn Exp $
+// $Id: parameter.html,v 1.78 2018/11/13 03:59:12 raeburn Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -1059,6 +1059,31 @@
            choicewrite(' /> Yes, and the scope of student selected slot is the enclosing map/folder. When checking in, all resources in the map/folder are checked in.</label><br />');
         choicewrite('</td></tr></table>');
       }
+      if (pscat=='deeplink') {
+           tablestart('Deep-linked items');
+           choicewrite('<tr><td>Value:</td><td colspan="2">');
+           choicewrite('<label><input name="stringval" value="full"'+
+                  ' type="radio" '+callradiostringeval('full'));
+           if (svalue=='full') { choicewrite(' checked="checked"'); }
+           choicewrite(' /> Displayed (linked) in Contents and Grades.</label><br />');
+           choicewrite('<label><input name="stringval" value="absent"'+
+                  ' type="radio" '+callradiostringeval('absent'));
+           if (svalue=='absent') { choicewrite(' checked="checked"'); }
+           choicewrite(' /> Not displayed in Contents or Grades.</label><br />');
+           choicewrite('<label><input name="stringval" value="grades"'+
+                  ' type="radio" '+callradiostringeval('grades'));
+           if (svalue=='grades') { choicewrite(' checked="checked"'); }
+           choicewrite(' /> Displayed in Grades only.</label><br />');
+           choicewrite('<label><input name="stringval" value="details"'+
+                  ' type="radio" '+callradiostringeval('details'));
+           if (svalue=='details') { choicewrite(' checked="checked"'); }
+           choicewrite(' /> Displayed (unlinked) in Contents and Grades.</label><br />');
+           choicewrite('<label><input name="stringval" value="datestatus"'+
+                  ' type="radio" '+callradiostringeval('datestatus'));
+           if (svalue=='datestatus') { choicewrite(' checked="checked"'); }
+           choicewrite(' /> Displayed (with date status) but unlinked in Contents and Grades.</label><br />');
+           choicewrite('</td></tr></table>');
+      }
    }
    
    if (ptype=='color') {
@@ -1384,6 +1409,7 @@
      else if (pscat == 'ip')           { sopt('ip','IP Number/Name'); }
      else if (pscat == 'fileext')      { sopt('fileext','File Extension'); }
      else if (pscat == 'useslots')     { sopt('useslots','Slots control access'); }
+     else if (pscat == 'deeplink')     { sopt('deeplink','Deep-linked items'); }
      else { pscat = 'any'; }
      sopt('any','String Value');
   }
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.156 rat/lonuserstate.pm:1.157
--- rat/lonuserstate.pm:1.156	Thu Mar 29 21:12:57 2018
+++ rat/lonuserstate.pm	Tue Nov 13 03:59:17 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construct and maintain state and binary representation of course for user
 #
-# $Id: lonuserstate.pm,v 1.156 2018/03/29 21:12:57 raeburn Exp $
+# $Id: lonuserstate.pm,v 1.157 2018/11/13 03:59:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,6 +62,7 @@
 my %randomizationcode; # code used to grade folder for bubblesheet exam 
 my %encurl; # URLs in this folder are supposed to be encrypted
 my %hiddenurl; # this URL (or complete folder) is supposed to be hidden
+my %deeplinkonly; # this URL (or complete folder) is deep-link only
 my %rescount; # count of unhidden items in each map
 my %mapcount; # count of unhidden maps in each map
 
@@ -917,6 +918,14 @@
 	    && ($hash{'src_'.$rid}!~/\.sequence$/)) {
 	    $retfrid=$rid;
 	}
+        my @deeplink=&Apache::lonnet::EXT('resource.0.deeplink',$symb);
+        unless ((@deeplink == 0) || ($deeplink[0] eq 'full')) {
+            $deeplinkonly{$rid}=join(':', at deeplink);
+            if ($deeplink[1] eq 'map') {
+                my $parent = (split(/\,/,$hash{'map_hierarchy_'.$mapid}))[-1];
+                $deeplinkonly{"$parent.$mapid"}=$deeplinkonly{$rid};
+            }
+        }
 
 	if (defined($hash{'conditions_'.$rid})) {
 	    $hash{'conditions_'.$rid}=simplify(
@@ -1232,6 +1241,7 @@
     undef %randomizationcode;
     undef %hiddenurl;
     undef %encurl;
+    undef %deeplinkonly;
     undef %rescount;
     undef %mapcount;
     $retfrid='';
@@ -1380,6 +1390,7 @@
         undef %randomizationcode;
         undef %hiddenurl;
         undef %encurl;
+        undef %deeplinkonly;
         undef %rescount;
         undef %mapcount;
         $errtext='';
@@ -1518,6 +1529,10 @@
 #           $hash{'src_'.$id}=&Apache::lonenc::encrypted($hash{'src_'.$id});
         $hash{'encrypted_'.$id}=1;
     }
+# ------------------------------------------------------------ Deep-linked URLs
+    foreach my $id (keys(%deeplinkonly)) {
+        $hash{'deeplinkonly_'.$id}=$deeplinkonly{$id};
+    }
 # ----------------------------------------------- Close hashes to finally store
 # --------------------------------- Routine must pass this point, no early outs
     $hash{'first_rid'}=$retfrid;
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.97 rat/lonpageflip.pm:1.98
--- rat/lonpageflip.pm:1.97	Thu Nov 16 13:42:01 2017
+++ rat/lonpageflip.pm	Tue Nov 13 03:59:17 2018
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.97 2017/11/16 13:42:01 raeburn Exp $
+# $Id: lonpageflip.pm,v 1.98 2018/11/13 03:59:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -102,6 +102,9 @@
     my ($next,$endupmap,$direction) = @_;
     my $safecount=0;
     my $allowed=0;
+    my $deeplinkonly=0;
+    my $prev=$next;
+    my ($prevmapid)=split(/\./,$next);
     do {
 	($next,$endupmap)=&get_next_possible_move($next,$endupmap,$direction);
 
@@ -115,14 +118,35 @@
 	    my $priv = &Apache::lonnet::allowed('bre',$url,$symb);
 	    $allowed = (($priv eq 'F') || ($priv eq '2'));
 	}
+        $deeplinkonly = 0;
+        if ($hash{'deeplinkonly_'.$next}) {
+            my ($value,$level) = split(/:/,$hash{'deeplinkonly_'.$next});
+            if ($level eq 'resource') {
+                $deeplinkonly = 1;
+            } elsif ($level eq 'map') {
+                if ($mapid != $prevmapid) {
+                    $deeplinkonly = 1;
+                }
+            }
+        } elsif ($hash{'deeplinkonly_'.$prev}) {
+            my ($value,$level) = split(/:/,$hash{'deeplinkonly_'.$prev});
+            if ($level eq 'resource') {
+                $deeplinkonly = 1;
+            } elsif ($level eq 'map') {
+                if ($mapid != $prevmapid) {
+                    $deeplinkonly = 1;
+                }
+            }
+        }
 	$safecount++;
     } while (   ($next)
 	     && ($next!~/\,/)
 	     && (
 		    (!$hash{'src_'.$next})
 		 || (
-		        (!$env{'request.role.adv'})
-		     &&  $hash{'randomout_'.$next}
+                        (!$env{'request.role.adv'})
+                     && (($hash{'randomout_'.$next})
+                     ||  ($deeplinkonly))
 		    )
 		 || (!$allowed)
 		)
@@ -338,7 +362,7 @@
   my $multichoice=0;
   my %multichoicehash=();
   my %prog_state=();
-  my ($redirecturl,$redirectsymb,$enc,$anchor);
+  my ($redirecturl,$redirectsymb,$enc,$anchor,$deeplinklevel);
   my $next='';
   my $hostname = $r->hostname();
   my @possibilities=();
@@ -564,6 +588,9 @@
 	      } else {
 # -------------------------------------------------------------- No place to go
                   $multichoice=-1;
+                  if ($hash{'deeplinkonly_'.$rid}) {
+                      (my $value,$deeplinklevel) = split(/:/,$hash{'deeplinkonly_'.$rid});
+                  }
               }
 # ----------------- The program must come past this point to untie the big hash
 	      untie(%hash);
@@ -618,6 +645,11 @@
                   &Apache::loncommon::content_type($r,'text/html');
                   $r->send_http_header;
 		  my %lt=&Apache::lonlocal::texthash('title' => 'End of Sequence',
+                                                     'deeplink' => 'No link available',
+                                                     'deeplinkres' =>
+                                                     'Navigation to other content is unavailable when accessing content via deep-linking',
+                                                     'deeplinkmap' =>
+                                                     'You have reached the end of the sequence of available materials for access via deep-linking',
 						     'explain' =>
 						     'You have reached the end of the sequence of materials.',
 						     'back' => 'Go Back',
@@ -685,17 +717,29 @@
                               } else {
                                   $r->print(&Apache::lonplacementtest::showresult(1));
                               }
-                          } else {  
+                          } else {
                               $r->print(
-                                  &Apache::loncommon::start_page('No Resource')
-                                 .'<h2>'.$lt{'title'}.'</h2>'
-                                 .'<p>'.$lt{'explain'}.'</p>');
+                                  &Apache::loncommon::start_page('No Resource'));
+                              if ($deeplinklevel eq 'resource') {
+                                  $r->print('<h2>'.$lt{'deeplink'}.'</h2>'
+                                           .'<p>'.$lt{'deeplinkres'}.'</p>');
+                              } elsif ($deeplinklevel eq 'map') {
+                                  $r->print('<h2>'.$lt{'title'}.'</h2>'
+                                           .'<p>'.$lt{'deeplinkmap'}.'</p>');
+                              } else {
+                                  $r->print('<h2>'.$lt{'title'}.'</h2>'
+                                           .'<p>'.$lt{'explain'}.'</p>');
+                              }
                           }
                       }
 		  }
                   unless (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') ||
                           ($env{'request.role.adv'})) {
-                      if ((!@possibilities) && ($reinitcheck))  {
+                      if ($deeplinklevel) {
+                          $r->print(
+                              &Apache::lonhtmlcommon::actionbox(
+                                  ['<a href="/adm/flip?postdata=return:">'.$lt{'back'}.'</a>']));
+                      } elsif ((!@possibilities) && ($reinitcheck))  {
                           $r->print(
                               &Apache::lonhtmlcommon::actionbox(
                                   ['<a href="/adm/navmaps">'.$lt{'nav'}.'</a></li>'


More information about the LON-CAPA-cvs mailing list