Arquisoft / wiq_en1b

wiq_en1b
https://youtu.be/r2XqDUHj3zU
0 stars 1 forks source link

JSON model for questions #22

Closed Mister-Mario closed 6 months ago

Mister-Mario commented 6 months ago

Discussion about the format of the JSON that the API will use as a respond to the requests about the requests related to the generation of questions.

Mario and Jorge will work on this and Lucia will approve it

Mister-Mario commented 6 months ago

First idea

{ "0": "same as N-1", "1": "same as N-1", "N-1": { "question": "the actual question", "answers": { "correct":"correct answer" "wrong":["wrong1",...,"wrongM-2"] } } } Being N the number of questions asked and M the number of possible answers being the minimun 2

UO289845 commented 6 months ago

Another possible way would be to change the answers part, because I don't think there's an actual need to make an explicit split between the right and wrong answers, since it could be done in the follwing way:

"answers":["correct", "wrong1", ..., "wrongM-2"]

The reason to do this instead would be to allow for a quicker processing of it in the frontend, since it makes the randomness of the placement of answers much easier. To exemplify this, imagine that the frontend takes this same collection, makes a reference to the first element (to the element itself, not to the element of the first position), and then randomizes the order of the elements. For this is better to already have it in a single collection, but it's not actually necessary. Also, for other aproaches this will not offer any advantages respect to your proposal (but it won't have any major drawback either).

Apart from that I think that the rest is perfect and I can see it being implemented taht way.

Mister-Mario commented 6 months ago

Yeah I think that is a good idea, we just need to document the idea of the correct answer is the first one.

Mister-Mario commented 6 months ago

Final JSON then: { "0": "same as N-1", "1": "same as N-1", "N-1": { "question": "the actual question", "answers": ["correct answer","wrong1",...,"wrongM-2"] } }

uo289267 commented 6 months ago

I agree and consider the json model to be correct ✅