Create an interactive classification quiz MicroSim using p5.js where students read scenarios and classify them into the correct category from multiple choice options...
This skill creates interactive classification quiz MicroSims using p5.js. Students are presented with scenarios, examples, or descriptions and must classify them into the correct category from multiple choice options. The quiz format is ideal for teaching pattern recognition, concept identification, and categorization skills across any subject domain.
Use this skill when you need to create a quiz where students must:
All quiz content is stored in a data.json file for easy editing. Here is the required structure:
{
"title": "Quiz Title Here",
"description": "Brief description of what this quiz tests",
"config": {
"questionsPerQuiz": 10,
"pointsCorrect": 10,
"pointsWithHint": 5,
"scenarioLabel": "SCENARIO",
"instructionText": "Select the correct category for this scenario",
"correctAnswerField": "correctAnswer"
},
"scenarios": [
{
"id": 1,
"scenario": "Description of the scenario or example to classify...",
"correctAnswer": "Category Name",
"options": ["Category Name", "Wrong Option 1", "Wrong Option 2", "Wrong Option 3"],
"explanation": "Explanation of why this answer is correct...",
"hint": "A helpful hint for this question..."
}
],
"encouragingMessages": {
"correct": [
"Excellent!",
"Well done!",
"Great job!",
"You got it!",
"Perfect!"
],
"incorrect": [
"Not quiteβnow you know for next time!",
"Good try! This one is tricky.",
"Learning from mistakes makes us better!",
"Keep practicing!",
"Almost! Now you'll remember it."
]
},
"categoryDescriptions": {
"Category Name": "Brief description of this category",
"Another Category": "Brief description of another category"
},
"endScreen": {
"tipsTitle": "Tips for Success:",
"tips": [
"First tip for students...",
"Second tip for students...",
"Third tip for students..."
],
"performanceMessages": {
"excellent": {
"threshold": 90,
"message": "Outstanding!",
"subMessage": "You have excellent classification skills."
},
"good": {
"threshold": 70,
"message": "Great Job!",
"subMessage": "You classified most items correctly."
},
"fair": {
"threshold": 50,
"message": "Good Progress!",
"subMessage": "Keep practicing to improve."
},
"needsWork": {
"threshold": 0,
"message": "Keep Learning!",
"subMessage": "Practice makes perfect."
}
}
}
}
Each Concept Classifier MicroSim creates these files:
/docs/sims/$MICROSIM_NAME/
βββ index.md # Documentation page with iframe embed
βββ main.html # HTML wrapper loading p5.js
βββ $MICROSIM_NAME.js # p5.js quiz logic
βββ data.json # Quiz questions and configuration
βββ metadata.json # Dublin Core metadata
The JavaScript file contains configurable parameters:
// Canvas dimensions
let canvasWidth = 800;
let drawHeight = 480;
let controlHeight = 50;
// Colors (can be customized)
// Drawing area: 'aliceblue' with 'silver' border
// Correct answer: green tones
// Incorrect answer: orange/red tones
// Mascot: pink brain character (can be replaced)
The default mascot is an animated brain character with three expressions:
You can customize or replace the drawMascotCharacter() function to use a different mascot appropriate to your subject domain.
By default, 10 questions are randomly selected from the pool. Adjust in the config:
"config": {
"questionsPerQuiz": 10
}
Or modify in JavaScript:
scenarios = shuffled.slice(0, 10); // Change 10 to desired number
Students read scenarios demonstrating cognitive biases and must identify which bias is shown.
Students analyze arguments and identify which logical fallacy is present.
Students read passages and identify metaphors, similes, personification, etc.
Students read reaction descriptions and classify as synthesis, decomposition, single replacement, etc.
Students read about events or artifacts and match them to the correct historical period.
Students read code scenarios and identify which software design pattern applies.
Students listen to or read about musical pieces and identify the form (sonata, rondo, theme and variations, etc.).
Students view or read about artworks and classify them into movements (Impressionism, Cubism, etc.).
Define your categories - List all possible classification categories (typically 4-8)
Create scenarios - Write 15-30 scenarios, each clearly demonstrating one category
Write explanations - For each scenario, explain why it belongs to that category
Add hints - Provide helpful hints that guide without giving away the answer
Customize messages - Adjust encouraging messages and tips for your subject
Test thoroughly - Ensure all scenarios have correct answers and clear explanations
This skill includes template files in the /templates directory:
concept-classifier-template.js - Generalized p5.js quiz logicdata-template.json - Example data structure with placeholdersmain-template.html - HTML wrapperindex-template.md - Documentation page templateThis quiz format primarily addresses Application (Level 3) - students must apply their knowledge of categories to analyze new scenarios they haven't seen before.
After creating the MicroSim, add it to mkdocs.yml:
nav:
- MicroSims:
- Your Quiz Name: sims/your-quiz-name/index.md
loadJSON() in preload()describe() for screen readersThe Concept Classifier skill provides a proven, engaging format for teaching classification and categorization skills. By separating content (data.json) from logic (JavaScript), it's easy to create new quizzes for any subject domain without modifying code.