Hi, i'm writing an asp.net core app that functions as a quiestionnnarire, where users can answer questions and get a result on email.
I have some troubles on how to architect this and i'm looking for some tips and any input for a better solution.
The test is 70 questions. I'm thinking having about 6 pages with 11-12 questions on each page. But now comes the problem: i don't want to save the data for each page, only after the last page and the test is finished. So if I have 6 views, should I use the same viewmodel to kepp the data in or a different viewmodel pr page?
How would be a good way to persist the data to the last page? And what datatype should I use to hold the data?
Now i'm having a table in the database where i've stored each question as an int. So my table for each person taking the test have 70 integers. Is this normal, or can I do this differently like use another type(the value for each question is a number from 1 to 7)?
The viewmodel i have now have 12 integer properties, then I have a list<int> also where I add the numbers as they get passed from each page. Then in the end I just forloop on this list and put the results in the table like this:
var test = new Survey { test.Question1 = modelList[0], test.Question2 = modelList[1], test.Question3 = modelList[2], test.Question4 = modelList[3], ...etc }
Do you have any feedback on this? anything is much apprechiated!! :) Do you perhaps have experience in creating tests like this or have seen some examples on good practice?
Then there is of course calculating the result, which I have not gotten to yet(I know it's important to know in order to implement the survey). I just know each question is 1 to 7 and I calculate the result based on the score within each group (ie: if group 1 would be the first 10 questions I just get the total score on those and that would be the result on that category)