From 48bc118be2f4d543691d5e7cfc2fcf0252aff6dc Mon Sep 17 00:00:00 2001 From: Pursottam Sah Date: Wed, 26 Apr 2023 16:06:08 +0530 Subject: [PATCH 1/3] Fix order of exercies --- .../contentcuration/frontend/shared/leUtils/MasteryModels.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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', }; From 3e6aa0e223bb3ebfa4d51f64d52e0fa0b00bd354 Mon Sep 17 00:00:00 2001 From: Pursottam Sah Date: Wed, 26 Apr 2023 16:06:08 +0530 Subject: [PATCH 2/3] Fix order of exercies --- .../contentcuration/frontend/shared/leUtils/MasteryModels.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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', }; From d9342c7ac5412ca1acd2dda4df0d948750d211e2 Mon Sep 17 00:00:00 2001 From: Pursottam Sah Date: Thu, 4 May 2023 03:07:39 +0530 Subject: [PATCH 3/3] updated the generatejsconstantfiles.py for auto generating order of options --- deploy/generatejsconstantfiles.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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")