🖥

How to use console-based answer environment

Introduction

A console-based item is the kind of item you meet most often in CodeChum. You are given a problem, you write a program that reads input and prints output, and the test cases your teacher wrote decide your score.

It all happens on one screen: the item on the left, the code editor in the middle, and the test cases on the right. The same screen works for every language your class uses, so once you know where each part is you are ready for any console-based activity. Let's go through it, from opening the activity to clicking Submit all and finish.


Steps

Note: You need to have joined your class, and the activity has to be open, before you can answer it.

To answer a console-based item, follow these instructions:

  1. Open your class, go to the Activities tab and click the activity, then click Start answering. An activity with a time limit asks Start Activity? first, and your time starts when you click Start now. The first item opens with the item on the left, the code editor in the middle, and the Tests tab on the right.
  1. Read the item in the left panel and note how many points it carries, which sits under the item number. If the item lists minimum requirements, read them closely: missing even one makes your score 0 for that item.
  1. Write your solution in the code editor. The tabs above the editor are the files of your answer, and you move between them by clicking a tab.
  1. To split your solution across files, click the blue plus beside the file tabs. On Add File, type a name in Filename, choose the file type from the extension dropdown, then click Create. Your new file opens as its own tab. An item holds at most 10 files.

Note: Is Main File only shows while your answer has no main file yet. Ticking it fills in the name and the extension for your language, such as main.c or script.py, and locks both fields.

  1. Click the save button, or press Ctrl+S on Windows or Cmd+S on a Mac, to save your code.
  1. Click Run code to try your program with your own input. The CodeChum Terminal opens on top of the screen, and you type into it and hit Enter the same way you would in any terminal. Drag it by its title bar, resize it from the right or bottom edge, and close it with the red X in its title bar.
  1. Open the Tests tab to read the test cases the item is scored on. Each one shows the Expected Output it wants back, with Your Output above it once you have checked your code.
  1. Click Check code to score your answer against those test cases. After a check, the button counts down for 5 seconds before you can check again.
  1. Read the result. The heading is Perfect! for full marks, You Passed from half the item's points up, and You Failed below that. Under it you see your test cases and your score, with a requirements line as well on an item that has minimum requirements, and under those the Next item and Re-solve buttons.

Note: On an item your teacher marked as must be perfect, a check that fails with at least one test case passed reads Score must be perfect. in place of You Failed.

  1. Click Next item to jump to the next item that still scores nothing, or Re-solve to go back to the same item and try again. Once every item has a score it opens the summary instead.

  2. For a test case you did not pass, click See what's wrong. It puts Your Output beside Expected Output and colors the difference, with a legend of Okay, Excess and Lacking so you can spot a missing space or an extra line.

  1. Open the Executions tab to see your three latest checks. Click View on one to read the code exactly as it was checked and the score it got, and Restore code in that window to bring it back into the editor.

Note: CodeChum keeps only your three latest checks here. Restore on the card itself asks you to confirm on Restore Code? first, because restoring removes the code you have in the editor for that language. Restore code inside the View window does it without asking.

  1. Move between items with Prev and Next at the bottom, or from the item list on the right. Flag an item you want to come back to and a red corner appears on its square in the list.
  1. When you are done, click Finish attempt... The summary lists every item with its type and whether it is Answered, Partially Answered or Not Answered, and clicking a card takes you back to that item. An item you flagged carries a red flag in place of its number here.
  1. Finally, click Submit all and finish and confirm with Proceed. Your activity is submitted and you cannot go back into it, so use Back instead if you still want to fix an item.

And that's how you answer a console-based item in CodeChum! Next, let's look at the other answer environments, starting with How to use GUI-based answer environment.

Last updated September 21, 2026