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: refactor the redundant mooclet.enabled checks #2208

Open
danoswaltCL opened this issue Feb 10, 2025 · 0 comments
Open

mooclet backend: refactor the redundant mooclet.enabled checks #2208

danoswaltCL opened this issue Feb 10, 2025 · 0 comments

Comments

@danoswaltCL
Copy link
Collaborator

We have several places now where we are checking if the experiment has a mooclet assignment algorithm and/or moocletPolicyParameters but mooclet is not enabled to throw an error. This sort of thing:

if (SUPPORTED_MOOCLET_ALGORITHMS.includes(experiment.assignmentAlgorithm)) {
      if (!env.mooclets?.enabled) {

We can refactor to create a utility function to reduce duplicate logic.

Requirements:

  • Create a utility function on MoocletExperimentService to perform this check and throw an error if the entity we are using deals with mooclet resources without mooclet being enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Refined ToDo
Development

No branches or pull requests

2 participants