Skip to content

Commit

Permalink
fix bug with ts_configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
pretendWhale committed Dec 8, 2020
1 parent 936db34 commit 19e1bb6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mooclet_engine/engine/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,8 @@ def ts_sample(versions_dict, context):
{version1: {successess: 1, failures: 1}.
version2: {successess: 1, failures: 1}, ...}, and context
"""
Variable = apps.get_model('engine', 'Variable')
Value = apps.get_model('engine', 'Value')
Version = apps.get_model('engine', 'Version')
version_to_show = None
max_beta = 0
Expand All @@ -1343,6 +1345,8 @@ def ts_sample(versions_dict, context):
max_beta = version_beta
version_to_show = version

ur_or_ts, created = Variable.objects.get_or_create(name="UR_or_TS")

Value.objects.create(variable=ur_or_ts, value=1.0,
text="TS_NONPOSTDIFF", learner=context["learner"], mooclet=context["mooclet"],
version=version_to_show)
Expand Down

0 comments on commit 19e1bb6

Please sign in to comment.