A C++ Data Structures Course Runs in Classroom
Teachers can now write coding problems where students hand in several files, the test program uses attached helpers, leaked memory fails a test and banned names score zero. Live quizzes get 166 data structures questions in C++.

A college data structures course in C++ usually hands students a header file to implement, a test program the instructor wrote, and a few rules, such as no standard containers and a delete for every new. Classroom coding problems could not express most of that. A student wrote one file, the test program had nowhere to keep its helpers, and nothing checked memory or banned names. We added each of those and tried them on the first assignment of a real course, where the instructor's test program and helper ran unchanged and a correct solution scored full marks.
Students write several files
A teacher writing a C or C++ problem can turn on "Students write only part of the program" and list the files students write, such as network.h and network.cpp. Each file, named the way the teacher's test program includes it, gets its own tab in the student's editor, with optional starter code. The test program runs in place of the student's code, with every one of the student's source files compiled in. It reads the test input, calls the student's code and prints what the teacher checks. Students never see it.

Attached files
Teachers can attach files that the test program uses, such as a small testing helper it includes or a data file it opens by name. Attached files are kept with the test program in the answer key, so students never see them either.
A memory check
When students write part of a C++ program, the teacher can turn on Check memory. A test then fails if the program ends with memory made with new that was never deleted, as happens when a destructor forgets to free a list's nodes. The failing test says how many blocks were never deleted. Only memory the program's own code asked for is counted, because the standard library keeps a few buffers of its own until the program exits, and those would otherwise look like a leak in a correct program. In our runs against correct programs that use every standard container, static objects, exceptions and fast input and output, the check reported no leak. The student's problem page says up front that memory is checked. A teacher whose test program counts memory itself can leave the option off.
Banned names
A teacher can list names students may not use, for example vector, list and map in an assignment where students build their own containers. The list appears on the student's problem page. Code that uses one of the names scores zero, with the reason shown. In C and C++, a name counts when the code includes it, writes it with std::, or uses it as a template.

Output with extra lines
A new pass rule fits test programs that print timings or a summary line, such as ALL TESTS PASSED, along with their results. The test passes when the output includes the expected lines in order, ignoring everything else the program prints. Exact matching is still the default.
Run examples on every problem
Run examples now works on every coding problem a teacher writes, including ones where students write only part of the program. Those problems could not run examples before, because the test program and attached files are secret, so the browser had no way to build the program. Examples now run on our server and are judged exactly as Submit judges them, with each test's output shown. Only the tests the teacher marked as visible run. A run is not recorded as a submission.
Questions for live quizzes
Live quizzes have 166 new data structures questions in C++, grouped into one set for each week of a semester course: Big-O, dynamic arrays, stacks and queues, linked lists, recursion, merge sort, heaps and priority queues, binary search trees, AVL and red-black trees, hash tables, graph representation, and depth-first and breadth-first search. Every question that asks what a snippet prints was compiled and run as C++17, and the marked answer is what the program really printed. Answers that come from tracing an algorithm, such as a heap's array after an insert or the order of a traversal, were checked with a small program that does the same steps. The topic picker for hosting a quiz has three new topics: complexity, heaps and balanced trees.

A quiz's lobby now lists only the topics of the questions in the game. Before, a quiz built from questions the host picked listed every topic, 26 of them for a game of two array questions.
Typing counts again
A separate fix matters for every coding assignment. Each hand-in comes with a work log that tells the teacher when the student worked and how much code was pasted in. On assignment problems, a timing bug sent every key and paste to a log that had not started yet, so teachers were told "only 0 typed and 0 pasted" about students who had typed every character. Since the fix, typing is counted, and hand-ins from before it say that typing was not recorded instead of showing 0. The Needs review notes built on those empty logs are hidden from the teacher.
The share of an answer that came from pasting was also wrong for students who deleted the starter code and wrote their own. For example, typing 84 characters and pasting 161 into an answer of 252 characters was reported as 87% from one paste. The share now comes from what the student typed and pasted, and review notes already stored are worked out again when the teacher opens them.
