0

How do I use the code response type in an exam?

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.

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.

  • 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.

Go to Assessment > Question Banks

Click on Create new bank. Enter a name for your question bank and then click Create.

Click the newly created Question bank from the list. Click on Add question > Create new question

a) Enter a unique name for this question. This name is a unique identifier that helps you identify the question. It is not the question text.

b) Select the Code response type.

Click Edit to edit the response type. 

A drawer will open where you can configure your Code response type:

1) Response title: You can enter your question or instructions here. 

2) Configure starting file(s): Set up the files learners see when they open the question. You can rename, delete, or create new files. These files can include:

  • Starter code or boilerplate files
  • Dataset files (e.g., CSVs)

  • Helper functions

  • Project configuration files

3) Settings: 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) Upload run configuration: 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:

  • ZIP configuration package that contains compilation and running scripts, test files, and a config.json file that defines how the activity runs, or
  • 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 the Code Execution Documentation.

Go to the Evaluation tab to set up grading.

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:

  • ZIP configuration package that contains your grading scripts, test files, and a config.json file that defines how the activity runs and reports results, or
  • JSON configuration file if no additional scripts or files are required for grading.

For more information on how to configure a Grading Config,  see the Code Execution Documentation.

If auto-grading is disabled, an assessor will need to enter the score manually after reviewing the learner's response. Add Marking Guidelines to support assessors during review. These guidelines will be visible to Assessors during grading. 

In the Alignment tab, you can also align the question to a Course Learning Outcome (CLO). Click Save to your setup. 

Select Preview to review how the question will appear to learners, then add the question to your exam.

Does this replace the Post (Custom) widget with code execution?

No. The Code Response Type is specifically focused on secure, exam-native assessment workflows. The Post (Custom) widget remains active and should be used in pages.

Support is dependent on the underlying code execution integration and the active run configurations you upload.

This functionality is not currently supported in this version. Learners should edit their code with care.

Reply

null

Content aside

  • 1 mth agoLast active
  • 21Views
  • 2 Following