codeforlife-portal 8.4.2__py2.py3-none-any.whl → 8.4.4__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cfl_common/setup.py CHANGED
@@ -17,7 +17,7 @@ setup(
17
17
  version=version,
18
18
  include_package_data=True,
19
19
  install_requires=[
20
- "django==4.2.18",
20
+ "django==4.2.20",
21
21
  "django-countries==7.6.1",
22
22
  "django-csp==3.8",
23
23
  "django-import-export==4.2.0",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codeforlife-portal
3
- Version: 8.4.2
3
+ Version: 8.4.4
4
4
  Classifier: Programming Language :: Python
5
5
  Classifier: Programming Language :: Python :: 3.12
6
6
  Classifier: Framework :: Django
@@ -1,5 +1,5 @@
1
1
  cfl_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- cfl_common/setup.py,sha256=T8DMxXoniOYHNZpgks4TvYvAt4lDnZxDHAwVBH-02iM,978
2
+ cfl_common/setup.py,sha256=_jt0eA-njT6AMjkEcpNxTXOlM8vdSjurM29Q0bOWXQI,978
3
3
  cfl_common/common/__init__.py,sha256=XlncBOpKp_gekbKH7Y_i6yu1qy5tJc3Y8sn8cDy-Vgk,48
4
4
  cfl_common/common/app_settings.py,sha256=Bw1DXkZpNIdwUJ-cIOjZnngH5_NbMXC0koW7NgQ0pKY,2495
5
5
  cfl_common/common/apps.py,sha256=49UXZ3bSkFKvIEOL4zM7y1sAhccQJyRtsoOg5XVd_8Y,129
@@ -111,7 +111,7 @@ example_project/portal_test_settings.py,sha256=mTyObCGkZEI0IQSZkqCjb1WZ7ebjQLwui
111
111
  example_project/settings.py,sha256=pHQDI_A_yXV3u1efj689tc-vPI6nBFma4gMMPBzj0aI,5652
112
112
  example_project/urls.py,sha256=FUTzHPlUS1O5kqMHjL5V4L552N2ln7uTDXcw9wjKUto,422
113
113
  example_project/wsgi.py,sha256=U1W6WzZxZaIdYZ5tks7w9fqp5WS5qvn2iThsVcskrWw,829
114
- portal/__init__.py,sha256=Vu2hvtSa_7OgifMH6YJWUWpnqSrh4JTb4Rb2mzFy0vo,22
114
+ portal/__init__.py,sha256=MrwcgcjFD253hhCUb3rvQPGreC9sFiXhfjgsNwRScbM,22
115
115
  portal/admin.py,sha256=RKJizTF6dPJKmGPZw7nZUM0X8jkiTjgyKhLQxtvHJ0I,6148
116
116
  portal/app_settings.py,sha256=DhWLQOwM0zVOXE3O5TNKbMM9K6agfLuCsHOdr1J7xEI,651
117
117
  portal/backends.py,sha256=2Dss6_WoQwPuDzJUF1yEaTQTNG4eUrD12ujJQ5cp5Tc,812
@@ -129,7 +129,7 @@ portal/forms/invite_teacher.py,sha256=jkDNcCfkts4_lXRzhcI3xBam21Zn2yX9wMpMVhDtW1
129
129
  portal/forms/organisation.py,sha256=QcQyd7AiqBmvt4y8uQSQylguUbKOKqo2pjqWIkpWjDg,7433
130
130
  portal/forms/play.py,sha256=j_QYAKb4qyW0uy0VUUG49dmzDLINc3jR6ddK-djrbc4,11523
131
131
  portal/forms/registration.py,sha256=a-TuzikRc0Q-BAYs3rJ3Sz1wmQ1o_rTEtZmWdF7-xss,6008
132
- portal/forms/teach.py,sha256=c0t9XLfQJFd8hDWbnMUGX15Nt_XDXFG2BfwAKizE-Uw,22381
132
+ portal/forms/teach.py,sha256=lQivQ4pXnvJw8nJMSbqtg-Il5RYkw54ZxE5rJuNlFn0,22391
133
133
  portal/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
134
  portal/helpers/captcha.py,sha256=Amwg3HZ9eIh1LGYVYWYruk1ccNj6P3nYP_evufOY8BY,254
135
135
  portal/helpers/decorators.py,sha256=Bs6AVCvcgxfHLdJVWzTmZpxlYbJZXJh5e9AGRXf7cwo,3617
@@ -500,7 +500,7 @@ portal/templates/portal/teach/onboarding_students.html,sha256=09q658n7U7Vuzy_M_0
500
500
  portal/templates/portal/teach/teacher_add_external_student.html,sha256=Lrrh4W3EwxxXKe45kcqzf2BcPxYo_mLahGIQMNJjX9E,2453
501
501
  portal/templates/portal/teach/teacher_added_external_student.html,sha256=f18RhP5PCE13yjBTrQTCwPLZnkcZb0bDUZ_Z2Oh3D3I,1189
502
502
  portal/templates/portal/teach/teacher_dismiss_students.html,sha256=_5FvvtNjdYpZaM9lDzXrhhTjAD3NK_92kDYzh7xqowI,4283
503
- portal/templates/portal/teach/teacher_edit_class.html,sha256=jLnoIcpSdxobVGnUK2POBoM_TuUNckqLo4dOly-VG0w,13369
503
+ portal/templates/portal/teach/teacher_edit_class.html,sha256=rXQ-ygveUym7d1aZv3rXPCuEuElmACJLI4TpvVbGzu8,14495
504
504
  portal/templates/portal/teach/teacher_edit_student.html,sha256=JNF8JyoZh0J-oKH4dz7SGSxR0t7J1lbTGLvjhNbk2Rw,3237
505
505
  portal/templates/portal/teach/teacher_move_all_classes.html,sha256=u9PNJHrKaIXd67vuwhgMmVXumgSnkKH4QKx1bd3O2VY,1780
506
506
  portal/templates/portal/teach/teacher_move_students.html,sha256=toBtjtpiCwvxo2FTJX5oZDzJ9batXdi7ty5AiCHnq4s,1591
@@ -536,7 +536,7 @@ portal/tests/test_2FA.py,sha256=0N4C9Ab3TvO9W__oQLCo-fLDH1Ho3CiGGsSg-2TiZUE,3597
536
536
  portal/tests/test_admin.py,sha256=AM2dgv8j9m4L-SDO-sMA9tQvQH9GwRBrlwRG9OgqtfI,1451
537
537
  portal/tests/test_api.py,sha256=Yo5s_nEGOoG35jA39yZ6nuDOUZvuCZ8o8o8XhZos61w,13819
538
538
  portal/tests/test_captcha_forms.py,sha256=Yn_VYO_6jbq6AeKeLcv-YFL1YwXZpU0C3y7SK8fRUm4,1033
539
- portal/tests/test_class.py,sha256=_P2CEtqH67MM9h6MMQB_PxXFyQj4tZZbN42NJQpIJ7o,18308
539
+ portal/tests/test_class.py,sha256=noXBXFNlV1Z5lryVH4IxMVDfh8Kb3g_GwXlu3GKPwCI,18089
540
540
  portal/tests/test_emails.py,sha256=pLr06j3uMBxP1raoZQWzUTBVFvsEDFtUh85J8OnqCwE,9238
541
541
  portal/tests/test_global_forms.py,sha256=GIm_oSN4VsfaO--E2SMRu8CwVraan0UBj-_LE_tu8w0,833
542
542
  portal/tests/test_helper_methods.py,sha256=-SQCDZm2XUtyXGEp0CHIb_SSC9CPD-XOSnpnY8QclHk,890
@@ -629,13 +629,13 @@ portal/views/student/edit_account_details.py,sha256=Ba-3D_zzKbX5N01NG5qqBS0ud10B
629
629
  portal/views/student/play.py,sha256=GMxk65bxWOe1Ds2kb6rvuOd1GoAtt5v_9AihLNXoUL0,8768
630
630
  portal/views/teacher/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
631
631
  portal/views/teacher/dashboard.py,sha256=Y6OhT7h4hgNZAEDZDJP86F7SjrL8W12t0rpHipSYgSQ,27977
632
- portal/views/teacher/teach.py,sha256=S0I1IQzDK2z1uMK3rfBzW3bKS7ZV3-xbOVZS2Kg_RU0,36836
632
+ portal/views/teacher/teach.py,sha256=IXlvsJ_1pX7oSr2SMWdWWC7aCFDA38IgxAoHzy_HHp4,36850
633
633
  portal/views/two_factor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
634
634
  portal/views/two_factor/core.py,sha256=Lk32z2SN2Pg0rRkK-N-LXMvXC1kKKsH3l692kiSDQ4E,964
635
635
  portal/views/two_factor/form.py,sha256=lnHNKI-BMlpncTuW3zUzjPaJJNuEra2I_nOam0eOKFY,257
636
636
  portal/views/two_factor/profile.py,sha256=SHSg_xHccE5PtD-OfuOkYhREYz_er4bj5ro1RjJ88Yw,393
637
- codeforlife_portal-8.4.2.dist-info/LICENSE.md,sha256=9AbRlCDqD2D1tPibimysFv3zg3AIc49-eyv9aEsyq9w,115
638
- codeforlife_portal-8.4.2.dist-info/METADATA,sha256=M6S_qIEDgS_J2O62FFjOgGsXNgUTs8gBj2xp60jpWBA,3077
639
- codeforlife_portal-8.4.2.dist-info/WHEEL,sha256=WDDPHYzpiOIm6GP1C2_8y8W6q16ICddAgOHlhTje9Qc,109
640
- codeforlife_portal-8.4.2.dist-info/top_level.txt,sha256=8e5pdsuIoTqEAMqpelHBjGjLbffcBtgOoggmd2q7nMw,41
641
- codeforlife_portal-8.4.2.dist-info/RECORD,,
637
+ codeforlife_portal-8.4.4.dist-info/LICENSE.md,sha256=9AbRlCDqD2D1tPibimysFv3zg3AIc49-eyv9aEsyq9w,115
638
+ codeforlife_portal-8.4.4.dist-info/METADATA,sha256=Bcx9awmkGczRxQeEbFFXPhuMYgpgFhM2K8f2p43N96E,3077
639
+ codeforlife_portal-8.4.4.dist-info/WHEEL,sha256=WDDPHYzpiOIm6GP1C2_8y8W6q16ICddAgOHlhTje9Qc,109
640
+ codeforlife_portal-8.4.4.dist-info/top_level.txt,sha256=8e5pdsuIoTqEAMqpelHBjGjLbffcBtgOoggmd2q7nMw,41
641
+ codeforlife_portal-8.4.4.dist-info/RECORD,,
portal/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "8.4.2"
1
+ __version__ = "8.4.4"
portal/forms/teach.py CHANGED
@@ -327,7 +327,7 @@ class ClassLevelControlForm(forms.Form):
327
327
  for worksheet in episode.worksheets.filter(before_level__isnull=True):
328
328
  choices.append((f"worksheet:{worksheet.id}", episode.name))
329
329
 
330
- self.fields[episode.name] = forms.MultipleChoiceField(
330
+ self.fields[f"episode{episode.id}"] = forms.MultipleChoiceField(
331
331
  choices=itertools.chain(choices),
332
332
  widget=forms.CheckboxSelectMultiple(),
333
333
  required=False,
@@ -110,40 +110,43 @@
110
110
  </label>
111
111
  </div>
112
112
  {% for episode in blockly_episodes %}
113
- <div class="panel">
114
- <div class="panel-header bg--{{ episode.difficulty }}" id="episode-{{episode.id}}">
115
- <div class="d-flex align-items-center justify-content-end" data-toggle="collapse"
116
- data-target="#collapse-{{episode.id}}" aria-expanded="false"
117
- aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
118
- <p class="episode-title flex-grow-1">{{episode.name}}</p>
119
- <span>Levels {{episode.first_level}}-{{episode.last_level}}</span>
120
- <div class="episode_range_text collapsed d-flex align-items-center justify-content-end"
121
- data-toggle="collapse" data-target="#collapse-{{episode.id}}"
122
- aria-expanded="false" aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
123
- <label class="mb-0" for="select-all-episode-levels">
124
- <input type="checkbox" value="{{ episode.name }}" id="select-all-blockly-levels-{{ episode.id }}">
125
- </label>
126
- </div>
127
- </div>
128
- </div>
129
-
130
- <div id="collapse-{{episode.id}}" aria-labelledby="episode-{{episode.id}}" class="collapse">
131
- <div class="panel-body d-flex justify-content-between">
132
- <div class="d-flex flex-grow-1 flex-column justify-content-between">
133
- {% for level in episode.levels %}
134
- <p>{{level.name}}: {{level.title.strip | safe}}</p>
135
- {% endfor %}
113
+ {% with episode.id|stringformat:"s" as episode_id %}
114
+ {% with "episode"|add:episode_id as episode_index %}
115
+ <div class="panel">
116
+ <div class="panel-header bg--{{ episode.difficulty }}" id="episode-{{episode.id}}">
117
+ <div class="d-flex align-items-center justify-content-end" data-toggle="collapse"
118
+ data-target="#collapse-{{episode.id}}" aria-expanded="false"
119
+ aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
120
+ <p class="episode-title flex-grow-1">{{episode.name}}</p>
121
+ <span>Levels {{episode.first_level}}-{{episode.last_level}}</span>
122
+ <div class="episode_range_text collapsed d-flex align-items-center justify-content-end"
123
+ data-toggle="collapse" data-target="#collapse-{{episode.id}}"
124
+ aria-expanded="false" aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
125
+ <label class="mb-0" for="select-all-episode-levels">
126
+ <input type="checkbox" value="{{ episode_index }}" id="select-all-blockly-levels-{{ episode.id }}">
127
+ </label>
128
+ </div>
129
+ </div>
136
130
  </div>
137
- <div class="form__checkbox flex-column justify-content-between p-0">
138
- {% for input in level_control_form|get_dict_item:episode.name %}
139
- <div class="form__checkbox-input p-0">
140
- {{ input }}
131
+ <div id="collapse-{{episode.id}}" aria-labelledby="episode-{{episode.id}}" class="collapse">
132
+ <div class="panel-body d-flex justify-content-between">
133
+ <div class="d-flex flex-grow-1 flex-column justify-content-between">
134
+ {% for level in episode.levels %}
135
+ <p>{{level.name}}: {{level.title.strip | safe}}</p>
136
+ {% endfor %}
141
137
  </div>
142
- {% endfor %}
138
+ <div class="form__checkbox flex-column justify-content-between p-0">
139
+ {% for input in level_control_form|get_dict_item:episode_index %}
140
+ <div class="form__checkbox-input p-0">
141
+ {{ input }}
142
+ </div>
143
+ {% endfor %}
144
+ </div>
145
+ </div>
143
146
  </div>
144
147
  </div>
145
- </div>
146
- </div>
148
+ {% endwith %}
149
+ {% endwith %}
147
150
  {% endfor %}
148
151
  <div class="panel-intro d-flex align-items-center justify-content-between">
149
152
  <h6>Python Den levels</h6>
@@ -152,64 +155,67 @@
152
155
  </label>
153
156
  </div>
154
157
  {% for episode in python_episodes %}
155
- <div class="panel">
156
- <div class="panel-header bg--{{ episode.difficulty }}" id="episode-{{episode.id}}">
157
- <div class="d-flex align-items-center justify-content-end" data-toggle="collapse"
158
- data-target="#collapse-{{episode.id}}" aria-expanded="false"
159
- aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
160
- <p class="episode-title flex-grow-1">{{episode.name}}</p>
161
- {% if episode.levels %}
162
- {% if episode.first_level > 1009 %}
163
- <span>Levels {{episode.first_level|stringformat:"i"|slice:"2:4"}}-{{episode.last_level|stringformat:"i"|slice:"2:4"}}</span>
164
- {% else %}
165
- {% if episode.last_level > 1009 %}
166
- <span>Levels {{episode.first_level|stringformat:"i"|slice:"3:4"}}-{{episode.last_level|stringformat:"i"|slice:"2:4"}}</span>
167
- {% else %}
168
- <span>Levels {{episode.first_level|stringformat:"i"|slice:"3:4"}}-{{episode.last_level|stringformat:"i"|slice:"3:4"}}</span>
169
- {% endif %}
170
- {% endif %}
171
- {% endif %}
172
- <div class="episode_range_text collapsed d-flex align-items-center justify-content-end"
173
- data-toggle="collapse" data-target="#collapse-{{episode.id}}"
174
- aria-expanded="false" aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
175
- <label class="mb-0" for="select-all-episode-levels">
176
- <input type="checkbox" value="{{ episode.name }}" id="select-all-python-levels-{{ episode.id }}">
177
- </label>
178
- </div>
179
- </div>
180
- </div>
181
-
182
- <div id="collapse-{{episode.id}}" aria-labelledby="episode-{{episode.id}}" class="collapse">
183
- <div class="panel-body d-flex justify-content-between">
184
- <div class="d-flex flex-grow-1 flex-column justify-content-between">
185
- {% for level in episode.levels %}
186
- {% for worksheet in episode.worksheets %}
187
- {% if worksheet.before_level == level.id %}
188
- <p>{{episode.name}}{% if episode.worksheets|length > 1 %} pt. {{ worksheet.index }}{% endif %}</p>
158
+ {% with episode.id|stringformat:"s" as episode_id %}
159
+ {% with "episode"|add:episode_id as episode_index %}
160
+ <div class="panel">
161
+ <div class="panel-header bg--{{ episode.difficulty }}" id="episode-{{episode.id}}">
162
+ <div class="d-flex align-items-center justify-content-end" data-toggle="collapse"
163
+ data-target="#collapse-{{episode.id}}" aria-expanded="false"
164
+ aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
165
+ <p class="episode-title flex-grow-1">{{episode.name}}</p>
166
+ {% if episode.levels %}
167
+ {% if episode.first_level > 1009 %}
168
+ <span>Levels {{episode.first_level|stringformat:"i"|slice:"2:4"}}-{{episode.last_level|stringformat:"i"|slice:"2:4"}}</span>
169
+ {% else %}
170
+ {% if episode.last_level > 1009 %}
171
+ <span>Levels {{episode.first_level|stringformat:"i"|slice:"3:4"}}-{{episode.last_level|stringformat:"i"|slice:"2:4"}}</span>
172
+ {% else %}
173
+ <span>Levels {{episode.first_level|stringformat:"i"|slice:"3:4"}}-{{episode.last_level|stringformat:"i"|slice:"3:4"}}</span>
174
+ {% endif %}
189
175
  {% endif %}
190
- {% endfor %}
191
- {% if level.name < 1010 %}
192
- <p>{{level.name|stringformat:"i"|slice:"3:4"}}: {{level.title.strip | safe}}</p>
193
- {% else %}
194
- <p>{{level.name|stringformat:"i"|slice:"2:4"}}: {{level.title.strip | safe}}</p>
195
- {% endif %}
196
- {% endfor %}
197
- {% for worksheet in episode.worksheets %}
198
- {% if not worksheet.before_level %}
199
- <p>{{episode.name}}{% if episode.worksheets|length > 1 %} pt. {{ worksheet.index }}{% endif %}</p>
200
176
  {% endif %}
201
- {% endfor %}
177
+ <div class="episode_range_text collapsed d-flex align-items-center justify-content-end"
178
+ data-toggle="collapse" data-target="#collapse-{{episode.id}}"
179
+ aria-expanded="false" aria-controls="collapse-{{episode.id}}" data-parent="#episodes">
180
+ <label class="mb-0" for="select-all-episode-levels">
181
+ <input type="checkbox" value="{{ episode_index }}" id="select-all-python-levels-{{ episode.id }}">
182
+ </label>
183
+ </div>
184
+ </div>
202
185
  </div>
203
- <div class="form__checkbox flex-column justify-content-between p-0">
204
- {% for input in level_control_form|get_dict_item:episode.name %}
205
- <div class="form__checkbox-input p-0">
206
- {{ input }}
186
+ <div id="collapse-{{episode.id}}" aria-labelledby="episode-{{episode.id}}" class="collapse">
187
+ <div class="panel-body d-flex justify-content-between">
188
+ <div class="d-flex flex-grow-1 flex-column justify-content-between">
189
+ {% for level in episode.levels %}
190
+ {% for worksheet in episode.worksheets %}
191
+ {% if worksheet.before_level == level.id %}
192
+ <p>{{episode.name}}{% if episode.worksheets|length > 1 %} pt. {{ worksheet.index }}{% endif %}</p>
193
+ {% endif %}
194
+ {% endfor %}
195
+ {% if level.name < 1010 %}
196
+ <p>{{level.name|stringformat:"i"|slice:"3:4"}}: {{level.title.strip | safe}}</p>
197
+ {% else %}
198
+ <p>{{level.name|stringformat:"i"|slice:"2:4"}}: {{level.title.strip | safe}}</p>
199
+ {% endif %}
200
+ {% endfor %}
201
+ {% for worksheet in episode.worksheets %}
202
+ {% if not worksheet.before_level %}
203
+ <p>{{episode.name}}{% if episode.worksheets|length > 1 %} pt. {{ worksheet.index }}{% endif %}</p>
204
+ {% endif %}
205
+ {% endfor %}
206
+ </div>
207
+ <div class="form__checkbox flex-column justify-content-between p-0">
208
+ {% for input in level_control_form|get_dict_item:episode_index %}
209
+ <div class="form__checkbox-input p-0">
210
+ {{ input }}
211
+ </div>
212
+ {% endfor %}
213
+ </div>
207
214
  </div>
208
- {% endfor %}
209
215
  </div>
210
216
  </div>
211
- </div>
212
- </div>
217
+ {% endwith %}
218
+ {% endwith %}
213
219
  {% endfor %}
214
220
  </div>
215
221
 
@@ -138,7 +138,7 @@ class TestClass(TestCase):
138
138
  url = reverse("teacher_edit_class", kwargs={"access_code": access_code1})
139
139
  # POST request data for locking only the first level
140
140
  data = {
141
- "Getting Started": [
141
+ "episode1": [
142
142
  "level:2",
143
143
  "level:3",
144
144
  "level:4",
@@ -151,7 +151,7 @@ class TestClass(TestCase):
151
151
  "level:11",
152
152
  "level:12",
153
153
  ],
154
- "Shortest Route": [
154
+ "episode2": [
155
155
  "level:13",
156
156
  "level:14",
157
157
  "level:15",
@@ -159,7 +159,7 @@ class TestClass(TestCase):
159
159
  "level:17",
160
160
  "level:18",
161
161
  ],
162
- "Loops and Repetitions": [
162
+ "episode3": [
163
163
  "level:19",
164
164
  "level:20",
165
165
  "level:21",
@@ -171,13 +171,13 @@ class TestClass(TestCase):
171
171
  "level:27",
172
172
  "level:28",
173
173
  ],
174
- "Loops with Conditions": [
174
+ "episode4": [
175
175
  "level:29",
176
176
  "level:30",
177
177
  "level:31",
178
178
  "level:32",
179
179
  ],
180
- "If... Only": [
180
+ "episode5": [
181
181
  "level:33",
182
182
  "level:34",
183
183
  "level:35",
@@ -190,7 +190,7 @@ class TestClass(TestCase):
190
190
  "level:42",
191
191
  "level:43",
192
192
  ],
193
- "Traffic Lights": [
193
+ "episode6": [
194
194
  "level:44",
195
195
  "level:45",
196
196
  "level:46",
@@ -199,7 +199,7 @@ class TestClass(TestCase):
199
199
  "level:49",
200
200
  "level:50",
201
201
  ],
202
- "Limited Blocks": [
202
+ "episode7": [
203
203
  "level:53",
204
204
  "level:78",
205
205
  "level:79",
@@ -211,7 +211,7 @@ class TestClass(TestCase):
211
211
  "level:54",
212
212
  "level:55",
213
213
  ],
214
- "Procedures": [
214
+ "episode8": [
215
215
  # "level:85",
216
216
  # "level:52",
217
217
  # "level:60",
@@ -220,7 +220,7 @@ class TestClass(TestCase):
220
220
  # "level:87",
221
221
  # "level:61",
222
222
  ],
223
- "Blockly Brain Teasers": [
223
+ "episode9": [
224
224
  "level:56",
225
225
  "level:57",
226
226
  "level:58",
@@ -234,7 +234,7 @@ class TestClass(TestCase):
234
234
  "level:112",
235
235
  "level:92",
236
236
  ],
237
- "Introduction to Python": [
237
+ "episode10": [
238
238
  "level:93",
239
239
  "level:63",
240
240
  "level:64",
@@ -248,7 +248,7 @@ class TestClass(TestCase):
248
248
  "level:96",
249
249
  "level:97",
250
250
  ],
251
- "Python": [
251
+ "episode11": [
252
252
  "level:98",
253
253
  "level:70",
254
254
  "level:71",
@@ -291,7 +291,7 @@ class TestClass(TestCase):
291
291
 
292
292
  # Resubmitting to unlock level 1
293
293
  data = {
294
- "Getting Started": [
294
+ "episode1": [
295
295
  "level:1",
296
296
  "level:2",
297
297
  "level:3",
@@ -305,7 +305,7 @@ class TestClass(TestCase):
305
305
  "level:11",
306
306
  "level:12",
307
307
  ],
308
- "Shortest Route": [
308
+ "episode2": [
309
309
  "level:13",
310
310
  "level:14",
311
311
  "level:15",
@@ -313,7 +313,7 @@ class TestClass(TestCase):
313
313
  "level:17",
314
314
  "level:18",
315
315
  ],
316
- "Loops and Repetitions": [
316
+ "episode3": [
317
317
  "level:19",
318
318
  "level:20",
319
319
  "level:21",
@@ -325,13 +325,13 @@ class TestClass(TestCase):
325
325
  "level:27",
326
326
  "level:28",
327
327
  ],
328
- "Loops with Conditions": [
328
+ "episode4": [
329
329
  "level:29",
330
330
  "level:30",
331
331
  "level:31",
332
332
  "level:32",
333
333
  ],
334
- "If... Only": [
334
+ "episode5": [
335
335
  "level:33",
336
336
  "level:34",
337
337
  "level:35",
@@ -344,7 +344,7 @@ class TestClass(TestCase):
344
344
  "level:42",
345
345
  "level:43",
346
346
  ],
347
- "Traffic Lights": [
347
+ "episode6": [
348
348
  "level:44",
349
349
  "level:45",
350
350
  "level:46",
@@ -353,7 +353,7 @@ class TestClass(TestCase):
353
353
  "level:49",
354
354
  "level:50",
355
355
  ],
356
- "Limited Blocks": [
356
+ "episode7": [
357
357
  "level:53",
358
358
  "level:78",
359
359
  "level:79",
@@ -365,7 +365,7 @@ class TestClass(TestCase):
365
365
  "level:54",
366
366
  "level:55",
367
367
  ],
368
- "Procedures": [
368
+ "episode8": [
369
369
  # "level:85",
370
370
  # "level:52",
371
371
  # "level:60",
@@ -374,7 +374,7 @@ class TestClass(TestCase):
374
374
  # "level:87",
375
375
  # "level:61",
376
376
  ],
377
- "Blockly Brain Teasers": [
377
+ "episode9": [
378
378
  "level:56",
379
379
  "level:57",
380
380
  "level:58",
@@ -388,7 +388,7 @@ class TestClass(TestCase):
388
388
  "level:112",
389
389
  "level:92",
390
390
  ],
391
- "Introduction to Python": [
391
+ "episode10": [
392
392
  "level:93",
393
393
  "level:63",
394
394
  "level:64",
@@ -402,7 +402,7 @@ class TestClass(TestCase):
402
402
  "level:96",
403
403
  "level:97",
404
404
  ],
405
- "Python": [
405
+ "episode11": [
406
406
  "level:98",
407
407
  "level:70",
408
408
  "level:71",
@@ -546,12 +546,7 @@ class TestClassFrontend(BaseTest):
546
546
  class_name = "Class!"
547
547
 
548
548
  self.selenium.get(self.live_server_url)
549
- page = (
550
- HomePage(self.selenium)
551
- .go_to_teacher_login_page()
552
- .login_no_class(email, password)
553
- .open_classes_tab()
554
- )
549
+ page = HomePage(self.selenium).go_to_teacher_login_page().login_no_class(email, password).open_classes_tab()
555
550
 
556
551
  page = page.create_class(class_name, False)
557
552
 
@@ -431,18 +431,18 @@ def mark_levels_to_lock_in_episodes(request, episodes, levels_to_lock_ids, locke
431
431
  :param levels_to_lock_ids: A list of Level IDs marked to be locked.
432
432
  """
433
433
  for episode in episodes:
434
- episode_name = episode["name"]
435
434
  episode_levels = episode["levels"]
436
435
  episode_worksheets = episode["worksheets"]
437
- if episode_name in request.POST:
436
+ episode_index = f"episode{episode['id']}"
437
+ if episode_index in request.POST:
438
438
  [
439
439
  levels_to_lock_ids.append(episode_level["id"])
440
440
  for episode_level in episode_levels
441
- if f'level:{episode_level["id"]}' not in request.POST.getlist(episode_name)
441
+ if f'level:{episode_level["id"]}' not in request.POST.getlist(episode_index)
442
442
  ]
443
443
  for episode_worksheet in episode_worksheets:
444
444
  worksheet_id = episode_worksheet["id"]
445
- if f"worksheet:{worksheet_id}" not in request.POST.getlist(episode_name):
445
+ if f"worksheet:{worksheet_id}" not in request.POST.getlist(episode_index):
446
446
  locked_worksheet_ids.append(worksheet_id)
447
447
  else:
448
448
  [levels_to_lock_ids.append(episode_level["id"]) for episode_level in episode_levels]