Commit 4eff4a2e authored by Haoyu Z's avatar Haoyu Z
Browse files

add submissions

parent 87c2b408
......@@ -40,13 +40,15 @@ def extractData(conn, cur):
fl = open(filepath)
sql_str = fl.read()
sql_str = sql_str.strip().replace("\n", " ")
flag = 0
try:
commitAndExecute(conn, cur, sql_str)
if userId not in query[questionId]:
query[questionId][userId] = {}
query[questionId][userId][num] = sql_str
except (Exception, psycopg2.DatabaseError) as error:
print(traceback.format_exc())
flag = 1
def main():
......@@ -61,7 +63,7 @@ def main():
for question_id in [1,2,3,4,5,6,7,8]:
if question_id != 2:
continue
f = open("hw1-provenance/q"+question_id)
f = open("hw1-provenance/q"+str(question_id))
question_submissions = query[question_id]
for student_id in list(question_submissions.keys()):
submissions = question_submissions[student_id]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment