forked from Fellowmark/fellowmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seed.sh
executable file
·78 lines (51 loc) · 9.6 KB
/
seed.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
ADMIN_TOKEN=$(curl -X GET "http://localhost:5000/admin/auth/[email protected]&password=admin" | jq -r '.message')
PROF_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/staff/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Akshay Narayan"}' | jq '.ID')
MODULE_ID=$(curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module -d '{"code": "CS2103", "name":"Software Engineering", "semester": "AY2021/2022 1"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/supervise -d '{"moduleId": '"$MODULE_ID"', "staffId":'"$PROF_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Gerard Berg"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Linwood Clark"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Derek Marquez"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Romeo Estrada"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Alfredo Schultz"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Lesley Stewart"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Alton Shea"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Suzanne Smith"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Ervin Bass"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Vance Kent"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Frances Erickson"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Trisha Lin"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Ana Franklin"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Christi Hubbard"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Herschel Snyder"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Dallas Brennan"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Yesenia Schroeder"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Mitch Larsen"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Margarito Munoz"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
STUDENT_ID=$(curl -X POST -H "Content-Type: application/json" http://localhost:5000/student/auth/signup -d '{"email": "[email protected]", "password": "12345678", "name": "Violet Liu"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/module/enroll -d '{"moduleId": '"$MODULE_ID"', "studentId":'"$STUDENT_ID"'}'
ASSIGNMENT_ID=$(curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/assignment -d '{"name": "Assignment 1", "moduleId": '"$MODULE_ID"', "groupSize": 3}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/assignment/pairs/initialize -d '{"id": '"$ASSIGNMENT_ID"'}'
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/assignment/pairs/assign -d '{"id": '"$ASSIGNMENT_ID"'}'
QUESTION_ID=$(curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/assignment/question -d '{"questionNumber": 1, "assignmentId": '"$ASSIGNMENT_ID"', "questionText": "This is a question"}' | jq '.ID')
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/assignment/rubric -d '{"questionId": '"$QUESTION_ID"', "criteria": "Reliability", "description": "How reliable is the system", "minMark": 1, "maxMark": 10}'
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ADMIN_TOKEN" http://localhost:5000/assignment/rubric -d '{"questionId": '"$QUESTION_ID"', "criteria": "Quality", "description": "What is the quality of your system", "minMark": 1, "maxMark": 10}'