-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.py
27 lines (23 loc) · 874 Bytes
/
utils.py
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
import json
def get_code_dict(student_ids, pivot_code_id, code_df):
code_dict = {}
for student_id in student_ids:
code_dict[student_id] = list(code_df[code_df['CodeStateID'] == student_id]['Code'].values)[0]
# add pivot code
code_dict[pivot_code_id] = list(code_df[code_df['CodeStateID'] == pivot_code_id]['Code'].values)[0]
return code_dict
def get_problem_statement():
with open('IRT_dataset/problem_502_45.txt') as f:
problem_statement = f.read()
return problem_statement
def get_pivot_code_id():
with open('IRT_dataset/502_45/pivot_code_id.txt') as f:
pivot_code_id = f.read().strip()
return pivot_code_id
def load_test_cases():
'''
Load test cases from the test_cases folder
'''
with open('IRT_dataset/502_45/test_cases.json') as f:
test_cases = json.load(f)
return test_cases