diff --git a/Pipfile.lock b/Pipfile.lock index f5c4e20aa..47c74650d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1205,11 +1205,11 @@ }, "rapid-router": { "hashes": [ - "sha256:817c9b296af5956eb16289751706ffe6b0282be8b8f13fecd892b2cf6112467a", - "sha256:8841f2b8c9d9be81a42c64a4a2cd3a210ee59b83c041ff5feeabcb2ed4ccb9fb" + "sha256:2b2e285ae908559e179d17de0befb0e0fa47d825a239feeaa313b66025d51aa8", + "sha256:63fbffcddd1f060ecd1d38d496c92224d7bbcfbf323b96cb67b9547096165751" ], "index": "pypi", - "version": "==7.2.0" + "version": "==7.2.2" }, "requests": { "hashes": [ diff --git a/portal/templates/portal/teach/teacher_edit_class.html b/portal/templates/portal/teach/teacher_edit_class.html index c09afe009..19f5a4d13 100644 --- a/portal/templates/portal/teach/teacher_edit_class.html +++ b/portal/templates/portal/teach/teacher_edit_class.html @@ -13,9 +13,14 @@ // Uncheck the checkboxes that correspond to the already-locked levels $(document).ready(function(){ const lockedLevelsIds = {{ locked_levels }}; + const lockedWorksheetIds = {{ locked_worksheet_ids }}; lockedLevelsIds.forEach(function(lockedLevelId) { - const selector = `[value="${lockedLevelId}"]`; + const selector = `[value="level:${lockedLevelId}"]`; + $(selector).click(); + }) + lockedWorksheetIds.forEach(function(lockedWorksheetId) { + const selector = `[value="worksheet:${lockedWorksheetId}"]`; $(selector).click(); }) }) diff --git a/portal/views/teacher/teach.py b/portal/views/teacher/teach.py index 2adf572b3..00ae31f2e 100644 --- a/portal/views/teacher/teach.py +++ b/portal/views/teacher/teach.py @@ -303,6 +303,8 @@ def teacher_edit_class(request, access_code): locked_levels = klass.locked_levels.all() locked_levels_ids = [locked_level.id for locked_level in locked_levels] + locked_worksheet_ids = [worksheet.id for worksheet in klass.locked_worksheets.all()] + form = ClassEditForm( initial={ "name": klass.name, @@ -336,6 +338,7 @@ def teacher_edit_class(request, access_code): "blockly_episodes": blockly_episodes, "python_episodes": python_episodes, "locked_levels": locked_levels_ids, + "locked_worksheet_ids": locked_worksheet_ids, "class": klass, "external_requests_message": external_requests_message, },