From 6ae9897f18372120ed2d2b89af1153ed4353949b Mon Sep 17 00:00:00 2001 From: "Grail Finder (aider)" Date: Sat, 5 Apr 2025 15:43:04 +0300 Subject: fix: add missing fields to question table schema and inserts --- scripts/load_quiz_data.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/load_quiz_data.py b/scripts/load_quiz_data.py index 25186e6..6287d4c 100644 --- a/scripts/load_quiz_data.py +++ b/scripts/load_quiz_data.py @@ -17,7 +17,10 @@ def load_questions(json_path, db_path): option4 TEXT, correct_index INTEGER, requirement TEXT, - explanation TEXT)''') + explanation TEXT, + status INTEGER, + exam_id INTEGER, + mixed_id INTEGER)''') # Load JSON data with open(json_path) as f: @@ -31,17 +34,19 @@ def load_questions(json_path, db_path): options.append("") c.execute('''INSERT INTO questions - (id, text, option1, option2, option3, option4, correct_index, requirement, explanation) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)''', + (id, text, option1, option2, option3, option4, correct_index, requirement, explanation, status, exam_id, mixed_id) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''', (q['id'], q['question'], options[0], options[1], options[2], options[3], - q['correct_index'], q.get('requirement', ''), - q.get('explanation', ''))) + q.get('explanation', ''), + q.get('status', 0), + q.get('exam_id', 0), + q.get('mixed_id', 0))) conn.commit() conn.close() -- cgit v1.2.3