summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrail Finder (aider) <wohilas@gmail.com>2025-04-05 15:43:04 +0300
committerGrail Finder (aider) <wohilas@gmail.com>2025-04-05 15:43:04 +0300
commit6ae9897f18372120ed2d2b89af1153ed4353949b (patch)
tree6d18c95d48fad3c46d2cf8179a3807cda7d99600
parent1cba383c5f8781218eb71bfefa667f72dd01a58a (diff)
fix: add missing fields to question table schema and inserts
-rw-r--r--scripts/load_quiz_data.py15
1 files 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()