Hi Kyle,
If I understand correctly, you've exported your Unity game as a WebGL build and put it on a webserver and then embedded it into Canvas page or assignment description, and you're now trying to get the results of the quiz to display in the Canvas gradebook? This is possible, I achieved it myself a few years ago when I was testing Unity's viability as a content creation tool for Canvas, but there are some hoops that you need to jump through.
You need a SCORM compliant package and not an embedded page, as an embedded page will never be able to perform any data exchange with Canvas, including the gradebook. This would be cross-site scripting, which is a massive security issue and so Canvas will block any attempt to do so. Briefly put, SCORM is a coding standard, basically a language that e-learning applications and systems use to communicate with each other. A SCORM package is basically a ZIP file that contains some content that can run in a browser along with SCORM compliant information/code that can be executed by a learning management system, ie. Canvas. This information can include, amongst many other things, grading information and how and when to award points to students for completing your quiz.
Fortunately, you’re not the first person who wants to use Unity to create games/quizzes for Canvas, Moodle and so on. You can purchase this asset in the Unity asset store to make all of this fairly easy: https://assetstore.unity.com/packages/tools/integration/scorm-api-53523
This will enable Unity to build a WebGL SCORM package as a zip file that you can then upload to Canvas via the SCORM feature. You will have to code the SCORM instructions, but once you’ve done so and built your SCORM package in Unity, you can open any course, select SCORM on the side menu and upload the package. Canvas will then create a fully fledged and normal assignment and award points as per the instructions found in the SCORM package/Unity build.
I can’t remember exactly how I did it inside Unity, but you need some sort of trigger for awarding points. This can be very complicated or very simple depending on how detailed your grading scheme for the quiz is, but how you can code this should be available in the asset documentation if you decide to use it.
Good luck. 🙂
- Michael
Edit: By the way, if you're mass producing quizzes, Unity is very unlikely to be the most efficient and reliable tool. Captivate, H5P and other content creation tools that I see others have suggested are definitely faster and easier to use, but they are quite limited in options whereas Unity has no hard limits. Also, since Unity's technical complexity is a lot greater than more commonly used tools, expect that you will need to provide some tech support to students if you use it. 🙂