Sample Data for API Testing?

Jump to solution
PaulNagami
Community Contributor

Short version: I would like to generate a lot of fake students and quiz data in a free demo shell to do testing on my API scripts.

Motivation:

I've been using the Canvas API to set up faster grading tools for free response questions on Classic Quizzes. While this has worked so far, my scripts make a lot of fussy API calls and are quite brittle right now. I would therefore like to perform unit and integration tests on a fake course with fake students. I'm a biologist and hobbyist programmer, not a professional, so this is EXTRA important; my code likely needs more checks than it has!

Obviously, I do NOT want to use any of my real courses for test data, especially since I'd eventually like to put this on a public GitHub.

So I'm looking for fake courses with fake student data.

What I've Tried:

I got a free Canvas shell and tried making fake students manually. It's not very workable! I can set up GMail addresses with "+" suffixes (myname+teststudent1@gmail.com) but each must be manually enrolled, and quiz data entered. 

Questions:

  • Is there a good way to use the API to quickly make a batch of test students and enroll them in a test shell, then populate it with fake quiz data?
  • Has anybody already made such a 'testing course' for import?
    • (I'm wondering what Instructure is doing internally to test the API... such a fake shell might exist somewhere.)

 

Labels (1)
0 Likes
1 Solution
agschmid
Community Contributor

I know absolutely nothing about the free demo Canvas shell, but if sis imports are allowed there, that would be a simple way of adding users:

https://canvas.instructure.com/doc/api/file.sis_csv.html

There's also the api to create new users: https://canvas.instructure.com/doc/api/users.html#method.users.create

View solution in original post