Closed JPedro2 closed 4 years ago
@JPedro2 I've been testing the function and it seems to be working correctly, I've attached screenshots of the output of the function which generates the alternative question format.
Two alternatives:
One alternative (After removing the second alternative):
This is the format the questions are posted in
@dookah that looks perfect! Can you just make sure that if you delete it as in picture 2 and then submit it, when you query it back the "Test 2" alternative is gone?
When trying to update an existing question by deleting an existing
alternative b
and then submitting it, thealternative b
still persists when querying the question again.Ideally if a question has 2 alternatives and they are load from the Updates tab, then if one is deleted and submitted, next time I query the question only 1 alternative should be present.
From a backEnd perspective this is already possible because wtv the frontEnd submits via the
/UpdateEntry
API is what gets replaced in the DB, so if there are alternative questions and one needs to be deleted then the alternativesform-data
should look like:Old-alternatives:
alternatives = "alternative 1 ; alternative2"
new-alternatives-to-be-submitted:
alternatives = "alternative 1"