Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ migrate:
python contentcuration/manage.py migrate || true
python contentcuration/manage.py loadconstants

# This is a special command that is we'll reuse to run data migrations outside of the normal
# django migration process. This is useful for long running migrations which we don't want to block
# the CD build. Do not delete!
# Procedure:
# 1) Add a new management command for the migration
# 2) Call it here
# 3) Perform the release
# 4) Remove the management command from this `deploy-migrate` recipe
# 5) Repeat!
deploy-migrate:
echo "Nothing to do here"

contentnodegc:
python contentcuration/manage.py garbage_collect

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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',
};
6 changes: 4 additions & 2 deletions deploy/generatejsconstantfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down