How to create custom assignment for 10K+ students

Jump to solution
akshay_sonvane
Community Novice

The university wants to create a custom assignment for 10k+ students, who have been added to a specific course.

Based on each students university student id a link is generated. We want the students to get this link as there assignment. What is the best way to approach this problem.

Possible solutions thought of:

1) Assignments API allows to create a new assignment using the "assignment[group_category_id]"  to customise assignment for each group. Each group will only have one student. (With help of Group API create a separate group for each student)

1 Solution

I wasn't thinking of using a pre-made LTI -- guess that's the programmer in me, always reinventing the wheel. The good news is that if you need it to just be a link, then that would be a fairly short LTI to write using some of the existing libraries that are out there.

The student SIS id can be passed to an LTI if the privacy on the LTI is set to public. It's returned as lis_person_sourcedid. The LTI could be a very reasonably simple script to look up (or generate) the link to the survey. Our student orientation has an LTI like this that I wrote -- I take the SIS from Canvas and save the results of a time-management survey keyed off their SIS ID.

You might even be able to have it automatically redirect them to the correct page based on the link, rather than just providing the link.

Another option would be to do this from within Canvas using custom JavaScript that you put into your global file, but make sure that only runs on a single page to avoid needless calls. The problem here is that within Canvas, students probably don't have permissions to read the SIS information, so a script running from within Canvas wouldn't know their student ID. There is an ENV.current_user object available to scripts and it contains their name, Canvas ID (not SIS Id), avatar image url, and html url to their about page. There are also ENV.USER_EMAIL that should be available that could be used as a key that will hopefully be unique.

So, I could see something like this possibly working:

  1. Create an assignment in Canvas that provides instructions and has a place for a link, but no link. Perhaps instructions to "wait while we generate the link". Give it an HTML id= attribute so you can easily refer to it in the programming and make sure it's available for use before changing it.
  2. Check to make sure you're on the right page. If so continue, otherwise return.
  3. Take their ENV.USER_EMAIL value and make an AJAX call to another server that will use it to lookup or generate the link that is needed.
  4. If that returns successfully, then alter the existing content of the page to provide the link. If it fails, then you might change the message to be some kind of useful message about trying again later or contacting somebody for help.

If the link could be generated by information already exposed to the web page by Canvas, you wouldn't need to mess with the AJAX call.

View solution in original post