[LON-CAPA-users] link to item in a course

Stuart Raeburn lon-capa-users@mail.lon-capa.org
Sun, 21 Feb 2010 20:47:29 -0500

> I don't believe that works. Deep linking only seems to work for
> documents that are publicly shared.

In my experience deep linking within a course works for any resource  
which is visible to a student with a role in the course, (this is not  
only true for resources which are published "public").  Note: this  
applies to resources, so you need to link to the first item in a  
folder, rather than a folder itself.

The one caveat is that you need to be careful about resources for  
which the URL has been set to be encrypted ("Hidden URL" is set for  
the resource, or for the directly enclosing folder, or for some higher  
folder in the hierarchy).  In that case the encrypted URL (which  
begins /enc/) needs to be used in the href attribute in your link,  
instead of the plain URL, which begins /res/).

The simplest way to make sure you have the correct URL is to go to  
Navigate Contents, and then use "Switch course role to ..." to select  
a student role.  Open the folders in the Navigation Contents page, and  
then mouse over the link to any of the resources to which you wish to  
deep link.  Use the appropriate mouse button/key combination to copy  
the link location.

This link includes the path to the resource, as well as the query  
string to the "symb" which uniquely identifies the particular resource  
(in case you use a single resource multiple times in a course, e.g.,  
in separate folders etc.).  The hostname should be deleted from the  
front of the link and then the remainder pasted into the href  
attribute in the <a href="">Go to HW02</a> link.

As noted above, currently LON-CAPA requires you to link to the first  
resource in a folder, rather than a folder itself.

As an example, the following is the HTML mark-up you might use for (a)  
an unecrypted URL


and (b) an encrypted URL:


Note: if the encrypted version is used, this will work for both Course  
Coordinators (for whom the URL is usually unencrypted) and also  
students, TAs etc. (for whom it is encrypted). Use this format if "URL  
hidden" has been used for the resource (or a parent folder).

There is a bug report - http://bugs.loncapa.org/show_bug.cgi?id=3987  
(marked as resolved) - which Lars filed in 2005 about deep-linking.   
It's not clear whether the issue he encountered was because the  
resources he linked to had encrypted URLs, or because there was some  
other issue (since fixed).

Deep-linking has received some attention in development for the 2.9  
release; specifically for the case of deep linking to a particular  
resource within a course (from outside of LON-CAPA).  In that instance  
an additional item would needs to be passed in the query string (the  
role), and if a user is not logged in authentication occurs first  
before the deep linked resource is displayed.  More information will  
be available about this as part of the 2.9 release.

Stuart Raeburn

Quoting Lars Jensen <ljensen@mail.tmcc.edu>:

> Hi Everyone,
> On Sun, Feb 21, 2010 at 12:25 PM, Mark Lucas <lucasm@ohio.edu> wrote:
>> My understanding is that you can go to that spot in the course, copy the
>> behemoth of a
>> URL (with all the options) and then paste that into a page, and that would
>> work. As long as
>> you include the parameters, I think that uniquely describes the resource AND
>> it's location
>> in your course.
> I don't believe that works. Deep linking only seems to work for
> documents that are publicly shared.
> Lars.
>> Anybody else - does that "break" anything?
>> Mark
>> On Feb 16, 2010, at 9:53 AM, Jay Sullivan wrote:
>> Is there a way to post a link to an item in a course?
>> For example, I have a simple page that contains all announcements for the
>> course.
>> Occasionally, I would like to be able to provide a link to a specific
>> location in the course. For example, a link to a folder name "HW2a" . When
>> the student clicks this link it would take them directly to that folder
>> (rather than having to go through "Navigate Contents").
>> --
>> Mark Lucas  email: lucasm@ohiou.edu
>> 252D Clippinger Lab phone: (740)597-2984
>> Department of Physics and Astronomy fax: (740)593-0433
>> Ohio University
>> Athens, OH 45701