-
Notifications
You must be signed in to change notification settings - Fork 7
Test ends as we complete the paragraph #4
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,6 +162,15 @@ class App extends React.Component { | |
| return; | ||
| } | ||
|
|
||
| if (index === this.state.selectedParagraph.length - 1) { | ||
| this.setState({ | ||
| characters, | ||
| words, | ||
| timeRemaining: 0, | ||
| }); | ||
| return; | ||
| } | ||
|
|
||
|
Comment on lines
+165
to
+181
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This logic looks good, but we should probably also update the score here Since - if the user finishes the tests before time, the time won't be 60 seconds, and his/her wpm will be more In case you wish to work on this in this PR itself, it'd be cool But, If you want, this can be taken up in a separate PR/issue, open another issue and add a comment here with a todo something like this -
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will the update WPM will be calculated using the below formula? For eg:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sounds perfect! |
||
| // Make a copy | ||
| const testInfo = this.state.testInfo; | ||
| if (!(index === this.state.selectedParagraph.length - 1)) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgive me for this, earlier i used to type "npm install dependencies" instead of "npm install" after cloning a repo. Learned this thing yesterday
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, no worries, it happens ✨
Also, you don't need to apologize for these small mistakes, you're contributing to open source in your free time, so I should be the one thanking you,
Just delete this line, and it should be alright