question_bank_item
Adds or replaces ONE question/item of a question bank, by "action" - deleting one is question_bank_delete. There is no universal item shape: read riddle://reference/question-bank/block-type-columns before the first "add" into a bank you have not populated - it lists the valid blockType values per Riddle type and the "columns" each expects (the blockTypeColumns listing is that document, not a tool). "update" replaces the item's content entirely, so blockType, category, difficulty and columns must all be sent even when unchanged, and blockType is immutable: a different value is rejected rather than retyping the item (delete it and add a new one instead). Both change the bank's DRAFT - question_bank_manage(action: "publish") is what makes a change something a QuestionBank block draws, and question_bank_discard_changes throws every unpublished change away again. "hasChanges" in the response says whether the bank now has unpublished changes. Rejected for a public template id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | What to do: "add" a new item (takes blockType, category, difficulty, columns) or "update" an existing one (the same, plus questionBankItemId). | |
| columns | No | The question content, as {columnName: [values]} - never a list, and a column holding a single value still takes a list. Which names are valid depends on the bank's riddleType AND the blockType, so take them from riddle://reference/question-bank/block-type-columns instead of guessing (an unknown one is rejected, naming it and the valid ones). On "update" this replaces the content entirely rather than merging: send every column, and hand question_bank_get_items output straight back with its {"id", "value"} objects intact - keeping those ids is what edits the stored values instead of replacing them with a fresh set. | |
| category | No | The item's category - free text, used to filter what a QuestionBank block draws (see the "questionBankCriteria" of the QuestionBank block type). | |
| blockType | No | The block type this question is shaped for, e.g. "SingleChoice". riddle://reference/question-bank/block-type-columns lists the ones valid for this bank's riddleType. Immutable: on "update" send the item's current one back unchanged (question_bank_get_items returns it), a different value is rejected. | |
| difficulty | No | The item's difficulty, 1-10 - also used to filter what a QuestionBank block draws. | |
| questionBankId | Yes | The ID of the question bank the item belongs to. | |
| questionBankItemId | No | The ID of the item to update, as returned by question_bank_item(action: "add")/question_bank_get_items. Required for "update", rejected for "add". |