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

Add next button wait and timeout #489

Merged
merged 7 commits into from
Nov 5, 2024
Merged

Add next button wait and timeout #489

merged 7 commits into from
Nov 5, 2024

Conversation

JackWilb
Copy link
Contributor

@JackWilb JackWilb commented Nov 1, 2024

Does this PR close any open issues?

Closes #449

Give a longer description of what this PR addresses and why it's needed

This pull request introduces a new feature to control the timing of the "Next" button in the response block, along with some schema updates and UI enhancements.

Adds a timer and 2 config options that either require a certain to have passed before the next button becomes available or disables the next button after a certain amount of time.

I had to modify some helpers slightly so that the participant answers would not be recorded on an incorrect answer. We still save a StoredAnswer (so we can replay provenance, etc.), but don't save any answers from the answer validator.

Provide pictures/videos of the behavior before and after these changes (optional)

Screenshot 2024-11-01 at 10 21 23 AM Screenshot 2024-11-01 at 10 21 11 AM Screenshot 2024-11-01 at 10 21 19 AM

Are there any additional TODOs before this PR is ready to go?

TODOs:

  • Update relevant documentation (typedoc)
  • ...

Copy link
Contributor

@bbollen23 bbollen23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work. Only one thing that for sure needs to be changed (the wording when you time out).

@@ -1,5 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/revisit-studies/study/v1.0.5/src/parser/StudyConfigSchema.json",
"$schema": "https://raw.githubusercontent.com/revisit-studies/study/time-to-next/src/parser/StudyConfigSchema.json",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confused what the change is for? Just for testing the schema validation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lets the tests pass here, not just locally. It uses the updated schema

{`${key}: `}
</Text>
<Text span>
{`${storedAnswer}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{`${storedAnswer}`}
{storedAnswer}

Can it just be this? Note sure if there is a "string/number" issue that you're trying to avoid here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's a type issue:

Type '{ id: string; value: unknown; }' is not assignable to type 'ReactNode'.

src/components/response/ResponseBlock.tsx Outdated Show resolved Hide resolved
src/components/TimedOut.tsx Outdated Show resolved Hide resolved
src/components/response/ResponseBlock.tsx Outdated Show resolved Hide resolved
@JackWilb JackWilb merged commit 8814b63 into dev Nov 5, 2024
4 checks passed
@JackWilb JackWilb deleted the time-to-next branch November 5, 2024 18:29
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