Approach needed to build app


I want to build a web app which returns a unique row order of a database based on a questionnaire completed by the user, including some rows being excluded and adding additional weighted conditional logic to rank the returned row order

What is the best approach? Are there plugins which would help?

For example, searching for university courses:
Q1: Rank these courses in order of preference
Rank 1 - Course X
Rank 2 - Course Y
Rank 3 - Course Z

Q2: What courses do you not want to exclude?
A: Course W

Q3: Do you prioritise a small class size?
A: Yes (Course Y has a small class size)

Result for user (based conditional logic from Q1-3):
Row 1: Course Y
Row 2: Course X
Row 3: Course Z

It seems to me all questions are related to courses. So I would go with a grading system.

Courses X / Y / Z, all start with a score of “0”

Each question can :

  • add +1 or more points to the candidates answers (Q1 for instance will add 3 points to Course X, 2 to Y, 1 to Z). You can also weight questions by importance for instance by multiplying the ranking by an multiplying factor related to the question.
  • remove 1 or more points
  • or completely disqualify this option (Q2 should remove course W from the final answer)

At the end of the form, you have a list of courses with points. This is the result.

That technically translates to datatypes :

  • Questions
    – Weight of the question (number)
    – Question : text

  • Form_entries
    – User : user
    – Answers : list of “Courses”

  • Courses
    – Name : text

1 Like

Thank you - I like this approach, do you have any suggestions for how I can score within the questionnaire and return the database in a ranked/graded format?

To answer your question you should start asking yourself what do you want to do with the data later on? What do you need to store?

The answer will be different if you need to just give the result as a ranked list of courses. Or if you need to store each independant answer to every single question etc…
Also, can the answers be modified in the future? Can the form be interupted (pause) and then the user comes back and continues where he left?
etc… these kind of questions are needed to narrow down solutions