一句话:提出基于正则表达式匹配与字符串补全提示的 CS1 单行代码自动评分与反馈方法,并在四年课程中验证其高精度与教学效果。
学习编程时,写出一行完成特定动作的代码是重要练习,但代码答案形式多样,自动评分与反馈困难。作者在 CS1 课程中采用模板匹配,具体使用 Perl 兼容正则表达式设计单行代码题,并提供字符串补全提示。该方案在四年、497 名学生的使用中取得超过 99% 的精确率和召回率,且无论学生初始答案多错误都能给出补全反馈。引入带补全提示的形成性测验后,教师和助教收到的相关疑问显著减少,多数训练题尝试无需教学人员帮助即可找到正确答案;不过也有部分学生仅用测验学习答案而不真正作答。
One of the important tasks in learning programming is writing a line of code performing the necessary action. This allows students to practice skills in a playground with instant feedback before writing more complex programs and increases their proficiency when solving programming problems. However, answers in the form of program code have high variability. Among the possible approaches to grading and providing feedback, we chose template matching. This paper reports the results of using regular-expression-based questions with string completion hints in a CS1 course for 4 years with 497 students. The evaluation results show that Perl-compatible regular expressions provide good precision and recall (more than 99%) when used for questions requiring writing a single line of code while being able to provide string-completion feedback regardless of how wrong the initial student’s answer is. After introducing formative quizzes with string-completion hints to the course, the number of questions that teachers and teaching assistants received about questions in the formative quizzes dropped considerably: most of the training question attempts resulted in finding the correct answer without help from the teaching staff. However, some of the students use formative quizzes just to learn correct answers without actually trying to answer the questions.