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 ability to retrieve timing history for a single question #96

Closed
vegetabill opened this issue Oct 1, 2020 · 10 comments · Fixed by #132
Closed

Add ability to retrieve timing history for a single question #96

vegetabill opened this issue Oct 1, 2020 · 10 comments · Fixed by #132
Assignees
Labels
backend GHC2020 Project Hacktoberfest Priority 3 Must finish before moving on to Priority 4.

Comments

@vegetabill
Copy link
Collaborator

vegetabill commented Oct 1, 2020

Currently, the timing history is stored in local storage. The code for it is in history.js. But after #67 we can retrieve this from the database instead.

  • Add a new GET endpoint /user/answers/question/{questionNumber}
  • Respond with 0-3 answer records if they exist (JSON shown below)
  • Use this data to populate the existing timing boxes
{
  "previousTimingMs": [53, 210, 303]
}

If there is no history, if they have never answered it before, include [] for the timings.

When showing a new question, make an AJAX call (using fetch, not jQuery) to this API endpoint and use the timing in the JSON to populate the existing UI. Feel free to modify history.js however you want. It no longer needs local storage.

@vegetabill vegetabill added backend GHC2020 Project GraceHopperOSD Reserved for GHC Open Source Day! Priority 3 Must finish before moving on to Priority 4. labels Oct 1, 2020
@Sangvi98
Copy link

Sangvi98 commented Oct 1, 2020

I'd like to be assigned to this issue!

@arpi-r
Copy link
Collaborator

arpi-r commented Oct 1, 2020

Assigned!

@alodahl
Copy link
Collaborator

alodahl commented Oct 1, 2020

You can get started, but keep in mind to get this fully working, you'll need #67 to be merged so just keep that in mind 😃

@Sangvi98
Copy link

Sangvi98 commented Oct 1, 2020

Just to make sure my understanding is correct, I can actually go ahead and work on this but to test whether I've implemented it correctly, I would need #67 to be resolved first?

@vegetabill
Copy link
Collaborator Author

@Sangvi98 you can't really do much with this until #67 is merged, unless you're comfortable creating a hardcoded API endpoint to return some test data. If you want more details on this, just lmk!

@vegetabill vegetabill added the 🛑 blocked Waiting on one or more issues to be merged label Oct 1, 2020
@vegetabill
Copy link
Collaborator Author

@Sangvi98 just FYI the backend model for this was merged so you can work on this as long as you're okay manually creating test data (since the real functionality to save the previous answers is waiting on #67)

@vegetabill
Copy link
Collaborator Author

The PR is #97

@Sangvi98 Sangvi98 removed their assignment Oct 1, 2020
@Sangvi98
Copy link

Sangvi98 commented Oct 1, 2020

Hi! I was having issues figuring out how to go about this, so I unassigned myself for now.

@alodahl alodahl removed 🛑 blocked Waiting on one or more issues to be merged GraceHopperOSD Reserved for GHC Open Source Day! labels Oct 1, 2020
@josselineperdomo
Copy link
Collaborator

Hi! I would like work with this issue :)

@vegetabill
Copy link
Collaborator Author

@josselineperdomo awesome! I assigned you. Lmk if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend GHC2020 Project Hacktoberfest Priority 3 Must finish before moving on to Priority 4.
Development

Successfully merging a pull request may close this issue.

5 participants