and I have the following data fields to the data type puzzles (the correct answers fields is just me trying to figure it out without luck, i have tried using the image path as a correct answer but no luck:
Issue:
The issue I’m having now is how do I set the image to be the correct image answer?
I 'm trying to achieve the following structure: they select one image, if they select another one the past one gets unselected (i assume with a state but not sure how to execute that). And then they click on a button that says “Submit answer” and it checks if the selected image is the correct image answer.
Thanks for your input! Reason why i can not have number (at least what i think) is that i will show them randomly in the repeating group and not in order.
But maybe the order is in the actual way i upload them to the data filed?
If your list of answers is a list of images, and your correct answer is again an image, you may not achieve this the right way. Because the image you uploaded as the correct answer might not be (and probably will not be) in the list of answers (even if it perfect is the same picture). Technically, you should have an Answer data type to do this clearly. The logic is, you can mark one of the answers as the correct answer, and then you can check if the selected answer in the repeating group is the correct answer, easily.
I don’t know how many questions you have but you will either do it in a basic dashboard for the admins (show all the questions and their answers and mark as correct button in each cell).
Or you can use the data tab of the editor, to do this manually yourself.
Hmm other idea for a randomize case is prob make your data structure change
example. so you have an image table called “pattern” where you put countless of image (single item sadly)
And then on the current table you working on just assign a relation table into the “pattern” for answer is a single item and for the option just “list of pattern”
Now to check for the anwer if it’s correct you just filtered it out maybe use count after that if it’s return 0 then it’s incorrect return 1 it’s correct
Not sure on this one? What is image_data? and how do i connect the correct awnser to the correct image? Im sorry if i dont understand but this is for sure the most confusing thing i have tried to built so far haha…
Basically I suggesting you to create a relationship table a one to many relation
So there will be 2 table (1 quiz A and 1 for images B)
All u need to do on table A is to add table B value to quiz_answer and quiz_option list (the value it saved will be unique’id)
And so like i said with custom state before. Make a custom state with the type of table B. When user click on one of the image in the quiz_option save it to the custom state.
Now to check if the answer is correct you use “do a search for” with filter “custom_state’value is table_A’quiz_answer”