diff --git a/contentcuration/contentcuration/frontend/shared/leUtils/MasteryModels.js b/contentcuration/contentcuration/frontend/shared/leUtils/MasteryModels.js index 7a45f7e868..57240f5c47 100644 --- a/contentcuration/contentcuration/frontend/shared/leUtils/MasteryModels.js +++ b/contentcuration/contentcuration/frontend/shared/leUtils/MasteryModels.js @@ -2,10 +2,10 @@ const MasteryModels = new Set([ 'do_all', 'm_of_n', - 'num_correct_in_a_row_10', 'num_correct_in_a_row_2', 'num_correct_in_a_row_3', 'num_correct_in_a_row_5', + 'num_correct_in_a_row_10', ]); export default MasteryModels; @@ -15,8 +15,8 @@ export const MasteryModelsList = Array.from(MasteryModels); export const MasteryModelsNames = { DO_ALL: 'do_all', M_OF_N: 'm_of_n', - NUM_CORRECT_IN_A_ROW_10: 'num_correct_in_a_row_10', NUM_CORRECT_IN_A_ROW_2: 'num_correct_in_a_row_2', NUM_CORRECT_IN_A_ROW_3: 'num_correct_in_a_row_3', NUM_CORRECT_IN_A_ROW_5: 'num_correct_in_a_row_5', + NUM_CORRECT_IN_A_ROW_10: 'num_correct_in_a_row_10', }; diff --git a/deploy/generatejsconstantfiles.py b/deploy/generatejsconstantfiles.py index a5135f2a2c..3ef554a5e4 100644 --- a/deploy/generatejsconstantfiles.py +++ b/deploy/generatejsconstantfiles.py @@ -127,7 +127,7 @@ def generate_constants_set_file( # Don't generate this unless ids are strings generate_names_constants = True for constant in sorted( - constant_list, key=lambda x: x if mapper is None else getattr(x, sort_by) + constant_list, key=lambda x: 0 if mapper is None else getattr(x, sort_by) ): output += " " value = mapper(constant) if mapper is not None else constant @@ -177,7 +177,9 @@ def main(): ) generate_constants_set_file( - [m[0] for m in exercises.MASTERY_MODELS if m[0] != exercises.SKILL_CHECK], + [m[0] for m in sorted( + exercises.MASTERY_MODELS, key=lambda x: int(x[0][21:]) if 'num_correct_in_a_row_' in x[0] else 0 + ) if m[0] != exercises.SKILL_CHECK and m[0] != exercises.QUIZ], "MasteryModels", ) generate_constants_set_file([r[0] for r in roles.choices], "Roles")