Shuffle question options in QuizRunner component
This commit is contained in:
@@ -327,7 +327,7 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
|
|||||||
const details: EntryDetail[] = await Promise.all(uniqueIds.map((id) => fetchEntry(id)));
|
const details: EntryDetail[] = await Promise.all(uniqueIds.map((id) => fetchEntry(id)));
|
||||||
const pool: QuizQuestionWithEntry[] = details.flatMap((entry) => {
|
const pool: QuizQuestionWithEntry[] = details.flatMap((entry) => {
|
||||||
const safeItems: EntryItems = entry.items || { grammar: [], vocab: [], conversation: [], key_phrases: [] };
|
const safeItems: EntryItems = entry.items || { grammar: [], vocab: [], conversation: [], key_phrases: [] };
|
||||||
return (entry.quiz || []).map((q) => ({
|
return (entry.quiz || []).map((q) => shuffleQuestionOptions({
|
||||||
...q,
|
...q,
|
||||||
entryId: entry.id,
|
entryId: entry.id,
|
||||||
entryTitle: entry.title,
|
entryTitle: entry.title,
|
||||||
|
|||||||
Reference in New Issue
Block a user