I'm building a small interactive quiz feature for a content site I run (https://www.crabguide.com/types-of-hermit-crabs/), the quiz asks a few multiple-choice questions and recommends a result category based on the combined answers, similar to a basic "which type are you" format.
I'm using plain JavaScript, no framework, since the rest of the site is WordPress and I don't want the overhead of a full build pipeline for one small feature.
My current approach is a simple weighted-scoring object where each answer adds points to different result categories, and the highest score at the end determines the result. This works for a small number of questions, but I'm wondering if this pattern breaks down or gets hard to maintain as more questions/branches get added.
Is a weighted-scoring approach generally considered fine at small scale, or is there a cleaner pattern (state machine, decision tree, etc.) that's worth adopting early even for something this simple? Interested in hearing from anyone who has built something similar without a framework.