TABLE OF CONTENTS


What are code questions?

The code questions allow students to write code as answers in a variety of programming languages.

In addition, for specific languages*, the examinees can also run the code.

This feature allows instructors to include code template files within the questions, allowing students to view, edit, and run tests during the exam.

You can add automatic tests to these files, which automatically calculate the student's grade for the question. 


How to create a code question in the exam editor (TomaEditor)

The code question can be selected from the question types menu on the side of the question editor.

When a question is of the "code question" type, you can choose between two modes

1. Without files

2. With files.


Without files

It is possible to limit the examinees to answer in a specific programming language or choose the "Any" option and allow them to select any language available from the list:

In addition, you can choose if the examinees will be able to run the code, or not.

Attention! If the programming language chosen is not one of the supported languages, the option for the students to run the code will not be available. 

with files

In this mode, code template files can be added to the question.

By clicking on the arrow next to each uploaded file you can set the following parameters:

- Running the code: Allowing examinees to run the code.

- Running tests: These are tests that the examinees will be able to execute during the exam. 

To add inputs, the user needs to enter the values in the ‘input’ textbox and click the "+" button for each additional input. Next, the user should provide the corresponding output and click the "Add Test" button. 

Tests can be removed by using the trash icon next to each test

- Automatic tests - These tests will be executed in the background after the student completes the exam and will adjust the student's grade based on their results. To add inputs, the user needs to enter the values in the ‘input’ textbox and click the "+" button for each additional input. After that, the user should provide the corresponding output. 

Finally, the user needs to decide the weight of this test in terms of points and click the "Add Test" button. Tests can be removed by using the trash icon next to each test.


Please note that the total score for all tests should correspond to the score set for the question


The uploaded file will be displayed in the CodeMirror editor with adjusted syntax highlighting:


Please note that it will not be possible to confirm the exam in the following cases:
- The template files were not uploaded
- The total score of the automatic tests does not match the question's grade
- The option to add tests (manual or automatic) was selected, but no test was added

* List of supported languages

(Languages that support adding template files, running, and testing)

  • C

  • C++

  • Python

  • Java

  • PHP