ChatGPT, the computer teacher: How to use AI to teach coding in class

    My last article looked at some of the possible uses of  AI-powered tools like ChatGPT for History teachers.  Though many of the examples I used are applicable across all learning areas.  It simply a matter of learning the better questions to ask and how the word it of get the response that you wish.

    As educators, we are always looking for new and innovative ways to engage our students and to make learning more interactive and effective. One way to do this is by using AI-powered tools like ChatGPT, which can help to make coding lessons more dynamic and interactive. In this blog post, we will explore three activities that you can use to teach Python coding in class using ChatGPT.

    Today I’m going to discuss a couple of areas that a computer, digital technologies, or ICT teachers may consider to work more effectively.  The AI can produce lesson plans that are useable.  However, the creation of reliant and effective resources takes time.  As teachers time is the one thing we can get more off.

    Before we start the information and code in this example hasn’t been tested, however in the majority of cases code generated by chatGPT is usable straight away.  The blog will focus on the process and its possible tasks.  

    The first activity is a coding challenge. This activity is designed to help students develop their coding skills by working on a series of coding problems. To do this, you can use ChatGPT to generate a series of coding problems for your students. These problems can be tailored to the specific needs of your class and can include a range of difficulty levels. Once your students have completed the coding challenge, you can use ChatGPT to evaluate their work and provide feedback on areas where they need to improve.

    Take this simple tasK; You can ask ChatGPT to produce three different solutions to the same problem using different control structures.  The students then analyse and discuss which they think is the best solution from the variety of control structure for this problem.  Have them use a table of pro/cons for each of the programs and then write a summary recommendation with justification.

    Using an If-Else Statement:

    Using a While Loop:

    Using a For Loop:

    This can generate class discussion of higher value and in a shorter period of time.  You could follow up on whether they have a different and more efficient solution they could suggest and have them code that.

    The second activity is a debugging challenge.  You can take one of your existing code snippets and ask ChatGPt to introduce a deliberate and have the student tourble shoot the code.  IN this case I asked it to highlight the bug for illustration purposes.  

    Third activity:  It is good practice have regular retrieval tasks within your lesson.  However, its also good to develop new possible questions.  The advantage of using ChatGPt is it can generate new questions with our subconscious  bais on knowing what we have taught.  It can also generate questions that we may not consider, increasing the variety and breadth of their practice.  A quick way is using the curriculum points from your authority to generate questions from.  Simply copy and past and ask for sample students qesutions of the complexity you wish.  

    Using theses curriculum points, lets see what questions it can generate.

    Nice an easy problem generation.

    If any students has been struggling in one particular area, you can narrow your focus for that individual students and quickly generate a range of questions for them.  We do this by focusing on one curriculum point and ask for questions only on that point: Lets focus on one-dimensional arrays.

    Very quickly we can generate a variety of questions to test our students.  You can specify enough questions for 1 per person in your class and then have them share their answers with the rest of the class as an activity.  This can be done on the fly in class as needed.  You can use these to build a bank of possible questions to feed into other tools such as quizlet, cahoot, quizzes etc. 

    Where can you go from here?

    ChatGPT can be a valuable tool for computing  teachers looking to create interactive and engaging coding lessons. The ability to generate coding problems, tutorials, and games tailored to the specific needs of your class can save time and make it easier to differentiate instruction. The ability to introduce deliberate mistakes and have students troubleshoot the code can also provide an opportunity for hands-on learning and problem-solving. Additionally, ChatGPT can be used to generate sample student questions on specific curriculum points, providing a quick and easy way to create a variety of practice questions for your students. While the code generated by ChatGPT may not always be perfect, it is a great starting point and can be easily edited to fit the needs of your class. Overall, ChatGPT can be a powerful tool for computing  teachers looking to make their lessons more interactive and effective.