[CM-28] Generate and process post request with mastery learning info#30
Conversation
Connor-Bernard
left a comment
There was a problem hiding this comment.
Couple of comments and/or changes
|
For testing, you should do a local integration test using the docker stack (you can use the dev stack) |
|
Please add screenshots as necessary. Also, you can give an example using postman |
Will do! |
Co-authored-by: Connor <connorbernard@berkeley.edu>
| setConceptMapHTML(res.data); | ||
| }); | ||
| setLoading(false); | ||
| }); |
There was a problem hiding this comment.
Why do we set the concept map html twice?
There was a problem hiding this comment.
When the selected student in the dropdown changes, the html for that student’s CM is retrieved and conceptMapHTML is updated accordingly. In the prior version of this file, this useEffect function used to update the query string when the selected student changed.
There was a problem hiding this comment.
Oh so its twice for backwards compatibility?
There was a problem hiding this comment.
Not quite. This code updates conceptMapHTML every time the selected student in the dropdown (available to users with admin privileges) changes to ensure that the corresponding CM is displayed. It isn’t to ensure backwards compatibility; I meant that this useEffect function currently serves a purpose analogous to its purpose in the prior version of this file.
Connor-Bernard
left a comment
There was a problem hiding this comment.
LGTM (approved and QA by team)
Thanks a ton, Connor and CM team!!! |
…30) * Process post request with mastery learning info * Restore index method to original state * Generate CM from post parameters * Access nested student and class mastery keys * Bug fix + return correct error code * Fix validation bug + load constants from file * Attempt to POST CM through the iframe + transfer CM-200 changes * Implement api endpoint to return mastery mapping and post to CM in iframe * Make dedicated router for mastery mapping + cleanup * Formatting changes * Formatting changes * Formatting changes * Formatting change * Misc. changes + optimize getTopicsFromUser * Rename variables per convention Co-authored-by: Connor <connorbernard@berkeley.edu> * Nest async function within useEffect * Minor change * Use axios to retrieve CM html * Remove error handling * Mark deprecated functions as such --------- Co-authored-by: Connor <connorbernard@berkeley.edu>


Jira Ticket
Jira Ticket
Description
Type of Change
Changes
progressReport/app.pygenerate_cm_from_post_parameters, which is essentially a modified version ofindexvalidate_mastery_learning_post_requestprogressReport/meta/defaults.jsonwebsite/src/views/conceptMap.jsmasterymapping/index.jsgetTopicsFromUsergetMasteryMappingto generate the dictionary used in the POST request. It takes in the dictionaries userTopicPoints, maxTopicPoints, which map node names to points earned and max points respectively, and returns the dictionary which will be issued as a POST request.Testing
Ran GV and confirmed that output matches data in HAID.
Checklist
<ticket-id>/<brief-description-of-change>[<ticket-id>] <brief-description-of-change>Screenshots/Video
Additional Notes
Post Request Schema:
The "school", "class", all concepts, and all nested "class_mastery" fields are optional. CM will default to school = "Berkeley", class = "CS10", and class_mastery = 0 in lieu of these fields being provided.
{"school": [String], "class": [String], "[Insert concept name 1]": {student_mastery: [Integer], class_mastery: [Integer]}, "[Insert concept name2]":...}