
“Education Is Not the Filling of a Pail, But the Lighting of a Fire”
Often attributed to W.B. Yeats
“I cannot teach anybody anything. I can only make them think.”
Often attributed to Socrates
“Can you teach AI to teach you?”
CityUHK Learning Classroom (link)
Background¶
This is a jupyter book for the course CS2310 Computer Programming at City University of Hong Kong. This course is designed to provide students with essential skills in object-oriented programming (OOP) using C++, forming a strong foundation for further studies in computer science. Upon completion, students will be able to clearly explain OOP concepts, develop object-oriented programs, and demonstrate a solid understanding of fundamental programming principles that underpin advanced computer science courses.
Course Intended Learning Outcomes (CILOs):
Explain fundamental object-oriented concepts and program structure.
Design and implement solutions to problems using good OOP techniques.
Analyze and debug programs of varying complexity.
Demonstrate working knowledge of advanced programming features.
This course assumes basic programming knowledge equivalent to CS1302 Introduction to Computer Programming. Instead of merely focusing on C++ syntax, the course aims to teach students computational thinking in problem solving, with an emphasis on object-oriented programming (OOP) in addition to imperative and functional programming techniques.
Courseware¶
An in-house kubernetes cluster to run interative teaching materials.
Interactive Python/C++¶
import ROOT
print("Hello, World!")%%cpp
cout << "Hello, World!\n"; !nvidia-smi # Access to GPU if availableIntegrated with GenAI:¶
%%hermes
Explain briefly the ingredients involved in writing the following C++ program:
--
int gcd(int a, int b) { return a? gcd(b%a, a): (b>0? b: -b); }🌿 Fork/new: main (will create on click)
Hermes
Here are the ingredients, all packed into one line:
Function header —
int gcd(int a, int b): twointparameters, anintreturn value; the body is a single expression after{ return ...; }.A boolean from an
int— the outer testa ? ... : ...uses C++'s implicit int-to-bool conversion: any nonzeroaistrue, onlya == 0isfalse. No explicita != 0needed.The ternary operator
cond ? x : y— nested, in place ofif/elsestatements. It is an expression, so it can be returned directly.The Euclidean algorithm (recursive case) —
gcd(b % a, a): the remainder step. Because the ternary is lazily evaluated,b % ais computed only whena != 0— which matters, since% 0is undefined behavior.The base case with manual
abs— whena == 0the answer is|b|, written asb > 0 ? b : -binstead of callingstd::abs(no#include <cstdlib>/<cmath>needed). This also makes the function total:gcd(0, b)→|b|, and negative inputs are handled because the final result is the absolute value of the last nonzero value.Recursion + termination — each call replaces
(a, b)with a strictly smaller first argument (b % a < a), so the chain must reacha == 0, hitting the base case.
So the whole program is: Euclid’s algorithm + recursion + ternary expressions + implicit bool conversion, with the base case doubling as a hand-rolled absolute value.
Over 200 questions for students to instantly check and debug their solution with AI.
Conduct computer-based exams in Safe-Exam Browser with restricted access to AI.
Misuse of AI¶
An Example¶
Student: John Smith (fake name)
Assignments: 99.55%
Midterm: 30%
The Bug¶
Misuse of GenAI to generate bug-free solution in assignments:
bypasses computational thinking in constructing good programs
bypasses opportunities to debug
creates an illusion of competence
CE-Quiz (INTED 2026)¶
In-class collaborative E-Quiz assignments with help from
Effort recently expanded to C++ programming:
Visual debugger for C++ (OPT_CPP) developed in Summer 2026 with the help of AI Agents.
A tailor-made AI model for
students to have AI-assisted visual debugger, and
instructors to provide quality feedback to lab assignments.
OPT_CPP: Serverless AI-Assisted Visual Debugger
Turns error into thought-provoking questions that help debugging.
Uses a highly portable small language models (SLM) trained on DIVE by a first-year undergraduate student.
Agentic Coding¶
Student-Developed Packages in a Summer (Submitted to TALE 2026)¶
hermes-acp-sdk- Python package for integrating the Hermes AI agent into existing applications with minimal code.traceback-coach- Explains Python notebook tracebacks in a structured, human-readable way with guided debugging questions.hermes-textstats- Lightweight text analysis tool for word counts, sentence counts, lexical diversity, and reading-time estimates.obj-tag-group- Utility for attaching tags to Python objects and retrieving them through tag or regex searches.sliveshow- JupyterLab extension for turning notebooks into animated slide presentations with live code execution.socratic-watchdog- Socratic TTS assistant that monitors notebook execution and provides spoken guidance when students need help.ultrasonic-img-steg- Package for embedding and recovering image data within inaudible frequencies of lossless audio files.
Core Concepts¶
Student-Developed Notebooks¶
Plumbing¶
Boldfaced co-authors were undergraduate students at CityUHK.
Suvernev, Bogdan, Zhao, Chao, & Wang, Zimeng, & and Chan, Chung. (2026) SocraticAI: On training models that make students think. EDULEARN 2026: 18th International Conference on Education and New Learning Technologies, IATED. <doi: 10.21125/edulearn.2026.1345>
Chan, Chung, Suvernev, Bogdan, Zhao, Chao, & Wang, Zimeng. (2026). CE-QUIZ: AI-Assisted Debugging in Exams, INTED2026 Proceedings, Article 1724. doi:10
.21125 /inted .2026 .1724
Chan, Chung, Suvernev, Bogdan, Wang, Zimeng, Liang, Qihang, & Zhao, Chao. (2025). Making GenAI Socratic for Computational Thinking. 2025 IEEE International Conference on Teaching, Assessment, and Learning for Engineering (TALE), 1–8. doi:10
.1109 /tale66047 .2025 .11346691
Chan, Chung, Zhao, Chao, Chau, Wai Tong, Zhou, Yu, Liang, Qihang, & Lim, Michael. (2023). E-Quiz: Empowering Educators with a Self-Contained and Programmable Online Exam System. 2023 IEEE International Conference on Teaching, Assessment and Learning for Engineering (TALE), 21, 1–8. doi:10
.1109 /tale56641 .2023 .10398402
Chan, Chung, Kozhin, Assan, Liang, Qihang, Salter, Glenn, Tang, Ruoqin, Ye, Chunxiao, & Zhao, Chao. (2022). DIVE: Make Online Learning Diversified, Interactive, Versatile, and Engaging. 2022 IEEE International Conference on Teaching, Assessment and Learning for Engineering (TALE), 482–489. doi:10
.1109 /tale54877 .2022 .00085