ucfopen / Materia

Engage students with easily embedded apps for online courses. Supercharge your course with compelling experiences and game mechanics.
https://ucfopen.github.io/Materia-Docs/
GNU Affero General Public License v3.0
37 stars 32 forks source link

Instance importer/exporter #1561

Open cayb0rg opened 5 months ago

cayb0rg commented 5 months ago

This PR adds an instance importer/exporter to a few components:

Second Iteration

Screenshot 2024-04-04 at 1 01 20 PM

Save History:

Screenshot 2024-04-04 at 1 03 59 PM

User Managed Instances/Admin Instance Search:

Screenshot 2024-04-04 at 1 04 46 PM

Toast:

image

First Iteration (Meatball Menu)

My Widgets Page:

image

Details

Media exporting works for new and updated widgets only and will not appear for widgets with missing entries in the map_asset_to_object table. This table was not being properly updated in Widget_Question::db_store (NEEDS CHECK ON PROD).

Details:

While I don't see a use case for importing media in Materia itself (since we're just pointing at already existing assets), this is something that would most likely need to be added in the Materia Community Library.

To do:

clpetersonucf commented 4 months ago

Overall, awesome start on this feature :+1: Some initial thoughts:

cayb0rg commented 3 months ago

My one concern is exporting qsets that contain media assets, since those assets aren't included and assume the qset will be installed in the same system (?)

That's a good point. "Export Qset" simply exports the qset with no assets attached while "Export All" will. I think this could be explained in the intermediate modal. Even so, uploading assets to a new system would likely change the IDs, rendering the qset image ids useless. I would like to enable instance+media transfer between systems, so I'll look into this.

We don't really expose "instances" and "qsets" as terminology anywhere else, so there may be confusion with just having those options available without any kind of explanation. What about replacing the 3-button menu (which looks great, btw) with a generic "Export" icon, which provides an intermediate modal explaining the two options and their purpose?

I was worried about the wording here as well. I like that idea and think it will clarify things for the user.

The Import Instance option is kinda hidden down there at the bottom of the instance list, but I think that's okay - it's not likely to be a widely-used feature, so I'm okay making it a little obfuscated.

If you think I should make it a different color (like the orange) to make it stand out more, I can do that. My intention here was to make it slightly more hidden since it's not widely-used as you said, and I see it as more of an advanced option.

The creator Save History dialog is missing the close/cancel option, and it might benefit from being renamed to something like "Manage Saves" if it's going to be extended to handle import/export as well.

👍🏻

The toasts are awesome, I love them! However I did notice that they need a bigger z-index value as they tend to hide between certain other UI elements. Maybe they're just shy.

Haha, good catch!

Also, sorry for taking so long to respond.