Educator, Thinker, Consultant

Month: January 2023

Using ChatGPT to Create Multiple Choice Questions to Put into Moodle

This is a tutorial on having ChatGPT write questions to be imported into Moodle using the GIFT format. I’m going to use BBEdit as my text editor, but you can use a different one. The free version of BBEdit should do everything in these steps (* NOTE: Google Docs won’t work for the Regular Expression Find and Replace (Step 3). Microsoft Word will.)

Step 1:


Have ChatGPT write your multiple choice questions and format them in a specific way. The key is to include this sentence at the end of your request:

…Use the following format:
{1. MCVS:=Right answer/Wrong answer/Wrong answer/Wrong answer}

So, in my example, the search criteria was:

Write 50 Multiple-Choice Question about Maine. Use the following format:
{1. MCVS:=Right answer/Wrong answer/Wrong answer/Wrong answer}

This resulted in the following:

Sure, here are 50 multiple-choice questions about the state of Maine:

What is the capital city of Maine?
{MCVS:=Augusta/Portland/Bangor/Lewiston}
Which river flows through the city of Augusta?
{MCVS:=Kennebec River/Androscoggin River/Penobscot River/Saint John River}

So far so good. However, you need to do some formatting.

  • GIFT needs a blank line between questions.
  • Wrong answers need to be marked by an “~” (right answers need an “=”, but we’ve got that already).
  • “MCVS:” needs to be removed

Step 2: Copy/Paste the questions.

Highlight the questions in ChatGPT and copy them.

Paste the questions into your text editor (preferable over a word processor).

BBEdit:

Since I’m using BBEdit, you can use File | New> (with Clipboard).

Pages, Word, Google Docs

Paste the questions into a blank document.

Step 3: Add a blank line between questions:

No matter how you do this, it is just important that there is a blank line between each question. This is how questions are delineated. You should visually inspect the text to make sure that there is blank line.

BBEdit:

  • Click on Search | Find…
  • in the Find box, type: }
  • In the Replace box, type: }\r
  • Click the Replace All button.

This will find and replace all of those instances quickly.

Google Docs

This must be done manually in Google Docs. There is not currently an easy way to script this. You’ll need to set the cursor at the end of each answer line and press the return/enter key.

Manually place your cursor and hit return/enter after each “}” at the end of each answer line. This can take a while based on the number of questions.

Step 4: Remove the MCVS:

  • Click back into the Find window
  • In the Find box enter: MCVS:
  • In the Replace box – delete all text so that there is nothing in it
  • Click Replace All

Step 5: Add an “~” in front of the incorrect answers:

BBEdit:

  • Click back into the Find window
  • In the Find box enter: /
  • In the Replace box, you need two characters: (type a space)~
  • Click Replace All

Google Docs:

  • Click on Edit in the Menu bar
  • Choose Find and Replace
  • In the Find window, enter: /
  • In the Replace box, you need two characters: (type a space)~
  • Click Replace All

Optional
Add a category for the quiz questions. This means that in Moodle, these questions will all be identified in a specific category.

  • Scroll to the very top of the document.
  • Set the cursor and create a new blank line.
  • Type “$CATEGORY:XXXX” (Replace XXXX with the category name that you want).*Bonus, you can also create subcategories by adding a “/Subcategory” after your category. Thus, If you wanted a category of World War I, it would look like this:

$CATEGORY: World War I

If you wanted a sub-category of “allies” in World War I, it would look like this:

$CATEGORY: World War I/allies

  • Create a blank line below the category line.
  • Save the file

Moodle

Open your Moodle instance. Go to the course that you want to put the questions in.

  • Click on the More link in the top sub-menu
  • Select “Question Bank”
  • Click on the Questions button and select “Import”
  • Select “GIFT format” radio button
  • Drag and drop the file (or use the “Choose a file button”) to add the file that you previously saved.
  • Click “Import” button at the bottom
  • Read through the questions, scroll down and click “Continue”

That’s it. You’ve now created a bunch of questions and imported them into Moodle, ready to go.

Check the Questions

Please remember the ChatGPT is NOT programmed to be right. It will be confident, but maybe not right. It is crucial to check all the questions for accuracy.

In Moodle, you can utilize the Preview function. You may want to review the questions prior to import. Either will work, it depends on your preference. Do make sure to review the questions though.

AI -> Moodle Questions

A friend used ChatGPT (I know, I know) to create a wide variety of questions for a Geography Bee for school. The questions are all Michigan based questions. ChatGPT created a wide variety of questions. However, these need to go into Moodle.

Moodle has a great quiz question import format (GIFT format). This allows one to write questions in a text editor and import into Moodle. The format is pretty easy, but does require a bit of learning.

Attempts to have ChatGPT export the file as GIFT format were unsuccessful. So, the teachers are doing a good bit of copying/pasting. While this is still WAY faster than writing and typing, I thought that there had to be a better way.

I made a copy of the file that was downloaded from ChatGPT. Then I took the following steps:

Open Ended Questions:

  • I used Find/Replace function by Finding ” Answer:” and replacing that with “{}”.

Example:
What is the capital of Michigan? Answer: Lansing
Becomes:
What is the capital of Michigan? {Lansing}

I then also added a “}” at the end of each line (manually, need to figure out how to automate that). Plus, I made sure that there was a blank line between each question.

Multiple Choice Questions:

  • I used Find/Replace to Find: “ A)” and Replace that with “{~“ . This creates the opening bracket for answers (and also marks the first answer as “incorrect” but that will be fixed next.
  • Next, I added“=” in front of the correct answer AND “~” in front of incorrect answers. This was done manually
  • I deleted the answer line by triple-clicking it and hitting “Return/Enter”.*This creates the necessary blank line between questions.
  • Then I used Find/Replace to change the letters to ~ (e.g. “B -> “~”, then “C” ->”~, “D” ->”~). This works as we’ve already removed the A and we’ve replaced letters if the answer is correct.

Example:
What is the capital of Michigan? A) Detroit B) Grand Rapids C) Lansing D) Ann Arbor
Answer: C) Lansing
Becomes:
What is the capital of Michigan? {~Detroit ~ Grand Rapids =Lansing ~ Ann Arbor}

Categories:

Next, I added Categories by adding “$CATEGORY: Geography Bee” to create a Category of “Geography Bee” Make sure there is a blank line after this line.
In another section, I added “$CATEGORY:Geography Bee/Counties” to create a sub-category of Counties under Geography Bee.

Export:

I then exported (downloaded) the document as a text file (.txt).

Moodle

Next, I went to the Moodle Course where I wanted the quiz.

  • I clicked on More…| Question Bank.
  • I clicked on The Questions button to select “Import”
  • I picked “GIFT format”
  • I dragged the file into the “Import questions from a file” box.
  • I clicked the “Import” button

This creates all of the questions in Moodle under the appropriate categories. Now you could edit, assign, move any and all of the questions as you like.

That’s it. I know that it may sound like a lot, but once you understand what is happening, this is really pretty quick.

Special Note:

If there is anything that you don’t want to be included in the import, simply add “//” at the beginning of that line. I used this to explain what was happening to the others involved. This is called commenting something out.

Week Note 2023-02

Snow Day (s)

Friday was a snow day. We ended up with about 4 inches of snow.
Now, Monday is another snow day. The weekend was cold, but no additional snow. This will be our last traditional snow day. From here on out, we will be utilizing remote learning days.

Heatrak

I purchased some Heatrak mats for the stairs going out the back door (not cheap, but the stairs are seriously dangerous when iced). These have been a great investment. However, one of them has stopped working. (Good news, it is really obvious which one). A call to the company and a replacement is on the way.

NOLEJ

Because of the Snow Day, I finally got a chance to play around with NOLEJ a bit. NOLEJ authors materials (quizzes, flashcards,glossaries, etc) based on a resource. So, I took a YouTube video (Gettysburg: Animated Map) and let it create material. The material is created as H5P resources. I then put that into Moodle. You can check it out in the MasterMoodle course (no registration required, but you may have to click on the Login as Guest button). These are the raw files, no additional editing. Obviously, they can (and should be edited). The questions fall into basic knowledge category and some grammar needs to be corrected. This could be a way to quickly create some of the basics of a course though. The teacher would need to add higher level thinking material, questions, and learning opportunities.

Free to Use Browser Extension

I’m enjoying the Free to Use Browser Extension even more than I thought that I would. Basically, this extension displays a Public Domain image in your browser window whenever you open a new tab.

Extension sets the background of blank tabs to a photo from the Library of Congress collections that is free to use and reuse.

I just find these random pictures a source of great joy. I frequently pause for just a minute to wonder what is going on in the picture.

Books

I’ve finished “Poguemahone” by Patrick McCabe. I liked it a ton. This is really different than most of the books that I’ve been reading. It is written in free-verse focusing around the 1970’s and music. Kind of. Sort of. Largely the story of Una and her reflections.

I’m starting Frederick Backman’s Us Against You. This is a follow up to the wonderful “Beartown”. Fredrick Backman is one of my favorite authors. He has several books out. I recommend all of them that I’ve read so far.

Cover of US AGAINST YOU by Fredrick Backman. The cover shows two hockey players (one a small girl with two braids, one teenage sized with short hair under a helmet) backs standing again a blue sky with a town in the distance.

Weekly Note 2023-01

COVID

COVID finally caught up with me. Thankfully, I’m fully vaccinated, so the disease wasn’t fatal for me. Relatively, this was a like a pretty bad head cold for me. Be safe, and take precautions.

More AI

Tami Brass has a neat write-up about AI, teaching, and middle school. It is definitely worth a read.

Christmas

We got to spend some times with the kids around Christmas. This is one of the biggest reasons that we moved to Maine. It is great to have those opportunities.

We also got to spend some time with some new good friends.

Christmas with Kennerly

We did attend “Christmas with Kennerly” at the Portland Symphony. It was a good show and help us get into the Christmas mood.

After Twitter

“The internet’s town square should never have been one specific website with its own specific rules and incentives. It should have been, and should be, the web itself.”
Brent Simmons

I’ve pretty consistently heard Twitter referred to as the digital “Town Square”. However, Town Square as a privately owned rather than a publicly available place seems to be heading in the wrong direction. Whenever one person has complete control of the Town Square, it no longer becomes the Town Square, but a Square of an individual.

This is part of the balance that should be in America. America should really be reflective of three different components: People, Business, Goverment. There should be tension amongst those three. However, far too many people believe that Business (this is often pushed in terms of “freedom”), should be the default for everything. This leads to abuse by businesses. Business is designed to make money. This is partly why the stratification of wealth is continuing to be skewed. Business has managed to bake into the American psyche that freedom, letting business do what it wants, is what makes America great.

Twitter is proving to be a place that I don’t want to be. I’m working at making sure that I control my information. This is another thing that sounds great but takes effort. Mastodon is having a moment, but there are issues with Mastodon as well. Lots of people have moved to Mastodon, many looking for it to be “Twitter”, but the experience is different.

At the end of the day, people tend to want easy. Dr. Doug Belshaw and I have had a couple of conversations about this. I still believe that people want things to be very obvious and don’t want to learn how to control things. Dr. Belshaw is more optimistic.

With people moving to Mastodon, there is talk about the “return of the web”. This refers to blogging, and really people owning their own data. I’m still not convinced. The smallest roadblocks can be experience enders for many. People need to have something clear and easy to start with.

As one example, I’ve been hearing about how Linux is going to be the big thing this year.

Linux

I heard for years about how “this year is going to be the year of Linux”. It is finally as easy to use as Windows, gives you much more power, you can do so much, …. And, yet, we still haven’t gotten to the “year of Linux”. Yes, Linux is just about everywhere. But, it is “unseen”. Linux is used as an embedded system.

People clearly don’t want the maintenance and effort that Linux requires. People seem to want things that are familiar, and “easy”.

Other Software

Recently, I posted on the software that I use. I know that I left some valuable resources out. It’s funny how you can use something tons and then not even really think about it when asked.

In some conversations, I realized that I had left out at least one resource that I really like. I’ve received lots of praise for implementing this one. It replaces expensive software that doesn’t work as well.

  • BookStack – This is wiki software that you can host. It is free and open source. It produces a beautiful site. I use this for documentation sites. (In my job, documentation is undervalued but crucial.) Lots of customization options. Lots of controls. It also supports Markdown (though I leave it at the default of WYSIWYG for others.)

Just thought that I’d add it to the list.

© 2024 Troy Patterson

Theme by Anders NorenUp ↑