[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

<a  
href="/res/msu/apcalc/hwsource/hw00/HW00_01.problem?symb=uploaded%2fmsu%2f33803011027874598msul1%2fdefault_1266800421%2esequence___3___msu%2fapcalc%2fhwsource%2fhw00%2fHW00_01%2eproblem">HW02</a>

and (b) an encrypted URL:

<a  
href="/enc/45/48e3d82442917726e5113006875a02e6ab97061803a73590a1a8e004ad5357bfce080f54657e96368dc33f23f7f5000c38fae80fce3a8a4ed61800854ea99560?symb=%2fenc%2f110%2ff96688cbf61f4ccd3412cb69f66dd3539290e52a69ee0fb812d2e0f7dbda6596531d2b5f43e7ceea005cf96ecc721a2f54f5d68b396ef408442a9387e74bed2e3d8a4f49fb572928494f82d65740b9aa097ec808af7f6bf6890bb4ad00d5b212d59d93ed4390173fb3a8f744a4222d081a723de880fdea43ffcba4ca959b83960d03e237599023c98072153bef23267e">HW02</a>

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
MSU LON-CAPA group


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
>>