Fix seed.js constraints: empty string for quiz body and SA choices, one assignment per student
Build and Push Docker Image / build-and-push (push) Successful in 36s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-10-19 13:44:21 -04:00
1 parent 43850693ac
commit 16e3bbbd83
1 file changed
+15 -24
+15 -24
View File
@@ -124,12 +124,12 @@ insertItem.run(itemId, laUnit1, 'lesson', 'Parts of Speech', `
const lessonPos = itemId++;
// Quiz: Parts of Speech
insertItem.run(itemId, laUnit1, 'quiz', 'Parts of Speech Quiz', null, 20, null, 2, daysAgo(10), 1, 'none');
insertItem.run(itemId, laUnit1, 'quiz', 'Parts of Speech Quiz', '', 20, null, 2, daysAgo(10), 1, 'none');
const quizPos = itemId++;
insertQ.run(qId++, quizPos, 'mc', 'Which word is a NOUN?', JSON.stringify(['quickly','beautiful','mountain','runs']), 'mountain', 5, 1);
insertQ.run(qId++, quizPos, 'mc', 'Which word is a VERB?', JSON.stringify(['slowly','purple','jump','the']), 'jump', 5, 2);
insertQ.run(qId++, quizPos, 'mc', 'Which word is an ADJECTIVE?', JSON.stringify(['gracefully','enormous','laugh','because']), 'enormous', 5, 3);
insertQ.run(qId++, quizPos, 'sa', 'Write a sentence using a preposition.', null, null, 5, 4);
insertQ.run(qId++, quizPos, 'sa', 'Write a sentence using a preposition.', '[]', '', 5, 4);
// Lesson: Sentence Structure
insertItem.run(itemId, laUnit1, 'lesson', 'Sentence Structure', `
@@ -195,11 +195,11 @@ insertItem.run(itemId, mathUnit1, 'lesson', 'Understanding Fractions', `
`, 0, null, 1, daysAgo(21), 0, 'none');
itemId++;
insertItem.run(itemId, mathUnit1, 'quiz', 'Fractions Quiz', null, 30, null, 2, daysAgo(14), 1, 'none');
insertItem.run(itemId, mathUnit1, 'quiz', 'Fractions Quiz', '', 30, null, 2, daysAgo(14), 1, 'none');
const quizFrac = itemId++;
insertQ.run(qId++, quizFrac, 'mc', 'What is the simplified form of 6/9?', JSON.stringify(['1/3','2/3','3/4','6/9']), '2/3', 10, 1);
insertQ.run(qId++, quizFrac, 'mc', 'Which fraction is equivalent to 1/2?', JSON.stringify(['2/3','3/4','4/8','5/9']), '4/8', 10, 2);
insertQ.run(qId++, quizFrac, 'sa', 'Write two fractions that are equivalent to 3/4.', null, null, 10, 3);
insertQ.run(qId++, quizFrac, 'sa', 'Write two fractions that are equivalent to 3/4.', '[]', '', 10, 3);
insertItem.run(itemId, mathUnit1, 'lesson', 'Adding & Subtracting Fractions', `
<h2>Same Denominator</h2>
@@ -268,13 +268,13 @@ insertItem.run(itemId, sciUnit1, 'lesson', 'Water Cycle Overview', `
`, 0, null, 1, daysAgo(18), 0, 'none');
itemId++;
insertItem.run(itemId, sciUnit1, 'quiz', 'Water Cycle Quiz', null, 25, null, 2, daysAgo(12), 1, 'none');
insertItem.run(itemId, sciUnit1, 'quiz', 'Water Cycle Quiz', '', 25, null, 2, daysAgo(12), 1, 'none');
const quizWater = itemId++;
insertQ.run(qId++, quizWater, 'mc', 'What is the process where liquid water becomes water vapor?', JSON.stringify(['Condensation','Precipitation','Evaporation','Collection']), 'Evaporation', 5, 1);
insertQ.run(qId++, quizWater, 'mc', 'What energy source drives the water cycle?', JSON.stringify(['The moon','Wind','The sun','Earth\'s core']), 'The sun', 5, 2);
insertQ.run(qId++, quizWater, 'mc', 'What is it called when water falls from clouds?', JSON.stringify(['Evaporation','Condensation','Collection','Precipitation']), 'Precipitation', 5, 3);
insertQ.run(qId++, quizWater, 'mc', 'Which of these is NOT a form of precipitation?', JSON.stringify(['Rain','Snow','Fog','Hail']), 'Fog', 5, 4);
insertQ.run(qId++, quizWater, 'sa', 'Explain in your own words what condensation is.', null, null, 5, 5);
insertQ.run(qId++, quizWater, 'sa', 'Explain in your own words what condensation is.', '[]', '', 5, 5);
insertItem.run(itemId, sciUnit1, 'assignment', 'Water Cycle Diagram', `
Draw and label a diagram of the water cycle. Your diagram must include:
@@ -327,12 +327,12 @@ insertItem.run(itemId, histUnit1, 'lesson', 'The 13 Original Colonies', `
`, 0, null, 1, daysAgo(25), 0, 'none');
itemId++;
insertItem.run(itemId, histUnit1, 'quiz', 'Colonial America Quiz', null, 20, null, 2, daysAgo(20), 1, 'none');
insertItem.run(itemId, histUnit1, 'quiz', 'Colonial America Quiz', '', 20, null, 2, daysAgo(20), 1, 'none');
const quizColonial = itemId++;
insertQ.run(qId++, quizColonial, 'mc', 'Which region was known as the "breadbasket" colonies?', JSON.stringify(['New England','Middle Colonies','Southern Colonies','Western Territories']), 'Middle Colonies', 5, 1);
insertQ.run(qId++, quizColonial, 'mc', 'What was the first permanent English settlement in America?', JSON.stringify(['Plymouth','Boston','Jamestown','Philadelphia']), 'Jamestown', 5, 2);
insertQ.run(qId++, quizColonial, 'mc', 'How many original colonies were there?', JSON.stringify(['10','12','13','15']), '13', 5, 3);
insertQ.run(qId++, quizColonial, 'sa', 'Name two crops grown in the Southern Colonies.', null, null, 5, 4);
insertQ.run(qId++, quizColonial, 'sa', 'Name two crops grown in the Southern Colonies.', '[]', '', 5, 4);
insertItem.run(itemId, histUnit1, 'lesson', 'Daily Life in the Colonies', `
<h2>Life in Colonial Times</h2>
@@ -383,11 +383,11 @@ insertItem.run(itemId, bibleUnit1, 'lesson', 'Noah and the Ark', `
`, 0, null, 1, daysAgo(10), 0, 'none');
itemId++;
insertItem.run(itemId, bibleUnit1, 'quiz', 'Noah and the Ark Quiz', null, 15, null, 2, daysAgo(7), 1, 'none');
insertItem.run(itemId, bibleUnit1, 'quiz', 'Noah and the Ark Quiz', '', 15, null, 2, daysAgo(7), 1, 'none');
const quizNoah = itemId++;
insertQ.run(qId++, quizNoah, 'mc', 'Where is the story of Noah found in the Bible?', JSON.stringify(['Exodus','Matthew','Genesis','Psalms']), 'Genesis', 5, 1);
insertQ.run(qId++, quizNoah, 'mc', 'How many days and nights did it rain?', JSON.stringify(['7','20','40','100']), '40', 5, 2);
insertQ.run(qId++, quizNoah, 'sa', 'What did the rainbow represent after the flood?', null, null, 5, 3);
insertQ.run(qId++, quizNoah, 'sa', 'What did the rainbow represent after the flood?', '[]', '', 5, 3);
insertItem.run(itemId, bibleUnit1, 'lesson', 'David and Goliath', `
<h2>Courage and Faith</h2>
@@ -446,11 +446,7 @@ insertSub.run(subId++, 1, quizNoah, 'done', 12, 15, noahAnswers, tsAgo(6));
insertSubHist.run(1, quizNoah, 12, 15, noahAnswers, tsAgo(6));
// Liam's completed work
// Fractions Quiz — 20/30 (Liam, first attempt)
const fracAnswersLiam1 = JSON.stringify({ 1: '2/3', 2: '3/4', 3: '4/6 and 8/12' });
insertSub.run(subId++, 2, quizFrac, 'done', 20, 30, fracAnswersLiam1, tsAgo(15));
insertSubHist.run(2, quizFrac, 20, 30, fracAnswersLiam1, tsAgo(15));
// Liam retook — 27/30
// Fractions Quiz — 27/30 (Liam, best score)
const fracAnswersLiam2 = JSON.stringify({ 1: '2/3', 2: '4/8', 3: '6/8 and 9/12' });
insertSub.run(subId++, 2, quizFrac, 'done', 27, 30, fracAnswersLiam2, tsAgo(12));
insertSubHist.run(2, quizFrac, 27, 30, fracAnswersLiam2, tsAgo(12));
@@ -544,15 +540,10 @@ bibleWords.forEach(([w, s, d]) => insertWord.run(wordId++, list4, w, s, d));
console.log('Spelling lists and words created.');
/* ── assignments (connect students to lists) ──────────────── */
const insertAssignment = db.prepare('INSERT INTO assignments (student_id, list_id, assigned_at) VALUES (?, ?, ?)');
insertAssignment.run(1, list1, tsAgo(14)); // Emma → Week 1
insertAssignment.run(1, list2, tsAgo(7)); // Emma → Week 2
insertAssignment.run(1, list3, tsAgo(18)); // Emma → Science
insertAssignment.run(1, list4, tsAgo(10)); // Emma → Bible
insertAssignment.run(2, list1, tsAgo(14)); // Liam → Week 1
insertAssignment.run(2, list2, tsAgo(7)); // Liam → Week 2
insertAssignment.run(2, list3, tsAgo(18)); // Liam → Science
/* ── assignments (one active list per student) ─────────────── */
const insertAssignment = db.prepare('INSERT OR REPLACE INTO assignments (student_id, list_id, assigned_at) VALUES (?, ?, ?)');
insertAssignment.run(1, list2, tsAgo(7)); // Emma → Week 2 (current)
insertAssignment.run(2, list1, tsAgo(14)); // Liam → Week 1 (current)
/* ── spelling progress (Leitner boxes) ────────────────────── */
const insertProgress = db.prepare(`