Hi Canvas gurus,
I've got a bit of a dreamscape project that I'm looking to build and am wondering if anyone has done anything similar or is able to help me think through how to best develop it. What I'm wanting to build is a webpage on our university's site that would allow a faculty member to create a sandbox course on their own as opposed to emailing our team to do it for them.
The simplest way to achieve this would be to enable faculty to create courses within Canvas, however, I'd like to make a more controlled process that automatically adds the course to the correct subaccount, and also has a prefix appended to the reference ID.
So here's the ideal solution: a webpage where a faculty member signs in, they click a "Create Sandbox Course" button that asks what they'd like the name of the course to be, and then that course gets created and with them enrolled as the instructor. Any ideas of how to achieve this or is this too simplistic in the reality of what needs to happen?
I appreciate any and all recommendations.
Solved! Go to Solution.
I'd be happy to help you get setup.
Check out the README for more details ccsd-canvas/workrooms at master · robert-carroll/ccsd-canvas · GitHub
Specifically, skipping over the Implementation & Deployment section, which is part of our SIS Import and is there as a more complete solution.
And get right to Configuration
// the ID of the subaccount where all workrooms should be put
// the ID of the term that all workrooms should be created with (Forever)
// the roles allowed to create a workroom
|The wkrm_acct_id is the account id of a sub account within your instance, this basically makes a 'folder' for all your user created workrooms to go into, so they don't clutter your other spaces. Create the sub account in the root of your instance, or anywhere you like... this is what our Root Sub Accounts look like.Workrooms is in our root, but at the bottom alphabetically.|
The term_id of the Forever Term, I believe each instance has one, you'll just have to identify what yours is. The Live API can help here:
https://x.instructure.com/doc/api/live > Enrollment Terms > List Enrollment Terms
From the README, the Additional Considerations and workroom.enroll() options can be addressed later.
Your ideal solution is pretty much enough of a description for someone to do this with the API. Its very straightforward and I think only two API calls.
You might want other features like having the webpage show their current sandbox course(s) and/or only allowing a certain number. And maybe letting them choose some settings etc. But these are all just extras.
Limiting the number of courses that are able to be created would be a great addition to this. I could see faculty getting trigger happy with it
I had actually been curious about this since you posted the trigger happy comment. I had even started a Canvas Data view to collect Workrooms and Enrollments. I was reminded of that today... and finished my stats.
9,905 have logged in this school year
51,123 workrooms where course_state is claimed or available
2,338 users have created a course with the Workroom Button
465 of those users have created 2 or more workrooms, mostly by our course designers and folks in curriculum development
170 users have created more than 1 workroom in a day
30 of them did so on more than 1 occasion (between 2 in a day and 6 in a day)
171 created 2
28 created 3
9 created 4
1 created 5
7 created 6
3 created 7
1 created 10
That's less than 2% of active employees (9,905) that have pressed the button multiple times in a day.
Maybe next week I'll check on activity in those workrooms.
Now I can back up my statement that providing this button won't make faculty click happy.
We also purge unused courses before Fall Term.
We feed the API with some user info and place them all in a Workrooms Sub Account. We used to limit the number of workrooms they could create to 1 per day by seeding today's date, but now we seed the timestamp, or they can name it, as you see above. Staff don't typically get carried away, they either create 1 additional Workroom at a time or they want to create 8 today and start playing around with all their courses.
We also do a cleanup in summer and purge any unused courses throughout the instance with the API and Unused Courses Report, so if they create them and never get around to using them it's not much of a problem. For 40,000 employees. :smileycool:
If you're interested, I can work on sharing this later today, although probably best to say next week. I'm currently tinkering with another idea I want to get out the door.
This seems like it'd work perfectly for what I'm looking to do. Does it rely on having any permissions being set? For instance the permission that allows instructors to create classes? Because we have that option off. If we could do this as an exception to that rule and only allow them to create a sandbox course, or workroom in your instance, then perfect!
If you're willing to share I'd be EXTREMELY grateful
I'm working on making this available. The code that makes this work was written by a previous dev here, this is my first time reviewing it, and I want to evaluate it before passing it around. I'm finding there a specific issue I recently noticed working on another project within this solution.
Specifically, that retrieving the sis user id from the API /api/v1/users/self isn't possible unless the user is an ADMIN... which if I find is true, is unfortunate and also a waste of code. Not sure if this changed since it was originally written. I don't want to share anything that requires more documentation or maintenance than necessary, so I ask for a little patience while I work this out.
EDIT: Found the answer... Users - Canvas LMS REST API Documentation
SIS ID for the user's account. To set this parameter, the caller must be able to manage SIS permissions.
EDIT 2: OK OK OK
The thread Retrieving Own SIS ID from Users API Call As Teacher, addresses the issue with a solution, formulated by @aleonard , who has since left our department via promotion. :smileygrin:
I will be posting soon, with some refactored code for ease of 'configuration' and some explanation for deployment suggestions.
@michael_mcgarry , I saw two developers demonstrate a micro LTI for this at InstructureCon 2016's Hack Night. While I've never used this myself, I think it suits your purposes: It places a button on instructors' dashboard that allows them to create a new course, automatically enrolls them in that course, and populates the sub-account of your choice with that course. Here's the link to their page on GitHub: GitHub - CUOnline/sandbox: LTI tool that generates sandbox courses in Canvas