Community

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ilovell
Community Contributor

Redirect Tool app is there a way to assign a user role?

Jump to solution

I am trying to add a web link on the course nav for only teachers in all their courses. The redirect tool works at acct level but, it adds link for everyone. Is there a way to add the redirect tool but, limit it to work only for Teachers? Or am I going to have create something else? If create something else do I have to create a whole lti app or can I just add something to acct .js or .css files?

Tags (1)
1 Solution
James
Community Champion

ilovell​,

What you want to do is create a Course Navigation link, rather than an Account Navigation link. The Course Navigation link supports a visibility setting:

This specifies what types of users will see the link in the course navigation. "public" means anyone accessing the course, "members" means only users enrolled in the course, and "admins" means only Teachers, TAs, Designers and account admins will see the link.

So, if you set the visibility to "admins", then teachers (and admins) can see it, but students cannot. I did verify this, it shows up as the teacher of a course, but in student view, the link is not there. The navigation button is enabled in the settings, so this works even if a teacher accidentally drags it up there like  @kona ​ was worried about in her post about using the Redirect Tool.

Warning: I did that testing through my own API call, not through the Redirect Tool.

Redirect Tool Sounds Promising ...

I had no idea whether or not the redirect tool would do this or not as I had never used it. So, I went to it to test it out.

If you look on the Config Options, screen, there is a Enable Course Navigation option that you will need to check. You may also want to check the Force Open in a New Tab option, depending on where you want the teachers to go.

85173_pastedImage_4.png

I then copy/pasted the configuration URL into the App settings for a course and the Navigation button showed up on the left side.

When I clicked it, I got the message asking me to continue on to a new tab.

85174_pastedImage_13.png

Clicking that opened up the non-LTI link that I had provided. For what it's worth, if I did not check the New Tab box, then the non-LTI page did not load (it was a secure connection). I tried it with a couple of different non-LTI URLs and none of them would load without checking the New Tab box.

If my link had been to an LTI application rather than just a regular URL, then I could have done all this with an External Tools API call and not messed with the Redirect Tool at all.

The problem with the Redirect Tool is that even though you can specify to Enable Course Navigation, they don't allow you to set the visibility. Without this, it defaults to "public" and anyone with access to the course can see the Navigation Link.

What Actually Works

So, the Redirect LTI doesn't allow you to specify that only admins should see it, but we can simulate what the Redirect LTI tool would do with an API call.

You can do this using the Create an External Tool API endpoint.

     POST /api/v1/courses/:course_id/external_tools

The :course_id is the Canvas Course ID for a course, it's found at the end of the URL when your on a course homepage. You can also use a SIS ID.

Here are the fields you'll need when you post that form.

  • name: The name of the external tool. This will appear under the Course Settings >> Apps tab.
  • consumer_key: Can be anything for the redirect tool
  • shared_secret: Can be anything for the redirect tool
  • privacy_level: Anonymous should suffice if you're redirecting to a non-LTI tool.
  • url = https://www.edu-apps.org/redirect
  • course_navigation[text]: This is the name that will show up in the navigation links
  • course_navigation[visibility] = admins
  • course_navigation[default] = 1    Enable by default
  • custom_fields[url]: The URL where you would like to send people
  • custom_fields[new_tab] = 1

After you POST that form, you should have a new link on the side navigation bar and a new LTI tool in the Apps section.

If you have multiple courses, then obtain a list of Course IDs and loop through it for every course that needs the link.

Note: I revised my post after reading this discussion: Redirect Tool (External App/LTI)  While quite informative, they didn't want to limit who could see the Navigation Link. What it did for me was remind me that I had tested the visibility with the API call and not with the Redirect Tool. That's when I went back and saw that had created the link with a public visibility. That led to the addition of the headers about "sounds promising ..." and "what works".

Hope this helps you.

View solution in original post

14 Replies
kona
Community Coach
Community Coach

ilovell​, as far as I'm aware as long as the Instructors left the navigation link hidden from students (grayed out) then they would be able to access the content, but the students would not be able to see it - How do I reorder and hide Course Navigation links?

Yet, if an instructor accidentally made it visible then students would have access to it and I'm not sure if you can prevent this - possibly some custom Javascript?

James
Community Champion

ilovell​,

What you want to do is create a Course Navigation link, rather than an Account Navigation link. The Course Navigation link supports a visibility setting:

This specifies what types of users will see the link in the course navigation. "public" means anyone accessing the course, "members" means only users enrolled in the course, and "admins" means only Teachers, TAs, Designers and account admins will see the link.

So, if you set the visibility to "admins", then teachers (and admins) can see it, but students cannot. I did verify this, it shows up as the teacher of a course, but in student view, the link is not there. The navigation button is enabled in the settings, so this works even if a teacher accidentally drags it up there like  @kona ​ was worried about in her post about using the Redirect Tool.

Warning: I did that testing through my own API call, not through the Redirect Tool.

Redirect Tool Sounds Promising ...

I had no idea whether or not the redirect tool would do this or not as I had never used it. So, I went to it to test it out.

If you look on the Config Options, screen, there is a Enable Course Navigation option that you will need to check. You may also want to check the Force Open in a New Tab option, depending on where you want the teachers to go.

85173_pastedImage_4.png

I then copy/pasted the configuration URL into the App settings for a course and the Navigation button showed up on the left side.

When I clicked it, I got the message asking me to continue on to a new tab.

85174_pastedImage_13.png

Clicking that opened up the non-LTI link that I had provided. For what it's worth, if I did not check the New Tab box, then the non-LTI page did not load (it was a secure connection). I tried it with a couple of different non-LTI URLs and none of them would load without checking the New Tab box.

If my link had been to an LTI application rather than just a regular URL, then I could have done all this with an External Tools API call and not messed with the Redirect Tool at all.

The problem with the Redirect Tool is that even though you can specify to Enable Course Navigation, they don't allow you to set the visibility. Without this, it defaults to "public" and anyone with access to the course can see the Navigation Link.

What Actually Works

So, the Redirect LTI doesn't allow you to specify that only admins should see it, but we can simulate what the Redirect LTI tool would do with an API call.

You can do this using the Create an External Tool API endpoint.

     POST /api/v1/courses/:course_id/external_tools

The :course_id is the Canvas Course ID for a course, it's found at the end of the URL when your on a course homepage. You can also use a SIS ID.

Here are the fields you'll need when you post that form.

  • name: The name of the external tool. This will appear under the Course Settings >> Apps tab.
  • consumer_key: Can be anything for the redirect tool
  • shared_secret: Can be anything for the redirect tool
  • privacy_level: Anonymous should suffice if you're redirecting to a non-LTI tool.
  • url = https://www.edu-apps.org/redirect
  • course_navigation[text]: This is the name that will show up in the navigation links
  • course_navigation[visibility] = admins
  • course_navigation[default] = 1    Enable by default
  • custom_fields[url]: The URL where you would like to send people
  • custom_fields[new_tab] = 1

After you POST that form, you should have a new link on the side navigation bar and a new LTI tool in the Apps section.

If you have multiple courses, then obtain a list of Course IDs and loop through it for every course that needs the link.

Note: I revised my post after reading this discussion: Redirect Tool (External App/LTI)  While quite informative, they didn't want to limit who could see the Navigation Link. What it did for me was remind me that I had tested the visibility with the API call and not with the Redirect Tool. That's when I went back and saw that had created the link with a public visibility. That led to the addition of the headers about "sounds promising ..." and "what works".

Hope this helps you.

ilovell
Community Contributor

Thanks!

I am going to see what if can come up with using the API. This will be my first real api endeavor. If I can't come up with something I'll leave it to the instructors if they want to hide it in the nav.

ilovell
Community Contributor

I am soooo close! Where is the best place to pull a list of all courses published or unpublished by term with the canvas course number?

I watched Hammer of the Gods from instructurecon and installed Postman. I was doing the happy jumping up and down dance until... I realized I didn't have all my courses.  I tried doing a Provisioning report by term but, it is definitely missing courses. The ones it had worked perfect.

James
Community Champion

ilovell​,

I'm glad you're making progress.

The provisioning report is supposed to give a copy of everything that's in Canvas, not just those done through a SIS import. So, if there are courses that are missing and you specified a term, it might be because they don't have the term you think they do.

I would try running a provisioning report without specifying a term. The term id, both Canvas and the one you specified, are available within that file. If you find the course that was missing, you can check the term and make sure that was the problem.

The other option,less likely though, is that the course is deleted. There is an option on the provisioning report to include deleted objects. So if you can't find a course after using all terms, then you might try that.

ilovell
Community Contributor

SUCCESS! I think I was just clicking too quickly through the courses after I ran it and canvas hadn't caught up to them all yet. I just went through ones that weren't working and the link was now there for teachers only. So far so good.

Thank you very much for your help!

angela
Instructure
Instructure

Hello Iva,

I realize this is mostly resolved for you, but I did want to share some information for future developments and others on this thread. You can use the Redirect LTI and have a link only visible to admins and teachers on the left navigation. You use the initial workflow for setting up the Redirect LTI. You do need to do this from eduappcenter.com instead of through the app center in Canvas. However, the trick is that you will use the XML instead of the Launch URL when adding this to your canvas instance. You can get the XML by taking the Launch URL you are given, and pasting that into a browser window. You then copy the XML, and either add or change the visibility parameter. Now, when you are at the step to add this to your Canvas instance, you will choose to add a new app manually, and then select the option to add by pasting the XML.  I have given better steps and screenshots on this open google doc.

https://docs.google.com/document/d/1HndPhl_U4N3dgyQ49jMvhkLuODMNHzaZRbBnaII5hEM/edit

ilovell
Community Contributor

Most Excellent! and nice docs. Will be applying it in production for summer courses. Added bonus, doesn't look like it will double links when instructors copy their courses. Problem I am having this semester.

Figuring out postman to do this originally has saved me so much time on other tasks. I now have a bucket full of various api fun I am applying to all new courses.

Thanks!

crafte
Community Champion

Hi angela‌, I followed the steps you provided in your Google doc in order to add a link via the Redirect Tool on our test server. My XML code was similar to the one shown in your example (except for the links pointing to our Canvas instance). I edited the visibility parameter. When I paste the code into the XML field for the new app, I receive an error message: incorrect XML code. 

Are the steps still working for you?

ilovell
Community Contributor

I just tried it again, haven't done it in awhile. Seems to still work. Only difference from Anglea's docs that I did different is make sure you are doing "admins" not "Admins" <lticm:property name="visibility">admins</lticm:property>

crafte
Community Champion

Hi ilovell, it is still not working for me. I followed the steps to get the xml code and the manual steps to add the app via past xml. Below is the code I received after I used the resulting URL from the Eduappcenter. I removed the actual link I want to redirect to and replaced it with 'mycollege.test.instructure.com/courses/1234567'.

<cartridge_basiclti_link xsi:schemaLocation="http://www.imsglobal.org/xsd/imslticc_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticc_v1p0.xsd http://www.imsglobal.org/xsd/imsbasiclti_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0p1.xsd http://www.imsglobal.org/xsd/imslticm_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd http://www.imsglobal.org/xsd/imslticp_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd"><blti:title>Redirect Tool</blti:title><blti:description>Add links to external web resources that show up as navigation items in course, user or account navigation. Whatever URL you specify is loaded within the content pane when users click the link.</blti:description><blti:launch_url>https://www.edu-apps.org/redirect</blti:launch_url><blti:custom><lticm:property name="url">https://mycollege.test.instructure.com/courses/1234567</lticm:property></blti:custom><blti:extensions platform="canvas.instructure.com"><lticm:options name="course_navigation"><lticm:property name="enabled">true</lticm:property><lticm:property name="visibility">admins</lticm:property></lticm:options><lticm:property name="icon_url">https://www.edu-apps.org/assets/lti_redirect_engine/redirect_icon.png</lticm:property><lticm:property name="link_text"/><lticm:property name="privacy_level">anonymous</lticm:property><lticm:property name="tool_id">redirect</lticm:property></blti:extensions></cartridge_basiclti_link>

The code looks identical to the one I saw in the Google doc step-by-step guide but I am still getting the 'invalid xml code' message. What am I missing? 

James
Community Champion

Your header is missing a lot of key components. You just have the xsi:schemaLocation and not the other parts.

Go to the first example at Importing Extended Tool Configurations - Canvas LMS REST API Documentation and copy everything from the top, down to but not including the <blti:title> part and replace the top of what you have with that.

<?xml version="1.0" encoding="UTF-8"?>
<cartridge_basiclti_link xmlns="http://www.imsglobal.org/xsd/imslticc_v1p0"
    xmlns:blti = "http://www.imsglobal.org/xsd/imsbasiclti_v1p0"
    xmlns:lticm ="http://www.imsglobal.org/xsd/imslticm_v1p0"
    xmlns:lticp ="http://www.imsglobal.org/xsd/imslticp_v1p0"
    xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation = "http://www.imsglobal.org/xsd/imslticc_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticc_v1p0.xsd
    http://www.imsglobal.org/xsd/imsbasiclti_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0.xsd
    http://www.imsglobal.org/xsd/imslticm_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd
    http://www.imsglobal.org/xsd/imslticp_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd">
crafte
Community Champion

Hi  @James , thank you very much. That worked! Smiley Happy 

vanzandt
Community Champion

I just created this Feature Request (https://community.canvaslms.com/ideas/10097-add-visibility-to-redirect-tool-app-configuration ) in hopes that they can make the course navigation visibility setting an easy drop-down choice from the app configuration settings. It would be nice if our instructors can easily make this choice for themselves without having to get into APIs and XML.  Appreciate your votes if you think it's something that you think might be useful.