Thank you both for the reply. I honestly was completely defeated by these responses and felt way in over my head with the programming, but I’m going to try again with your feedback.
I’ve actually had the structure in place for some time. I have each question on a separate card, a counter card with the sliders that count up based on the answers, as well as a button (btnResult) on the final question that (on click) runs the query you recommended.
The problem is, I don’t really know how to finalize it. How would I take the highest value returned by clicking the button and use that result to navigate to the intended “quiz result” card?
You could make a dictionary that maps slider names to result cards and "go[]" to the card corresponding to the top-ranked result:
on click do sliders:likesDogs,likesCats,likesFish,likesChickens order:extract value..name orderby value..value desc from sliders results.likesDogs:"TheDogCard" results.likesCats:"TheCatCard" results.likesFish:"TheFishCard" results.likesChickens:"TheChickensCard" go[results[first order]] end
If your quiz result cards are named to correspond to the sliders, you could skip the dictionary and "go[]" to a card by name:
on click do sliders:likesDogs,likesCats,likesFish,likesChickens order:extract value..name orderby value..value desc from sliders go[first order] end
(Using consistent naming conventions for cards and widgets can often make scripts a good bit simpler!)
If the sliders aren't on the same card as the result-calculating button, you'll need to reference them through their container card. Say the card with the counters is named "counters":
on click do sliders:counters.widgets.likesDogs, counters.widgets.likesCats, counters.widgets.likesFish, counters.widgets.likesChickens order:extract value..name orderby value..value desc from sliders go[first order] end
Or- more concisely-
on click do sliders:counters.widgets @ "likesDogs","likesCats","likesFish","likesChickens" order:extract value..name orderby value..value desc from sliders go[first order] end
Or, if the sliders are the only widgets on that card:
on click do sliders:range counters.widgets order:extract value..name orderby value..value desc from sliders go[first order] end
Does that help at all?
Oh my god, thank you! That first one is exactly what I needed. I was missing the “results” part of each line but had figured the rest out. I really appreciate your help; the documentation for the coding language is great, it’s just very overwhelming to me for whatever reason.
I will try these solutions tonight and report back.