Hey Emma!
Okay, here's what I'd recommend to try.
In your Storyline project where you created the animation follow these steps.
Home Tab > Publish > Video tab in the Publish window.
Tell it where you want to save your video.
Now open Photoshop.
File > Import > Video Frames to Layers
Navigate to the video you saved and choose it.
You'll get a little dialog, then that says what range you want and all that, you can adjust that if needed especially if your animation is long then you can check the "Limit to Every 2 frames" box
Click OK
Now your video is going to come into Photoshop where each frame is a layer.
Got to File>Export>Save for Web (Legacy)
Now you're in the GIF export dialog.
Play around with these settings, especially the dither and the colors. Making a Gif from scratch like this is a balancing act of getting the file size small enough that it loads easily but keeping your quality as high as possible. If you know you made your video a little bigger and you're planning for things to be scaled down in their final use, try scaling it down in the image size section of this dialog and it will drastically reduce your file size.
I know this is a little complicated but feel free to reach back out if you're having trouble!
Glad you're experimenting using Gifs in your courses, I think they really add something special!
Cheers!
-Laura