Programming can be challenging for novices, but it is difficult to provide high-quality, comprehensive, and timely support at scale. Generative AI and its products, like ChatGPT, can create a solution for most introductory programming problems. However, students may become overly reliant on these tools for quick code generation and homework completion, leading to reduced engagement and limited learning. In this work, we present \sys{}, a system that utilizes large language models (LLM) while still promoting students' cognitive engagement. \sys{} provides a personalized Parsons puzzle to support struggling students. In a Parsons puzzle, students place mixed-up code blocks in the correct order to solve a problem. A technical evaluation with 800 incorrect student code demonstrated that \sys{} can efficiently create high-quality (correct, personalized, and concise) Parsons puzzles for students. In a within-subjects experiment with 18 novice programmers, most students rated using \sys{} as more engaging, and they preferred \sys{} for learning rather than simply receiving an AI-generated solution. Additionally, students recalled more new elements from the supported practice to the posttest after using \sys{}, compared to when they simply received a direct solution. Qualitative observations and interviews provided evidence for the benefits of \sys{} including emphasizing algorithmic thinking, fostering continuity in learning, promoting metacognitive reflection, and boosting student confidence. We conclude by suggesting future designs for applying generative AI in a way that minimizes over-reliance and enhances learning.
翻译:编程对初学者而言具有挑战性,但在大规模教学中提供高质量、全面且及时的支持十分困难。生成式AI及其产品(如ChatGPT)能为大多数入门编程问题生成解决方案。然而,学生可能过度依赖这些工具快速生成代码和完成作业,导致学习参与度降低与学习效果受限。本研究提出\sys{}系统,该系统在利用大语言模型(LLM)的同时促进学生的认知参与。\sys{}通过提供个性化帕森斯谜题来支持学习困难的学生。帕森斯谜题要求学习者将打乱的代码块按正确顺序排列以解决问题。基于800份错误学生代码的技术评估表明,\sys{}能高效生成高质量(正确、个性化且简洁)的帕森斯谜题。在18名编程初学者的被试内实验中,多数学生认为使用\sys{}的参与度更高,并更倾向于通过该工具学习而非直接获取AI生成的解决方案。此外,相较于直接接受解决方案,学生在使用\sys{}进行练习后,能在后测中回忆出更多新元素。定性观察与访谈进一步证实\sys{}的益处,包括强化算法思维、促进学习连贯性、激发元认知反思以及增强学生自信心。最后,我们针对如何以最小化过度依赖并最大化学习效果的方式应用生成式AI提出未来设计建议。