arXiv:2608.25769cs.SEAug 2026

Manuscript Offprint

arXiv:2608.25769

Predicting Struggling Students in CS1 Programming Using Keystroke-Level Editing Features

Yasuyo Kofune, Kazumasa Shimari, Kenichi Matsumoto

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yasuyo Kofune

Graduate School of Science and Technology

Nara Institute of Science and Technology

Nara, Japan

kofune.yasuyo.kv0@is.naist.jp

Kazumasa Shimari

Faculty of Systems Engineering

Wakayama University

Wakayama, Japan

shimari@wakayama-u.ac.jp

Kenichi Matsumoto

Graduate School of Science and Technology

Nara Institute of Science and Technology

Nara, Japan

matumoto@is.naist.jp

Abstract—This paper investigates the feasibility of early detection of struggling students during CS1 programming exercises using keystroke-level logs. Some students fail to reach a correct solution before the exercise ends, and by the time this becomes apparent from grades or final outcomes, the opportunity for timely instructor support aimed at helping them recover may have passed. We use data from the CodeBench platform, which records real-time code editing events at the keystroke level, alongside execution and submission logs. We define two outcome groups: Breakthrough (BT) students, whose prior submissions all receive 0% and whose final submission achieves full credit, and Fully Stuck (FS) students, whose submissions all receive 0% without reaching a correct solution. To examine this feasibility, we focus on two questions: (RQ1) whether adding keystroke-level editing features improves the prediction of FS students over execution-log features alone, and (RQ2) at which stage BT and FS students can be predicted most accurately. Experiments on the 2019-1 semester of the CodeBench dataset, comprising 507 students, compare three feature configurations: execution-based features (ExecOnly), CodeMirror-based features (CMOnly), and their combination (Combined). We evaluate prediction across successive submission-based stages during each exercise. In the earliest stage, CMOnly outperforms ExecOnly (AUROC 0.654 vs. 0.575), and Combined further improves over ExecOnly by +0.098 (AUROC 0.674). Across all configurations, the earliest stage yielded the strongest predictive signal. These findings indicate that behavioral signals present at the very start of an exercise contain useful clues about whether a student will ultimately solve the problem, and that keystroke-level editing logs provide additional value for early prioritization beyond execution logs alone.

Index Terms—early prediction, struggling students, keystroke logs, programming education, CS1

I. INTRODUCTION

CS1 programming courses consistently exhibit high failure and dropout rates, posing a significant challenge for instructors and institutions worldwide [1], [2]. Timely identification of students who are struggling is essential for enabling effective instructor support; however, in most digital learning environments, the information available to instructors is limited to submission outcomes and final grades—data that only becomes available after a student has finished working on an exercise.

Prior work on early prediction in CS1 courses has addressed this challenge by developing models that predict end-of-course performance at early points in the semester—as early as the first two weeks [3], [4], or at weeks 3, 5, and 7 [1]. While these approaches have achieved notable predictive accuracy, they rely on features that are only available after a student has completed and submitted an exercise—including the number of attempts, total time spent, and assignment grades. As a result, they are inherently limited to post-submission analysis and cannot inform real-time instructor support during the problem-solving process itself.

The CodeBench platform, used for CS1 programming instruction at the Federal University of Amazonas, Brazil [5], is particularly well suited to address this limitation. In addition to execution and submission logs, CodeBench records keystroke-level editing events through its integrated code editor (CodeMirror). These logs capture how students write and revise code between submissions—information that is available in real time, as students work on the exercise. Despite this, prior work using CodeBench has made limited use of CodeMirror logs. Pereira et al. [3], [4] incorporated keystroke-derived features (e.g., keystroke latency, deleted characters, log lines) as session-level aggregate values; however, SHAP analysis in Pereira et al. [4] revealed these features had minimal predictive contribution, with grade-based and submission-based features dominating the model. The potential of CodeMirror logs as in-exercise behavioral indicators—capturing coding patterns within individual submission intervals before final exercise outcomes are known—thus remains unexplored. Of particular interest is the earliest stage of an exercise: the period up to and including the first submission, which represents the earliest point at which detection could help instructors prioritize support for students who are likely to remain stuck.

To define the target group without relying on arbitrary thresholds, we use two submission patterns: Breakthrough (BT), in which a student receives 0% on all submissions except the final one, which achieves full credit, and Fully Stuck (FS), in which a student receives 0% on all submissions without reaching a correct solution. FS students are the primary target of early detection; BT students, who eventually break through on their own, serve as the contrast group. This BT/FS contrast is intentionally strict: both groups initially experience failure, but only BT students eventually reach a correct solution; thus, the task is not to distinguish successful students from unsuccessful students in general, but to identify students who will remain stuck among those who are already struggling.

Our goal is to examine whether students who will remain fully stuck can be identified as early as possible during an exercise, when instructors still have the greatest opportunity to provide support before the exercise ends. We operationalize this goal through the following two research questions:

• RQ1: Does adding keystroke-level editing features improve the prediction of FS students over execution-log features alone?

• RQ2: At which stage of an exercise can BT and FS students be predicted most accurately, and how early can useful predictive signals be observed?

To investigate these questions, we divide each exercise session into submission-based segments and evaluate prediction at each stage. The contributions of this study are as follows:

  1. We propose a segment-based classification framework that uses CodeMirror and execution logs recorded during an exercise to provide an early prioritization signal for students who may remain stuck, potentially enabling timely instructor support.

  2. (RQ1) We demonstrate that adding keystroke-level features improves prediction over execution logs alone (+0.098 AUROC in the initial segment), showing that CodeMirror logs capture behavioral information not reflected in submission outcomes.

  3. (RQ2) We show that the initial segment yielded the strongest segment-wise predictive signal across all feature configurations, indicating that clues about the eventual outcome emerge from the very start of an exercise. Notably, detection at the initial segment requires no prior submission history.

The remainder of this paper is organized as follows. Section II reviews related work. Section III describes the dataset, label definitions, and experimental setup. Section IV presents the results. Section V discusses the findings and limitations. Section VI concludes the paper and outlines directions for future work.