And some more questions on related topics.
User: Also, I have another question regarding quiz scoring. Currently, the templates have scoring tied to specific quiz elements. If we create a normal page (for example, a page with a button that opens and closes a popup) and want completing that interaction to award points that appear on the quiz results screen, is there a way to implement custom scoring for such a page and include it as part of the quiz? Our response: You could do a similar thing, use a template of some type and then hide it. Or try to extract the actions that add to the tempate_lesson_map.
I must warn you, it sounds like you're starting down a path that many authors take, which is to try to use our templates to save time, but make heavy modifications to them. However, you will end up spending more time trying to fight our templates to get them to do what you want than you would if you built your logic from scratch using basic variables. Inevitably, your client/stakeholder will have changes and you will spend lots of time trying to understand the complexity of the template's logic and trying to override it instead of dealing with a much more streamlined and flexible approach from the start. I strongly encourage you to build this from scratch. The templates are like a bus, and you will need the flexibility of a smaller vehicle.
User: If there are any tutorials or documentation covering custom scoring or adding points programmatically, could you please share them?Our response: We don't have any tutorials that go into that, but usually implementing the logic isn't the problem, it's defining the needs. Once that is sufficiently outlined, the logic is pretty easy. Can people retake questions? Is there a review mode (for read only)? If it's a one time quiz with no way to go back, just add to a score_variable. If they can retake a question (even if your client doesn't want this now, they might in the future), you don't want them to re-answer the same question over and over be able to go over 100%, so you'll need to create separate variables, or a list so that you only overwrite the same value. Then at the end, add up those values.
We will probably create a video tutorial on this topic in the near future - keep an on our help page and/or our YouTube channel.User: One more question is about the scope of global variables. Are global variables accessible across the entire module, or are they limited to a single page? If we need a variable whose scope is limited to just one page, what would be the recommended approach?Our response: I'm sure you've tested this and know that global variables are accessible across pages. See the video in the previous post for an introduction to variables. In the event that you need a page-scoped variable because you don't want to clutter up your list of global variables, we just use something like "_this_page_score", reset the initial value onPageLoad of that page, and then reuse the same variable on different pages (reseting the value onPageLoad each time).
Hope that helps!