## 3 Experimental Design
### Process  
Figure 1 illustrates the overall process used, which consists of four stages: (1) explanation of objectives and modality, (2) diagnostic assessment, (3) intervention with the exercise, and (4) final evaluation. In the first stage, during the lecture session, the objectives, modality, and deadlines for the exercise activity were explained. Later in the same week, during the two workshop sessions, Stage 2 was carried out, which involved the application of diagnostic instruments to establish a baseline for comparison, both for initial knowledge and for affective perceptions about the upcoming activity (under the HMSAM model). During the same workshop sessions, Stage 3 began, which consisted of the actual exercise, dividing participants into two groups: Microsoft Copilot and an instructional video. The group division and activity sequence were managed through the Moodle platform assigned to the course. Participants were given 7 days to complete the exercise guide and the final questionnaires (Stage 4), which included a final knowledge test and a perception questionnaire (HMSAM). Although no explicit or formal training was provided immediately before the intervention, students assigned to the Microsoft Copilot group were assumed to be familiar with generative AI tools, including Microsoft Copilot specifically. This familiarity stemmed from their prior experiences within the course, where they had previously engaged informally with generative AI tools such as Microsoft Copilot, ChatGPT, and Google Gemini via their institutional Office 365 accounts. Consequently, only brief general instructions were given, allowing participants to interact freely with Microsoft Copilot during the exercises without additional detailed guidance or standardization protocols. Specific diagnostic instruments (pre- and post-tests) were used to evaluate learning, such as the example presented in Figure 2, which was drawn from a repository of questions and selected randomly. The example in Figure 2, extracted from the repository of questions used in the pre-test and post-test, focuses on identifying and correcting errors in a PHP code that interacts with a MySQL database. The objective of the code is to process name and surname variables sent through a form, insert them into a table called \"personas\", and then display the results in an HTML table. However, the code contains several errors that must be corrected to function properly. These errors include incorrect use of SQL syntax in the INSERT statement, lack of data validation, and potential security issues such as SQL injection. The PHP instructions must also be reviewed to ensure the data is handled and displayed correctly in the browser. This exercise allowed for evaluating both the students' technical knowledge and their ability to apply programming concepts in practical contexts. Both groups used the same PHP practice guide, including a series of exercises with code snippets. Each exercise presents 3 to 4 non-exclusive alternatives containing statements about possible outcomes or consequences of the given code, specific lines of code, or potential replacements for certain lines of code. It is important to emphasize that this exercise guide is a compilation of various exercises used in previous semesters and captures the most frequent errors made by students who, despite having learned the material, begin coding in PHP. Figure 3 presents an exercise from the PHP practice guide used in Stage 3 by the Microsoft Copilot group, where a PHP block surrounds HTML code. Specifically, Line 5 with Sobjetos = 2; is outside the PHP block, meaning it will not be preprocessed and will be displayed as plain text. The figure has been enlarged to enhance the legibility of the code and accompanying text. Figure 1: Experimental process used. Likewise, Figure 4 presents a PHP code snippet that utilizes the $POST superglobal variable to construct a database query in the $ssql variable by concatenating strings with variables. Additionally, it uses Mysqli_ functions.