matlab-create-mcq-practice
Use when creating, asking, grading, or explaining multiple choice questions for MATLAB programming practice, concept checks, quizzes, or tutoring exercises.
git clone --depth 1 https://github.com/matlab/agent-skills-playground /tmp/matlab-create-mcq-practice && cp -r /tmp/matlab-create-mcq-practice/demos/ai-tutoring/skills/matlab-create-mcq-practice ~/.claude/skills/matlab-create-mcq-practiceSKILL.md
# MATLAB MCQ Practice
## Purpose
Create interactive multiple choice questions that test MATLAB understanding
through prediction, interpretation, debugging, and transfer. Use with
`matlab-tutor-learners` and `matlab-coach-programming`.
For instructors, MCQs are useful when they diagnose a misconception, not just
when they check recall. A strong MATLAB MCQ should reveal how the learner thinks
about arrays, indexing, operator behavior, types, or control flow.
## Question Design
Each question must include:
- A clear learning objective.
- A small MATLAB code snippet or concrete scenario when possible.
- Four answer choices labeled A-D.
- One best answer.
- Distractors based on plausible MATLAB misconceptions.
- Feedback for each option.
- A follow-up prompt that adapts to the learner's answer.
## Interaction Rule
When actively tutoring, ask one MCQ and wait for the learner's answer before
revealing the answer. Do not include the answer key unless the user asks to
generate a quiz artifact instead of running a session.
An MCQ answer key is an authoritative claim about MATLAB behavior.
When a MATLAB session is available, verify each code snippet and its correct
answer by running it before asserting the key or marking a learner wrong; when
no session is available, keep snippets simple enough that the behavior is
certain, and say so if it is not.
## MATLAB Misconception Bank
Use distractors based on:
- Confusing `*` with `.*`, `/` with `./`, or `^` with `.^`.
- Expecting zero-based indexing instead of one-based indexing.
- Confusing row and column vectors.
- Misunderstanding table variable indexing: `T.Var`, `T(:, "Var")`, `T{:, "Var"}`.
- Assuming strings and character vectors behave identically.
- Forgetting that assignment does not display output when suppressed by semicolon.
- Thinking `length` always means number of rows.
- Confusing logical indexing with numeric indexing.
- Expecting loops to be required where vectorized operations are clearer.
- Misreading function scope or workspace behavior.
## MCQ Template
Read [references/mcq-template.md](references/mcq-template.md) when generating a set of questions, a quiz, or a reusable question bank.
## Difficulty Levels
- **Novice**: syntax recognition, output prediction for one or two lines, indexing basics.
- **Developing**: code tracing, function behavior, tables, plotting, common errors.
- **Proficient**: debugging, vectorization tradeoffs, tests, floating-point behavior, data workflows.
## Grading Response Pattern
Use this after the learner answers:
```text
Correct/Not quite.
Why: [one MATLAB-specific explanation].
The tempting misconception is [misconception].
Try this follow-up: [one transfer question].
```
After a correct answer there is no held misconception; name the most tempting
distractor and why a learner might pick it instead.
## Instructor Adoption Notes
- Use MCQs before hands-on work to surface misconceptions quickly.
- Prefer code-prediction questions over vocabulary-only questions.
- Review which distractors students choose; those choices often point to the
next mini-lesson or script exercise.>
Use this skill when the user wants to author, design, scope, or refine an Agent Skill (a SKILL.md file). Trigger phrases include "build a new skill", "design an agent skill", "scope a SKILL.md", "how should I structure this skill", "write a skill for X", "my skill isn't working well", or any request to improve an existing SKILL.md. Walks the user through an empirical, test-first process — probe the agent for real failures, design only for genuine knowledge gaps, iterate against runnable examples, and verify across models.
Use this skill for any work involving a MATLAB Project (.prj file) — creating a new project, tracking files, managing the project path, configuring Simulink cache and code-generation folders, running project health checks, or writing build scripts that keep the project in sync with the file system. Trigger phrases include "set up a MATLAB project", "create a .prj", "track this file in the project", "project health check", "build script conventions". This skill is the generic foundation; domain-specific skills (e.g. `mbse-workflow`) build on it.
Use this skill for the architecture phases of an MBSE workflow in MATLAB, when writing idempotent buildXxx.m scripts that produce a three-layer RFLPV architecture (Functional, Logical, Physical) with interface dictionaries, stereotype profiles, allocation sets, and requirements Implement links. Trigger for defining stereotype properties, functional-to-logical / logical-to-physical allocation, mapping requirements to components via slreq Implement links, or running quantitative roll-up analysis on the architecture. Do NOT trigger for ad-hoc structural edits to an already-built System Composer model (adding one component, rewiring a port) — use `building-simulink-models` with `model_edit` for that. Works alongside the `system-composer` skill for detailed SC API patterns.
Use this skill for guided MBSE work in MATLAB — starting a new project, resuming work mid-workflow on an existing project, or answering orientation questions about how the MBSE skills fit together. Trigger when the user says they want to create, start, or set up a new MBSE project; work on a model-based systems engineering / RFLPV project; or asks which skill covers which phase. Walks through phases one at a time — propose → approve → generate → run → confirm. Use proactively whenever someone mentions starting or continuing an MBSE project.
Use this skill for all requirements-related work in a MATLAB MBSE project using the Requirements Toolbox (slreq). Covers creating and populating requirement sets, derivation links, test case requirements, verification coverage, reading and tracing links across requirement sets and models, checking link health, allocating requirements to components (Implement links), and building traceability reports. Trigger when the user asks about slreq API, slreqx files, slmx link files, outLinks/inLinks, traceability matrices, coverage analysis, broken links, or mapping requirements to architecture components. Use proactively for any requirements or traceability task.
Use this skill when authoring reusable, idempotent MATLAB scripts that build System Composer architecture models via the architecture-modeling API — `systemcomposer.createModel`, `addComponent`, `addPort`, `setInterface`, `connect(srcPort, dstPort)`, interface dictionaries (.sldd) with `addInterface`/`addElement`, profiles/stereotypes with `Profile.createProfile` and `addStereotype`, or `systemcomposer.allocation.createAllocationSet`. Also trigger when debugging these APIs (connections that don't appear, interfaces that don't resolve, profile save errors, `createAllocationSet` signature-mismatch errors). Do NOT trigger for ad-hoc structural edits to an already-built model (adding one SubSystem, rewiring a port) — use `building-simulink-models` with `model_edit` for that.
Optimize MATLAB code for better performance through vectorization, memory management, and profiling. Use when user requests optimization, mentions slow code, performance issues, speed improvements, or asks to make code faster or more efficient.