Message Boards Message Boards

Back

Multiple Dropdown Template Query

Toggle
Multiple Dropdown Template Query
Answer
8/28/26 7:04 PM
We recently had a question from a user that brought to light some interesting ideas. We thought we would share some of those ideas here, omitting any user-specific details.

Initial question:
I'm using the Dropdown template to create a question with multiple dropdowns. The template works well with a single dropdown, but I need the following behavior for multiple dropdowns:
  1. Enable the Submit button only after all dropdowns have a selection.
  2. Award 1 point only if all selections are correct; otherwise, 0.
  3. If possible, remove or disable options in a dropdown that have already been selected in another dropdown to prevent duplicate selections.
Could you please let me know if this is supported or the recommended way to implement it?

Our response:
  • Is this part of a larger quiz? Do you need the interaction to report to a quiz results template so that it can be scored alongside other questions? Or will saving the 1 or 0 points awarded into its own variable be sufficient (which can be tallied up manually later)? Ideally you would NOT use the template, but if you need to interface with a larger quiz, that complicates things. You can start with a True/False or dropdown template, hide the template-provided RadioButton or Dropdown object, build all your own objects and functionality, and if everything is correct, then force the RB or DDL to show the correct option and let it handle the integration / larger quiz-scoring. Here's a quick video - https://app.screencast.com/TVfl8SDkS0OOy
  • Does the order of the correct answers matter? That will determine the logic you use for your "correct answer". You can support partially correct points or individual answers if you create more options in the template-supplied DDL.
  • You cannot disable individual options in a dropdown, but you can remove them. Well, actually you can replace all the dropdown options with a new list that omits the one you want removed. Usually for this type of one-to-one matching scenario, we would use a drag and drop, since you cannot put a single drag item into more than one dropzone. It natively handles this sort of interaction. If you do want to remove options from the dropdowns, you can no longer use indexes, you'll need to get the selected index, get the text, and evaluate against that. Overall this will get very complicated very quickly as you need to keep updating all the dropdown lists every time a selection is made. I would not recommend it if you have the choice.
0 (0 Votes)

RE: Multiple Dropdown Template Query
Answer
8/31/26 5:11 PM as a reply to Navdeep Dhillon.
Some more follow ups on that initial email.

User: Thanks for your guidance. The demo you shared on using the Dropdown template for Quiz works well for scenarios where multiple dropdowns have different options and each dropdown has its own specific correct answer. This solution works perfectly for one of our use case. 

For another scenario, the same approach seems like it could work, but any dropdown can have any of the four options as the correct answer. To achieve this, it looks like we may need to use an array to store the selected indices, then sort the array, remove duplicates, and compare it against the expected values to determine whether the selections are correct. Based on the result, we can then trigger the Dropdown template's selected index change. Is there a video tutorial or documentation that explains how to work with arrays and/or global variables? It seems we'll need to perform a few array operations to implement this logic. 


Our response: We have a video tutorial on the basics of global variables, but not really on arrays (we call them lists). We will eventually create an intro to lists, but it likely wouldn't cover the depth that you need here. They work the same as lists/arrays in other tools, and you'll find the blocks in the List category. Please note that we start our indexes at 1, not 0 - but apart from that they work the same as any other list/array. You'll find the blocks for the terms you're using in that category. If you're familiar with the term, you'll know how to use the blocks. Unfortunately, we don't have a block for de-duplicating yet, but I've added that to our enhancements list. Here's some logic to de-dupe the long way (screenshot1). I would use the debug panel extensively in your testing, so you can see the values of the variables as you're working. Looking at your plan, I don't think you need to de-dupe, you just need to sort, and compare against your correct list. Or if you have a small number of objects, you can do something like this (screenshot2).

I also encourage you to build simple cases like this to test ideas in a separate lesson, outside of the complexity of your main lesson. It may seem like a "waste of time", but it's much easier to work out the logic this way when you don't have lesson-specific actions also causing weird issues.
0 (0 Votes)

RE: Multiple Dropdown Template Query
Answer
9/2/26 4:19 PM as a reply to Navdeep Dhillon.
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!
0 (0 Votes)