Creates a question in your question bank.
- For a single-file language, send the starter code in
contents. - For a project template (for example
multifile_pythonorreact), setlanguageto the template slug and send the files either:- in
file_contents: the files replace the template files with the same path or are added, and the other template files are kept."deleted": trueremoves a template file. A binary file (PDF, JPEG, PNG or.xlsxspreadsheet, up to 20 MB) is sent with its bytes base64-encoded incontentsand"encoding": "base64". - as a zip archive in
zip_file(multipart request): the archive replaces all the template files, except the template's.cpadconfiguration file, which is kept unless the archive has one. A single enclosing folder is removed from the paths.
- in
htmlcreates a question on the HTML project template: sendfile_contentsorzip_file, notcontents.
For project template questions, the response's language is the template slug, and its file_contents is an array of the question's files, with the template files it removed marked "deleted": true and binary files marked "binary": true without their contents.
With is_draft: true, the question is saved as a draft: the fields a published question needs, such as the starter code, can be left out and completed before publishing it from the question bank. A question's draft state can only be set on creation.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
409A scoped question-generation credential refers to a discarded or otherwise unavailable request.
502A binary file in file_contents could not be stored. Nothing was created; retry the request.