How do I use the code response type in an exam?
What is a Code Response Question?
A code response question is a question type that lets learners write and run real code directly inside an exam — no external tools needed. Assessment designers configure the coding environment, including starting files and run settings, while learners interact with a built-in code editor (IDE) to complete their answer.
Why use Code Response Questions?
Code response questions let you test real programming skills in a controlled, consistent environment — right inside the platform. Learners write and run actual code, and responses can be graded automatically or manually.
Use cases
- A programming instructor sets up a Python question with starter files and test cases, and the system auto-grades submissions based on code execution results.
- A data science course includes a question where learners write a script to process a dataset, with custom compiler options pre-configured by the educator.
How to set it up
For Assessment Designers: Creating a code response question
Go to your Question Bank and select Add New Question. When prompted, choose Code as the response type.

Edit the response type. Configure your Starting Files — these are the files learners will see when they open the question. You can rename, delete, or create new files as needed.


3. Control what learners can do when they write their response. You may toggle the following options on or off:
- Allow learners to edit, rename or delete files
- Allow learners to run code

4. If learners are allowed to run their code during the exam, upload a Run Config to configure how the learner can run code within the interactive IDE environment. You must upload either:
- a ZIP configuration package that contains compilation and running scripts, test files, and a
config.jsonfile that defines how the activity runs, or - a JSON configuration file if no additional scripts or files (other than those provided by the learner)
For more information on how to configure a Run Config, see https://code-execution.openlearning.com/.
5. To choose how the code responses will be graded, go to the Evaluation tab. By default, auto-grading is enabled. You must upload a Graded run configuration file to enable auto-grading via code execution. You may upload either:
- a ZIP configuration package that contains your grading scripts, test files, and a
config.jsonfile that defines how the activity runs and reports results, or - a JSON configuration file if no additional scripts or files are required for grading.
For more information on how to configure a Grading Config, see https://code-execution.openlearning.com/
If auto-grading is disabled, an assessor will need to enter the score manually after reviewing the learner's response.
6. Add Marking Guidelines to support assessors during review.

7. In the Alignment tab, you can also align the question to a Course Learning Outcome (CLO).
8. Save your setup.
10. Select Preview to review how the question will appear to learners, then add the question to your exam.