🌍 World Quiz Dataset Import

Historical record — 2026-07-28

Preserved as observed. Current truth: Program Masterplan.

Bench import only. Packs were adapted from /tmp/questions.json (WQD row model) into the native quizwizz.question-pack v1 format and imported via QuestionPackImporter::import_json(). Draft quizzes are ready for review — not published.

Source

  • file: /tmp/questions.json (590 371 B)
  • model: World Quiz Dataset — one row per (question, language)
  • counts: 58 origins · 229 rows · languages en/de/fr/es · 18 top categories
  • types: 217 MCQ (4 choices) · 12 localized boolean
  • difficulty: level 2/3/4 → QuizWizz easy/normal/hard
  • quality: 100% explanations · 0 HTML entities · 0 dangling origin refs
  • one EN-only origin (wqd:opentriviaqa:5767f0067cceaa89:en) → DE/FR/ES packs have 57

Adapter decisions

DecisionChoiceWhy
Packing4 packs, one per languageunder the 100-question hard cap; language is pack-level in v1
Subjects18 tops + 57 prefixed children (science-botany)collision-proof under term_exists name matching
Music topmapped to existing entertainment-musicname collision: bench already has term named “Music”
Correct indexdeterministic shuffle (seeded)balanced correct_idx histogram; never leave answer at 0
Type mapmcqmultiple, booleanbooleanmatches QuestionValidator enums
Provenanceqw_wqd_id post meta + qw_wqd_pack on quizstring IDs; qw_opentdb_id is int-only

Result

QuizIDStatusQuestionsProvenance
World Quiz — English413draft5858/58 qw_wqd_id
World Quiz — Deutsch471draft5757/57
World Quiz — Français529draft5757/57
World Quiz — Español587draft5757/57

Bench after import: 269 published questions · 89 subjects · question index 269/269 valid · probes --wave all 30/30.

Import recipe (repeatable)

# 1. Adapt WQD → 4 v1 packs (adapter lives at /tmp/qwfix/packs/)
# 2. Stage + dry-validate via reflection against QuestionPackImporter::validate
# 3. Import as admin:
sudo docker compose --profile cli run --rm -T wpcli wp eval-file wp-content/.wqd-import.php import
# Driver note: cleanup removed the driver; before rerunning, restage `/tmp/qwfix/wqd-import.php` as `wp/wp-content/.wqd-import.php` with owner `www-data:www-data` and mode `0644`.
# 4. Attach provenance by pack order → qw_wqd_id
# 5. Cleanup staged files from wp-content

Known trap: term_exists( $slug ) matches by name as well as slug. A declared subject whose slug differs from an existing term’s slug but shares its display name will silently attach the wrong term and fail QuestionService::verify()’s strict subject comparison → full pack rollback. Prefix child slugs and reuse existing tops when names collide.

Browser smoke

  • Admin edit of quiz 413: title World Quiz — English, status Draft, 58 linked questions in the meta box.
  • Cache disabled; no new QuizWizz fatals in debug.log beyond the import session.

Artifacts retained

  • packs + id map: /tmp/qwfix/packs/world-quiz-{en,de,fr,es}.json, wqd-id-map.json
  • source: /tmp/questions.json