-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Saving progress when tab is refreshed or closed #53
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for arito ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
Congratulations on your First Pull Request! Wish you best on your open-source journey 😊
Hey @Anan7Codes, thanks for the PR, you have done an amazing job! I will be responding very soon after checking if everything is working well and telling you if there are any bugs or other problems. Happy Contributing! |
I have noticed a small bug, the time is getting reset when we reload the app (or close and open again) and the total time taken is actually being shown as the time taken to complete after the latest reloading (or reopening). For example, let's say 10 seconds were spent on solving the questions, and then I reload the app and then take only 5 seconds to complete the test (because less number of questions were there to be solved) and the Final Results show 5 seconds, which actually should be 15 seconds, that is, all the time taken in the previous instances added. I hope I was able to explain, I would like to know what are your thoughts and can you solve this bug or not. |
Yeah, I didn't notice the preview link my bad. I've taken the vercel link down. I'll look into this issue and update you. |
I found the mistake. |
Okay so now there is another bug I just now observed... @Anan7Codes Let's suppose we are giving a test of 5 questions, and we take 10 secs to reach the final question, and then close the app. Now the issue is that the time is actually continued to be counted in the background (maybe because of the files that are stored locally still running) and when you open the app after, let's say 1 minute, and then solve the final question in 2 secs, it should actually show the total time taken as 12 seconds, but it shows 1 minute and 12 seconds! |
Yea I got what you are saying. So right now when the test page is created there is a start time and the end time is when the result page is created. So irrespective of whether the tab is closed or not, time is counted. If we are only counting the time taken when the tab is open and the test is going on, then I think the approach would be to calculate the time taken to answer each question and add it at the end to generate the total time. This way we could show the time taken to answer individual questions as well I guess. What do you think? |
Hey @Anan7Codes, what you are suggesting will be implemented in near future as "Average Time Taken for each question" in the Results Page. But as of now, we don't need that much detail. Whatever may happen, currently our aim is to solve the bug of extra time counted even after the app is closed, that is, stop the time counting when the app is closed, and then start it when the app is opened again (or reloaded) and add the time taken while giving the test (or say when the question page is open) only. Forgive me for my complicated language and grammatical errors 😅 Was I able to explain? |
No worries. I got you clearly. But technically if they close the tab and come back maybe 2 hours later, shouldn't we still count the time since it is a test 🤔 |
@Anan7Codes See, the thing is, Let's say they are too smart and they just put random values as answers and get to the end to have all the questions, and then close the app, solve all of them using a calculator or just take more time, and submit and get full marks! LOL, I gave a whole damn lecture! Sorry for that but I think I was able to explain... |
lol fair enough. I'll make the changes and commit it. |
Done. |
There still remains a small issue. My next commit will fix it. I know what it is. |
Alright so right now,
|
If you find this too complicated, the easier approach would be to just calculate the time when |
I just checked and observed that the time is getting reset after we reload and give the test. |
Watch this once @Anan7Codes recording.mp4 |
The Total Time Taken should be ~28 secs more or less a bit. But it is nearly half of it! Thank you |
No phenomenon, mate. It was my bad. A recording from my side for on refresh And this recording is when the tab is closed. |
Hey @Anan7Codes |
Hey @Anan7Codes Can you please resolve the merge conflicts? |
Also, I was thinking will it better if we provide the user with an option to resume the test or not. What do you think about this? @Anan7Codes |
Done. Can you review it? I've added recordings from my side as well. |
I think it's better as a new issue as it'll be a good opportunity for somebody else. |
Yeah, you are right, also, we will be adding some buttons like back, and exit, to provide the user with the options to exit a certain stage of the app, and not get stuck in that test, or starting test page. |
Sure! Will take some time as I am a little busy these days, will inform you once I am done with it. |
We will merge this PR after merging #72. A few merge conflicts will appear which we will have to resolve. |
Related to #33
Describe the changes you've made
Saving the necessary data in local storage to save(persist) data(progress) upon refresh or if the tab is closed.
Type of change
What sort of change have you made:
How Has This Been Tested?
I've only tested it locally.
Checklist:
Test URL
https://arito.vercel.app/
(Will take the URL down once we sort it out and merge)