You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the second HTTP request does not depend on the first, it is unnecessary to nest them in this way. It would be simpler to write a for loop over the questions and post them one by one.
This appears in several places elsewhere.
The text was updated successfully, but these errors were encountered:
Okay, @thomasmorgan pointed out a problem with the above solution, which is that moving to the next page can interrupt the HTTP requests. Instead of a loop, we should write a recursive function that automatically extracts all the ids of the questions and recursively runs through the list, posting each response.
Consider the nested HTTP requests in the following snippet from
questionnaire.js
:Because the second HTTP request does not depend on the first, it is unnecessary to nest them in this way. It would be simpler to write a for loop over the questions and post them one by one.
This appears in several places elsewhere.
The text was updated successfully, but these errors were encountered: