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

mooclet backend: send "rewards" on /log #2191

Open
danoswaltCL opened this issue Jan 31, 2025 · 0 comments
Open

mooclet backend: send "rewards" on /log #2191

danoswaltCL opened this issue Jan 31, 2025 · 0 comments
Assignees
Labels

Comments

@danoswaltCL
Copy link
Collaborator

danoswaltCL commented Jan 31, 2025

Dependent on #1934

When users log "reward" metrics, we will trigger a lookup for experiment and user condition enrollment, and proxy a call to post the reward to the Mooclet server.

For reference:
(https://github.com/CarnegieLearningWeb/UpGrade/tree/demo-branch).

https://carnegielearning.slack.com/archives/C08A2LSPM5J/p1738243122240099 for demo and diagrams.

Requirements:

If client /log's a metric that matched to a rewardMetricKey property in MoocletExperimentRef table, this will trigger a call to send the "reward" value to the Mooclet server.

The data needed for sending the reward value to the Mooclet API is:

  • moocletId
  • outcomeVariableName
  • versionId
  • value (i.e reward, will be 1 or 0)

So I think we will need to:

  • Find MoocletExperimentRef by rewardMetricKey

If found, get the versionId:

  • Find user's condition in IndividualEnrollment using user id and experiment id.
  • Find the version id by matching the condition id to the corresponding "version" in MoocletExperimentRef.versionConditionMaps

Determine value (reward)

  • The rewardMetricKey will always either give SUCCESS or FAILURE.
  • Success = 1, Failure = 0

Get outcomeVariableName from MoocletExperimentRef (we should add this property to the MoocletExperimentRef as a column and add it on experiment creation instead of searching in the policyParameters for it here).

POST these details to /value:

{
  moocletId,
  outcomeVariableName,
  versionId,
  value
}
@danoswaltCL danoswaltCL added the enhancement New feature or request label Jan 31, 2025
@danoswaltCL danoswaltCL added mooclet Needs Refined and removed enhancement New feature or request labels Jan 31, 2025
@kawcl kawcl moved this to Refined ToDo in UpGrade Project Feb 4, 2025
@kawcl kawcl added this to the Program Increment PI15 milestone Feb 4, 2025
@danoswaltCL danoswaltCL self-assigned this Feb 6, 2025
@danoswaltCL danoswaltCL moved this from Refined ToDo to In Progress in UpGrade Project Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

No branches or pull requests

2 participants