We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e9f162 commit fc99e23Copy full SHA for fc99e23
create_dummy_students.py
@@ -0,0 +1,30 @@
1
+from config import PROD_URL, PROD_KEY
2
+from canvasapi import Canvas
3
+
4
+canvas = Canvas(EACC_URL, EACC_KEY)
5
6
+# Run a quick loop and make some dummy students
7
+account = canvas.get_account(1)
8
9
+for i in range(1, 5):
10
+ # Create a user object
11
+ user = {
12
+ 'name': 'Test Student ' + str(i),
13
+ 'terms_of_use': True,
14
+ 'skip_registration': True,
15
+ }
16
17
+ # Update the user login info
18
+ pseudonym = {
19
+ 'unique_id': 'tstudent' + str(i),
20
+ 'password': 'tstudent' + str(i),
21
+ 'send_confirmation': False,
22
23
24
+ try:
25
+ account.create_user(pseudonym, user=user)
26
+ print(f'Successfully created {user['name']}')
27
+ except Exception as e:
28
+ print(e)
29
30
0 commit comments