Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save and continue when there is no feedback #76

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

TylerZeroMaster
Copy link
Contributor

https://openstax.atlassian.net/browse/CORE-173

Why do it this way?

onAnswerSave is non-blocking and non-awaitable. Consequently, calling onAnswerSave in the onClick of the submit button does not work because this will advance to the next question before the current one is finished saving.

We know that the api is done saving when is_completed becomes true.

When hasFeedback is falsey and the submit button is clicked, shouldContinue is set to true.

Assumption:
If both shouldContinue and is_completed are true, then the answer has been submitted and saved and it is okay to advance.

Why do it this way?

`onAnswerSave` is non-blocking and non-awaitable. Consequently, calling
`onAnswerSave` in the onClick of the submit button does not work
because this will advance to the next question before the current one
is finished saving.

We know that the api is done saving when `is_completed` becomes true.

When `hasFeedback` is falsy and the submit button is clicked,
`shouldContinue` is set to `true`.

If both `shouldContinue` and `is_completed` are true, then the answer
has been submitted and saved and it is okay to advance.

[CORE-173]
@TylerZeroMaster TylerZeroMaster requested a review from a team as a code owner October 25, 2024 20:35
@TylerZeroMaster TylerZeroMaster requested review from bethshook and removed request for a team October 25, 2024 20:35
@TylerZeroMaster TylerZeroMaster merged commit 1c2f02b into main Oct 30, 2024
1 check passed
@TylerZeroMaster TylerZeroMaster deleted the core-173-submit-continue branch October 30, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants