Finding Damo

The story of a man, his job, two cats and the meaning of success.

ChatGPT

The first SAC for VCE Software Development is to solve a series of programming challenges using a programming language and GUI. I pose a series of challenges to assess the students’ knowledge of the software.

This year I’m working with Python and PyQT6. When the whole ChatGPT conversation started up I thought I’d see how well the AI could complete my course.

It turns out, quite well!

So the first challenge is to create a simple program that takes three grades and has buttons for average, sum and one that tells you whether the students passed or failed.

I thought about the language and gave ChatGPT this prompt:

Aquinas College has requested that I develop a prototype reporting system using PyQT6 and Python 3.10.  The GUI should take three scores (each out of 100) entered into a form. The form should also contain the following:

Sum button to display the sum of the three scores in a label when selected.

Average button to display the average of the three scores in a label when selected.

The program must ensure that data has been entered into all the score textboxes.

Pass/Fail button to display Pass if the sum of the scores is 150 or over, Fail to be displayed if the sum of the scores is less than 150, when clicked.

Clear button to clear all the textboxes and the label when selected.

Exit button for the user to exit the application when selected.

ChatGPT responded:

To implement the reporting system using PyQT6 and Python 3.10, follow these steps:

  1. Create the GUI using PyQT6 library, add three textboxes for the scores, and five buttons for sum, average, pass/fail, clear and exit.
  2. Connect the buttons with the appropriate functions using signals and slots mechanism.
  3. For the sum button, implement a function that reads the values from the three textboxes, adds them and displays the result in a label.
  4. For the average button, implement a function that reads the values from the three textboxes, calculates the average and displays the result in a label.
  5. For the pass/fail button, implement a function that reads the values from the three textboxes, adds them and checks if the sum is 150 or over. If yes, display “Pass” in the label, otherwise display “Fail”.
  6. For the clear button, implement a function that clears the textboxes and the label.
  7. For the exit button, implement a function that closes the application.
  8. Implement data validation for the three textboxes, to ensure that data has been entered into all the score textboxes.

This is a high-level overview of the steps to implement the reporting system. The actual implementation would require writing code and making use of PyQT6 and Python 3.10 features.

Cheeky me:

ChatGPT:

Yes, I can write the program for you. Here is an example code for the reporting system using PyQT6 and Python 3.10:

Lots of code later. I pasted into Python and ran it. It worked, but was a bit dodgy, so:

And it just worked!

I want to take this further. I could ask the AI to fiddle with the layout. I could try to add in images. I was going to ask it to add in internal documentation, but thought I’d given it enough to do.

I also want to have this conversation with the students. Explain that completing programming challenges in this way won’t help them learn the basics behind the code. But once they have the basics, this could be an awesome way to learn to debug code. It’s a great way for students to break down a problem (so they can give it to the ChatGPT).

I am actually excited about ChatGPT. We can only hope that it is an evolution for education rather than something the government/education departments just try to squash to keep the status quo.

I’m not overly optimistic:

Advertisement

Single Post Navigation

Blogs should be a conversation. Leave a note!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: