JPedro2 / WxT-QA-BOT

This Webex Teams bot is being developed as part of the Cisco and IBM partnership to help Cisco and IBM volunteers that will be supporting teachers and charities, across the UK, to access free video conferencing through the use of Cisco Webex Meetings
0 stars 1 forks source link

Update Tab: Deleting alternative does not work #19

Closed JPedro2 closed 4 years ago

JPedro2 commented 4 years ago

When trying to update an existing question by deleting an existing alternative b and then submitting it, the alternative 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 alternatives form-data should look like:

Old-alternatives: alternatives = "alternative 1 ; alternative2"

user deletes 'alternative2' using the - button

new-alternatives-to-be-submitted: alternatives = "alternative 1"

dookah commented 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: image

One alternative (After removing the second alternative): image

This is the format the questions are posted in

JPedro2 commented 4 years ago

@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?

JPedro2 commented 4 years ago

Fixed by @dookah in 0fb5c98 and efc84d9