A Novice-Friendly Answer Interface with Code Behavior Visualization and AI Assistant for a Python Programming Learning Assistant System
Abstract
1. Introduction
- RQ1: Does the integrated visualization improve learner understanding of runtime behavior?
- RQ2: Does the progressive AI hint help limiting excessive trial-and-error attempts of answer submissions?
- RQ3: Is the four-dimensional learning analytics useful for pedagogical interpretation?
- RQ4: Is the implemented interface usable and accepted by high school students?
2. Features of Proposal
2.1. Code Visualization for Beginners
2.2. Learning Analytics with Behavioral Logs
2.3. AI-Assisted Programming Education
2.4. Integration of Pedagogical Rationale and Evaluation Focus
3. Design Concept
3.1. PLAS for University Students
3.2. PLAS for High School Students
3.3. Learning Challenges and Design Requirements
3.4. Instructional Workflow Perspective
4. Implementation
4.1. Software Architecture
- Presentation layer: The frontend is designed for browser-only access without additional plugins, and the interface prioritizes novice readability with low interaction complexity.
- Application layer: Flask handles RESTful endpoints for problem retrieval, answer submission, log ingestion, and AI request routing, while session state preserves chapter progress and contextual history.
- AI service layer: Ollama runs local LLM inference on classroom PCs. The default option is Qwen2.5-Coder 3 B [23] for balancing quality and latency, with 1.5 B and 7 B alternatives for lower and higher resource conditions.
- Visualization support: The interface embeds Python Tutor [7] through an iframe in the practice interface and uses it as an auxiliary visualization tool for step-by-step execution tracing.
- Data and export layer: Raw events are stored in append-only form and can be exported as JSON and plain-text summaries for teaching review and research analysis.
4.2. Operational Cycle
- Event data collection: User actions such as answer input/modification, code run, submission, opening visualizer, requesting hint, and page switching are captured with the timestamp, user ID hash, chapter/problem identifiers, and local context.
- Data aggregation: Behavioral features are aggregated at configurable boundaries (e.g., per problem and per chapter), with aggregation at the chapter level used for reflection triggering.
- AI feedback generation: For each request, the backend constructs a structured prompt that includes the learner’s context, latest answer/error status, recent behavior features and required response type (L1/L2/L3 hint or chapter reflection).
- Feedback delivery: Hints are shown in the AI panel during tasks, while chapter reflection is delivered in a modal window with visual summary and textual suggestions.
4.3. Four-Dimensional Learning Analysis
4.3.1. Engagement
4.3.2. Reasoning Strategy
4.3.3. Learning Pace
4.3.4. Tool Usage
4.3.5. Integration of Four Dimensions
4.4. User Interface
4.4.1. Login Page
4.4.2. Problem List Page
4.4.3. Problem Practice Page
- Level 1: Conceptual guidance.
- Level 2: Problem-solving strategy.
- Level 3: Error-focused guidance and correction direction.
4.4.4. AI Feedback Modal Window
4.4.5. Log Export Functionality
4.5. Requirement to Module Mapping
4.6. Prompt and Hint Policy Design
- L1 policy: Return conceptual explanation and one verification question.
- L2 policy: Return strategy decomposition and ordering advice.
- L3 policy: Return focused on mistakes guidance and minimal corrective clue.
4.7. Service Interfaces and State Transitions
- Task service (Idle → TaskLoaded): Loads the chapter and problem context, and initializes session metadata.
- Execution service (Editing → Executed): Runs the learner’s code and stores attempt-level outcomes.
- Hint service (Executed → HintRequested): Generates staged assistance with context constraints.
- Reflection service (→ ChapterReviewed): Computes chapter indicators and returns the reflection package.
- Export service (Any state → Idle): Persists and exports log artifacts for review.
4.8. Data Lifecycle and Privacy Handling
4.9. System Availability
4.10. Deployment and Operational Scenarios
- Lab mode: Pre-configured classroom PCs with shared baseline model settings.
- Teacher laptop mode: Single-machine demonstration with live hinting and reflection demo.
- Student self-study mode: Local installation for after-class practice and log export.
4.11. Implementation Risks and Mitigation
5. Evaluation
5.1. Evaluation Scope
5.2. Application Setup
5.3. Application Results
5.4. Questionnaire Results
5.5. Discussion
5.6. Limitations
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| AI | Artificial Intelligence |
| LLM | Large Language Model |
| PLAS | Programming Learning Assistant System |
| PyPLAS | Python Programming Learning Assistant System |
References
- Top Programming Languages. 2025. Available online: https://spectrum.ieee.org/top-programming-languages-2025 (accessed on 17 May 2026).
- Python Software Foundation. Python Official Website. Available online: https://www.python.org/ (accessed on 1 March 2026).
- Aung, S.T.; Funabiki, N.; Lu, X.; Wai, K.H.; Jing, Y.; Kao, W.-C. An implementation of Java programming assistant system in university course. In Proceedings of the International Conference on Computers in Education, Taichung, Taiwan, 8–11 July 2024. [Google Scholar]
- Lu, X.; Funabiki, N.; Aung, S.T.; Kyaw, H.H.S.; Ueda, K.; Kao, W.-C. A study of grammar-concept understanding problem in C programming learning assistant system. ITE Trans. Media Technol. Appl. 2022, 10, 198–207. [Google Scholar] [CrossRef]
- Pallets. Flask Documentation. Available online: https://flask.palletsprojects.com/ (accessed on 1 March 2026).
- Ollama. Available online: https://ollama.com/ (accessed on 1 March 2026).
- Guo, P.J. Online Python Tutor: Embeddable web-based program visualization for CS education. In Proceedings of the 44th ACM Technical Symposium on Computer Science Education, Denver, CO, USA, 6–9 March 2013; p. 579. [Google Scholar]
- van der Werf, V.; Aivaloglou, E.; Hermans, F.; Specht, M. What does this Python code do? An exploratory analysis of novice students’ code explanations. In Proceedings of the 10th Computer Science Education Research Conference, Virtual, 22–23 November 2021; pp. 94–107. [Google Scholar]
- Feeley, M.; Melancon, O. Teaching programming to novices using the codeBoot online environment. arXiv 2022, arXiv:2207.12702. [Google Scholar] [CrossRef]
- Paiva, J.C.; Queirós, R.; Leal, J.P.; Swacha, J.; Miernik, F. Managing gamified programming courses with the FGPE platform. Information 2022, 13, 45. [Google Scholar] [CrossRef]
- zyBooks (formerly Coding Rooms). Available online: https://www.codingrooms.com/ (accessed on 17 May 2026).
- Suriyaarachchi, H.; Denny, P.; Nanayakkara, S. Investigating the use of productive failure as a design paradigm for learning introductory Python programming. In Proceedings of the ACM Technical Symposium on Computer Science Education, Pittsburgh, PA, USA, 26 February–1 March 2025. [Google Scholar]
- Siemens, G.; Long, P. Penetrating the fog: Analytics in learning and education. EDUCAUSE Rev. 2011, 46, 30–40. [Google Scholar]
- Bogarín, A.; Cerezo, R.; Romero, C. A survey on educational process mining. Wiley Interdiscip. Rev. Data Min. Knowl. Discov. 2018, 8, e1230. [Google Scholar] [CrossRef]
- Fowler, M. Event Sourcing. Available online: https://martinfowler.com/eaaDev/EventSourcing.html (accessed on 1 March 2026).
- Khanmigo. AI-Powered Tutor and Teaching Assistant. Available online: https://www.khanmigo.ai/ (accessed on 1 March 2026).
- GitHub Copilot. Your AI Pair Programmer. Available online: https://github.com/features/copilot (accessed on 1 March 2026).
- Gasiba, T.E.; Iosif, A.-C.; Kessba, I.; Amburi, S.; Lechner, U.; Pinto-Albuquerque, M. May the source be with you: On ChatGPT, cybersecurity, and secure coding. Information 2024, 15, 572. [Google Scholar] [CrossRef]
- Fan, G.; Liu, D.; Zhang, R.; Pan, L. The impact of AI-assisted pair programming on student motivation, programming anxiety, collaborative learning, and programming performance: A comparative study with traditional pair programming and individual approaches. Int. J. STEM Educ. 2025, 12, 16. [Google Scholar] [CrossRef]
- Akçapınar, G.; Sidan, E. AI chatbots in programming education: Guiding success or encouraging plagiarism. Discov. Artif. Intell. 2024, 4, 49. [Google Scholar] [CrossRef]
- Ifenthaler, D.; Schumacher, C. Student perceptions of privacy principles for learning analytics. Educ. Technol. Res. Dev. 2016, 64, 923–938. [Google Scholar] [CrossRef]
- Shi, N. Improving undergraduate novice programmer comprehension through case-based teaching with roles of variables to provide scaffolding. Information 2021, 12, 424. [Google Scholar] [CrossRef]
- Hui, B.; Yang, J.; Cui, Z.; Yang, J.; Liu, D.; Zhang, L.; Liu, T.; Zhang, J.; Yu, B.; Lu, K.; et al. Qwen2.5-Coder Technical Report. arXiv 2024, arXiv:2409.12186. [Google Scholar] [CrossRef]
- Hay Mar Shwe, S.H.M.; Funabiki, N.; Syaifudin, Y.W.; Htet, E.E.; Kyaw, H.H.S.; Tar, P.P.; Win Min, N.; Myint, T.; Thant, H.A.; Kao, W.-C. Value trace problems with assisting references for Python programming self-study. Int. J. Web Inf. Syst. 2021, 17, 287–299. [Google Scholar] [CrossRef]
- Docker. Docker Official Website. Available online: https://www.docker.com/ (accessed on 1 March 2026).












| Aspect | University | High School |
|---|---|---|
| Target learners | novice to intermediate learners in universities | learners in high schools and absolute beginners of Python |
| Core practice mechanism | topic-based exercises with immediate answer marking | plus process-aware support during and after tasks |
| Execution-behavior support | no visualization | embedded visualization |
| AI tutoring support | no staged hint policy | progressive L1/L2/L3 hint policy |
| Learning analytics | activity records for learning history tracking | event stream analytics with four-dimensional topic reflection |
| Deployment style | web-based platform | Flask + Ollama deployment for classroom feasibility |
| Layer | Technology | Role in This System |
|---|---|---|
| Presentation | HTML5, JavaScript (ES6), jQuery | problem pages, editor interaction, AI panel, visualizer controls |
| Logging | author-developed logger.js module | event stream capture for user operations and context data |
| Application | Flask API | authentication, problem service, aggregation, AI request orchestration |
| AI service | Ollama + Qwen2.5-Coder (1.5 B, 3 B, 7 B) | local hint generation and chapter-end feedback generation |
| Data | local JSON-based persistence | session state, user progress, exported logs |
| Design Requirement | Primary Module | Implementation Note |
|---|---|---|
| (1) Explainable logging | author-developed logger.js module + event API | captures ordered interaction records with timestamps and context |
| (2) Low-friction visual support | embedded visualizer panel | enables direct step-trace without leaving the practice page |
| (3) Non-replacement AI assistance | staged hint policy engine | controls L1/L2/L3 escalation and output style constraints |
| (4) Chapter-level reflection | chapter analytics + modal renderer | computes four-dimensional metrics and generates reflection text |
| (5) Classroom deployability | local Flask + local Ollama stack | supports privacy-preserving operation under limited connectivity |
| ID | Target Grammar | Completed | Avg. Attempts | Avg. Hints | Avg. Time (min) |
|---|---|---|---|---|---|
| P1 | Output and variables | 20 | 1.4 | 0.1 | 2.5 |
| P2 | Arithmetic operations | 20 | 1.9 | 0.4 | 4.2 |
| P3 | Conditional branch (if–else) | 20 | 2.5 | 1.2 | 7.1 |
| P4 | For-loop basics | 20 | 3.2 | 1.8 | 9.8 |
| P5 | While-loop with condition | 19 | 4.4 | 2.7 | 14.5 |
| P6 | List iteration (loop + condition) | 19 | 3.8 | 2.3 | 12.0 |
| ID | Question Item | Mean ± SD |
|---|---|---|
| Q1 | The embedded Python Tutor helped me understand how variables change during execution. | 4.45 ± 0.60 |
| Q2 | The L1/L2/L3 progressive hints guided my thinking instead of just giving me the answer. | 4.15 ± 0.81 |
| Q3 | I found the four-dimensional reflection feedback useful for understanding my learning habits. | 3.80 ± 0.89 |
| Q4 | The system interface was intuitive and easy to use without jumping to other websites. | 4.30 ± 0.73 |
| Q5 | Overall, this system reduced my frustration when encountering programming errors. | 4.25 ± 0.71 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Fu, Z.; Funabiki, N.; Zhu, Z.; Zhang, Y.; Kao, W.-C.; Lee, Y.-F.; Tseng, P.-K. A Novice-Friendly Answer Interface with Code Behavior Visualization and AI Assistant for a Python Programming Learning Assistant System. Information 2026, 17, 509. https://doi.org/10.3390/info17050509
Fu Z, Funabiki N, Zhu Z, Zhang Y, Kao W-C, Lee Y-F, Tseng P-K. A Novice-Friendly Answer Interface with Code Behavior Visualization and AI Assistant for a Python Programming Learning Assistant System. Information. 2026; 17(5):509. https://doi.org/10.3390/info17050509
Chicago/Turabian StyleFu, Zhida, Nobuo Funabiki, Zihao Zhu, Yue Zhang, Wen-Chung Kao, Yi-Fang Lee, and Pi-Kuang Tseng. 2026. "A Novice-Friendly Answer Interface with Code Behavior Visualization and AI Assistant for a Python Programming Learning Assistant System" Information 17, no. 5: 509. https://doi.org/10.3390/info17050509
APA StyleFu, Z., Funabiki, N., Zhu, Z., Zhang, Y., Kao, W.-C., Lee, Y.-F., & Tseng, P.-K. (2026). A Novice-Friendly Answer Interface with Code Behavior Visualization and AI Assistant for a Python Programming Learning Assistant System. Information, 17(5), 509. https://doi.org/10.3390/info17050509

