feat(api): Endpoints for classroom - exchanging user data#62063
feat(api): Endpoints for classroom - exchanging user data#62063NewtonLC wants to merge 11 commits intofreeCodeCamp:mainfrom
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
4fdb50a to
ef20294
Compare
ef20294 to
b584e86
Compare
Co-Authored by: Carly Thomas <CarlyAThomas@users.noreply.github.com> Zhenyu Yu <ZhenyuYu1@users.noreply.github.com> Both endpoints are to be called from the Classroom app. - Added new endpoint to contruct a map of challenge IDs to name, certification, etc. based on _meta files, then return this map. - Added new endpoint to take in a list of student emails, then return an array of those users' completed challenge data.
b584e86 to
0692114
Compare
There was a problem hiding this comment.
Action Items:
- will create the curriculum server repository with all the wiring in it so the @freeCodeCamp/classroom team can expand the same as per the needs of the classroom app
- will document steps for the Classroom team to setup and start working on it. It will be available in the project README.
@freecodecamp/classroom:
- needs to remove the build curriculum endpoints entirely, since the functionality will be made available via the above.
This PR:
- will need another endpoint to send a single email and retrieve the user id (camper's id), classroom can store the User id in its own DB. The user id will not change (emails can).
- the get-user-data endpoint needs to:
- send user ids (batch is OK) to retrieve the data it needs
- check the user consent (more on this later) is given before sending the data out
User consent:
- will need a separate PR (@raisedadead will share code examples) to add a check box to the settings page UI
- the check box can map to a
isClassroomAccountprop on the user -- false by default
|
I have left my quick notes on this PR from the meeting. We can discuss more on this async if you prefer in the Google Chat room we have for this. |
|
Update: #62891 will add the consent settings. freeCodeCamp's API will only return data when |
a893d42 to
53e02db
Compare
Co-authored-by: Carly Thomas <CarlyAThomas@users.noreply.github.com>
53e02db to
45002cb
Compare
|
Update: @CarlyAThomas and I have completed the Action items listed for the classroom team for this PR. When retrieving student data from Classroom, we are explicitly skipping students who did not give permission. |
|
Great! https://github.com/freeCodeCamp/curriculum-db is also coming along nicely. |
ojeytonwilliams
left a comment
There was a problem hiding this comment.
Thanks for the updates @NewtonLC and @CarlyAThomas, this looks like what we want. I found a few things, but nothing serious - just minor tweaks and suggestions to be a little more consistent with the rest of the codebase.
Co-authored by: Carly Thomas <CarlyAThomas@users.noreply.github.com>
29b3838 to
f507292
Compare
|
We have updated the PR based on your suggestions. One note though, we are still looking into how we would like to specify the shape of the userData object and will need to get back to you on this specific. Thank you for reviewing our PR! |
|
Thanks, @CarlyAThomas, no rush. I'm still discussing with Mrugesh how we want to go about querying for the classroom accounts. It might be easier to go with your original approach (we need fewer indexes that way). I'll let you know. |
Co-authored-by: Carly Thomas <CarlyAThomas@users.noreply.github.com>
ojeytonwilliams
left a comment
There was a problem hiding this comment.
Sorry for the lack of updates, but this approach should be fine.
Could you add some simple tests to lock this down? Something that checks the expected output would have caught the fact that challengeName doesn't exist.
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Additionally, edited the body to not require a max of 50 items, so a custom error message will be used.
Additionally, edited the body to not require a max of 50 items, so a custom error message will be used.
|
Hello @ojeytonwilliams! I added some simple test cases for the classroom endpoints. Here's a quick summary:
Unauthenticated call --> 401 Error |
Changed 404 error to 200 response, along with empty student ID
Also edited to give 200 responses for invalid email formats
|
Hello! Just a quick note to say that this PR is ready for review. Thank you! |
Co-Authored by:
@CarlyAThomas
@ZhenyuYu1
Checklist:
mainbranch of freeCodeCamp.Closes freeCodeCamp/classroom#548
This issue calls for the Classroom App to retrieve real users' data directly from freeCodeCamp proper, which is vital for making the Classroom App work. This will allow teachers to monitor students' progress and activity in the freeCodeCamp curriculum.
This PR creates an API endpoint in freeCodeCamp that allows the Classroom App to fetch students' completed challenge data from their usernames. Since users' completedChallenges attribute does not contain metadata about the completed challenges(name, certification, etc.), we also created an endpoint that maps challenge IDs to challenge metadata, then returns this map. The Classroom App will call this endpoint in order to retrieve the map, which will be used to help display the challenges.