canvas quizzes questions update
canvas quizzes questions update¶
Update a question
Synopsis¶
Update an existing question in a quiz. Only the flags you pass are sent; other fields keep their current values.
--answers-json takes a JSON array in the same shape "questions get" returns (id, text, weight, comments, ...). For multiple-choice and true/false questions the correct answer has weight 100 and every other answer weight 0.
Examples:
canvas quizzes questions update 789 --course-id 123 --quiz-id 456 --points 5
canvas quizzes questions update 789 --course-id 123 --quiz-id 456 --text "What is 2+2?" --name "Arithmetic"
canvas quizzes questions update 789 --course-id 123 --quiz-id 456 \
--answers-json '[{"id":1001,"text":"4","weight":100},{"id":1002,"text":"5","weight":0}]'
Options¶
--answers-json string Answers as a JSON array (replaces all answers)
--correct-comments string Comments for correct answer
--course-id int Course ID (required)
-h, --help help for update
--incorrect-comments string Comments for incorrect answer
--name string Question name
--points float Points possible
--position int Position of the question in the quiz
--quiz-id int Quiz ID (required)
--text string Question text
--type string Question type
Options inherited from parent commands¶
--as-user int Masquerade as another user (admin feature, requires permission)
--columns strings Select specific columns to display (comma-separated)
--config string config file (default is $HOME/.canvas-cli/config.yaml)
--dry-run Print curl commands instead of executing requests
--filter string Filter results by text (case-insensitive substring match)
--instance string Canvas instance URL (overrides config)
--limit int Limit number of results for list operations (0 = unlimited)
--no-cache Disable caching of API responses
-o, --output string Output format: table, json, yaml, csv (default "table")
--quiet Suppress informational messages, only output data and errors
--show-token Show actual token in dry-run output (default: redacted)
--sort string Sort results by field (prefix with - for descending, e.g., -name)
-v, --verbose Enable verbose output
SEE ALSO¶
- canvas quizzes questions - Manage quiz questions