Skip to content

Commit 91a3ee9

Browse files
committed
Make checklist checkboxes interactive with localStorage persistence
- Remove 'disabled' attribute from checkboxes - Add 'task-checkbox' class for styling - Add JavaScript to persist checkbox state per page - Add CSS styling for checkboxes with accent color
1 parent 93a53f7 commit 91a3ee9

File tree

8 files changed

+245
-65
lines changed

8 files changed

+245
-65
lines changed

assignments/assignment-1/index.html

Lines changed: 77 additions & 42 deletions
Large diffs are not rendered by default.

assignments/assignment-2/index.html

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
font-size: 0.875rem;
181181
line-height: 1.6;
182182
}
183+
.content .task-checkbox {
184+
width: 1.1em;
185+
height: 1.1em;
186+
margin-right: 0.5em;
187+
cursor: pointer;
188+
accent-color: var(--primary-color);
189+
}
183190
footer {
184191
background: var(--surface-color);
185192
border-top: 1px solid var(--border-color);
@@ -844,16 +851,16 @@ <h3 id="file-naming">File Naming</h3>
844851
<h3 id="pre-submission-checklist">Pre-Submission Checklist</h3>
845852
Before submitting, verify:
846853
<ul>
847-
<li><input type="checkbox" disabled> Notebook runs completely in a fresh Colab instance</li>
848-
<li><input type="checkbox" disabled> All required components are implemented (3+ models, evaluation, error analysis, adversarial testing)</li>
849-
<li><input type="checkbox" disabled> All metrics are reported for all models</li>
850-
<li><input type="checkbox" disabled> At least 20 error cases are analyzed</li>
851-
<li><input type="checkbox" disabled> Markdown documentation is thorough and well-written</li>
852-
<li><input type="checkbox" disabled> Code is clean and readable</li>
853-
<li><input type="checkbox" disabled> Visualizations are clear and professional</li>
854-
<li><input type="checkbox" disabled> Random seeds are set for reproducibility</li>
855-
<li><input type="checkbox" disabled> Citations are included for external resources</li>
856-
<li><input type="checkbox" disabled> File is named correctly</li>
854+
<li><input type="checkbox" class="task-checkbox"> Notebook runs completely in a fresh Colab instance</li>
855+
<li><input type="checkbox" class="task-checkbox"> All required components are implemented (3+ models, evaluation, error analysis, adversarial testing)</li>
856+
<li><input type="checkbox" class="task-checkbox"> All metrics are reported for all models</li>
857+
<li><input type="checkbox" class="task-checkbox"> At least 20 error cases are analyzed</li>
858+
<li><input type="checkbox" class="task-checkbox"> Markdown documentation is thorough and well-written</li>
859+
<li><input type="checkbox" class="task-checkbox"> Code is clean and readable</li>
860+
<li><input type="checkbox" class="task-checkbox"> Visualizations are clear and professional</li>
861+
<li><input type="checkbox" class="task-checkbox"> Random seeds are set for reproducibility</li>
862+
<li><input type="checkbox" class="task-checkbox"> Citations are included for external resources</li>
863+
<li><input type="checkbox" class="task-checkbox"> File is named correctly</li>
857864
</ul>
858865
<h3 id="deadline">Deadline</h3>
859866
<strong>One week from assignment release</strong> (7 calendar days)
@@ -922,6 +929,20 @@ <h2 id="final-notes">Final Notes</h2>
922929
localStorage.setItem('theme', newTheme);
923930
themeIcon.innerHTML = newTheme === 'dark' ? '&#127769;' : '&#9728;';
924931
});
932+
933+
// Checkbox persistence
934+
const pageKey = 'checklist_' + window.location.pathname;
935+
const checkboxes = document.querySelectorAll('.task-checkbox');
936+
const saved = JSON.parse(localStorage.getItem(pageKey) || '{}');
937+
938+
checkboxes.forEach((cb, i) => {
939+
if (saved[i] !== undefined) cb.checked = saved[i];
940+
cb.addEventListener('change', () => {
941+
const state = {};
942+
checkboxes.forEach((c, j) => state[j] = c.checked);
943+
localStorage.setItem(pageKey, JSON.stringify(state));
944+
});
945+
});
925946
</script>
926947
</body>
927948
</html>

assignments/assignment-3/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
font-size: 0.875rem;
181181
line-height: 1.6;
182182
}
183+
.content .task-checkbox {
184+
width: 1.1em;
185+
height: 1.1em;
186+
margin-right: 0.5em;
187+
cursor: pointer;
188+
accent-color: var(--primary-color);
189+
}
183190
footer {
184191
background: var(--surface-color);
185192
border-top: 1px solid var(--border-color);
@@ -1251,6 +1258,20 @@ <h2 id="final-words">Final Words</h2>
12511258
localStorage.setItem('theme', newTheme);
12521259
themeIcon.innerHTML = newTheme === 'dark' ? '&#127769;' : '&#9728;';
12531260
});
1261+
1262+
// Checkbox persistence
1263+
const pageKey = 'checklist_' + window.location.pathname;
1264+
const checkboxes = document.querySelectorAll('.task-checkbox');
1265+
const saved = JSON.parse(localStorage.getItem(pageKey) || '{}');
1266+
1267+
checkboxes.forEach((cb, i) => {
1268+
if (saved[i] !== undefined) cb.checked = saved[i];
1269+
cb.addEventListener('change', () => {
1270+
const state = {};
1271+
checkboxes.forEach((c, j) => state[j] = c.checked);
1272+
localStorage.setItem(pageKey, JSON.stringify(state));
1273+
});
1274+
});
12541275
</script>
12551276
</body>
12561277
</html>

assignments/assignment-4/index.html

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
font-size: 0.875rem;
181181
line-height: 1.6;
182182
}
183+
.content .task-checkbox {
184+
width: 1.1em;
185+
height: 1.1em;
186+
margin-right: 0.5em;
187+
cursor: pointer;
188+
accent-color: var(--primary-color);
189+
}
183190
footer {
184191
background: var(--surface-color);
185192
border-top: 1px solid var(--border-color);
@@ -737,16 +744,16 @@ <h3 id="notebook-requirements">Notebook Requirements</h3>
737744
</ol>
738745
<h3 id="before-submission-checklist">Before Submission Checklist</h3>
739746
<ul>
740-
<li><input type="checkbox" disabled> Notebook runs completely in a fresh Colab session</li>
741-
<li><input type="checkbox" disabled> All required sections are included with markdown explanations</li>
742-
<li><input type="checkbox" disabled> Code is well-commented and organized</li>
743-
<li><input type="checkbox" disabled> Evaluation metrics are properly implemented and visualized</li>
744-
<li><input type="checkbox" disabled> At least 10 diverse examples are included</li>
745-
<li><input type="checkbox" disabled> Multi-turn conversation demo is working</li>
746-
<li><input type="checkbox" disabled> Baseline comparison is complete with statistical analysis</li>
747-
<li><input type="checkbox" disabled> All visualizations are clear and properly labeled</li>
748-
<li><input type="checkbox" disabled> No hardcoded paths (use relative paths or automatic downloads)</li>
749-
<li><input type="checkbox" disabled> Cell outputs are visible and meaningful</li>
747+
<li><input type="checkbox" class="task-checkbox"> Notebook runs completely in a fresh Colab session</li>
748+
<li><input type="checkbox" class="task-checkbox"> All required sections are included with markdown explanations</li>
749+
<li><input type="checkbox" class="task-checkbox"> Code is well-commented and organized</li>
750+
<li><input type="checkbox" class="task-checkbox"> Evaluation metrics are properly implemented and visualized</li>
751+
<li><input type="checkbox" class="task-checkbox"> At least 10 diverse examples are included</li>
752+
<li><input type="checkbox" class="task-checkbox"> Multi-turn conversation demo is working</li>
753+
<li><input type="checkbox" class="task-checkbox"> Baseline comparison is complete with statistical analysis</li>
754+
<li><input type="checkbox" class="task-checkbox"> All visualizations are clear and properly labeled</li>
755+
<li><input type="checkbox" class="task-checkbox"> No hardcoded paths (use relative paths or automatic downloads)</li>
756+
<li><input type="checkbox" class="task-checkbox"> Cell outputs are visible and meaningful</li>
750757
</ul>
751758
<h2 id="academic-integrity">Academic Integrity</h2>
752759
You are encouraged to:
@@ -797,6 +804,20 @@ <h2 id="questions">Questions?</h2>
797804
localStorage.setItem('theme', newTheme);
798805
themeIcon.innerHTML = newTheme === 'dark' ? '&#127769;' : '&#9728;';
799806
});
807+
808+
// Checkbox persistence
809+
const pageKey = 'checklist_' + window.location.pathname;
810+
const checkboxes = document.querySelectorAll('.task-checkbox');
811+
const saved = JSON.parse(localStorage.getItem(pageKey) || '{}');
812+
813+
checkboxes.forEach((cb, i) => {
814+
if (saved[i] !== undefined) cb.checked = saved[i];
815+
cb.addEventListener('change', () => {
816+
const state = {};
817+
checkboxes.forEach((c, j) => state[j] = c.checked);
818+
localStorage.setItem(pageKey, JSON.stringify(state));
819+
});
820+
});
800821
</script>
801822
</body>
802823
</html>

assignments/assignment-5/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
font-size: 0.875rem;
181181
line-height: 1.6;
182182
}
183+
.content .task-checkbox {
184+
width: 1.1em;
185+
height: 1.1em;
186+
margin-right: 0.5em;
187+
cursor: pointer;
188+
accent-color: var(--primary-color);
189+
}
183190
footer {
184191
background: var(--surface-color);
185192
border-top: 1px solid var(--border-color);
@@ -800,6 +807,20 @@ <h2 id="academic-integrity">Academic Integrity</h2>
800807
localStorage.setItem('theme', newTheme);
801808
themeIcon.innerHTML = newTheme === 'dark' ? '&#127769;' : '&#9728;';
802809
});
810+
811+
// Checkbox persistence
812+
const pageKey = 'checklist_' + window.location.pathname;
813+
const checkboxes = document.querySelectorAll('.task-checkbox');
814+
const saved = JSON.parse(localStorage.getItem(pageKey) || '{}');
815+
816+
checkboxes.forEach((cb, i) => {
817+
if (saved[i] !== undefined) cb.checked = saved[i];
818+
cb.addEventListener('change', () => {
819+
const state = {};
820+
checkboxes.forEach((c, j) => state[j] = c.checked);
821+
localStorage.setItem(pageKey, JSON.stringify(state));
822+
});
823+
});
803824
</script>
804825
</body>
805826
</html>

assignments/final-project/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
font-size: 0.875rem;
181181
line-height: 1.6;
182182
}
183+
.content .task-checkbox {
184+
width: 1.1em;
185+
height: 1.1em;
186+
margin-right: 0.5em;
187+
cursor: pointer;
188+
accent-color: var(--primary-color);
189+
}
183190
footer {
184191
background: var(--surface-color);
185192
border-top: 1px solid var(--border-color);
@@ -713,6 +720,20 @@ <h2 id="final-thoughts">Final Thoughts</h2>
713720
localStorage.setItem('theme', newTheme);
714721
themeIcon.innerHTML = newTheme === 'dark' ? '&#127769;' : '&#9728;';
715722
});
723+
724+
// Checkbox persistence
725+
const pageKey = 'checklist_' + window.location.pathname;
726+
const checkboxes = document.querySelectorAll('.task-checkbox');
727+
const saved = JSON.parse(localStorage.getItem(pageKey) || '{}');
728+
729+
checkboxes.forEach((cb, i) => {
730+
if (saved[i] !== undefined) cb.checked = saved[i];
731+
cb.addEventListener('change', () => {
732+
const state = {};
733+
checkboxes.forEach((c, j) => state[j] = c.checked);
734+
localStorage.setItem(pageKey, JSON.stringify(state));
735+
});
736+
});
716737
</script>
717738
</body>
718739
</html>

scripts/build-pages.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,7 @@ def parse_list_item(line):
228228
if checkbox_match:
229229
checked = checkbox_match.group(1).lower() == "x"
230230
content = checkbox_match.group(2)
231-
checkbox_html = (
232-
f'<input type="checkbox" disabled{" checked" if checked else ""}> '
233-
)
231+
checkbox_html = f'<input type="checkbox" class="task-checkbox"{" checked" if checked else ""}> '
234232
return indent, "ul", checkbox_html + content
235233

236234
ordered_match = re.match(r"^(\d+)\.\s+(.+)$", stripped)
@@ -616,6 +614,13 @@ def get_page_template(title, nav_active, content, depth=1):
616614
font-size: 0.875rem;
617615
line-height: 1.6;
618616
}}
617+
.content .task-checkbox {{
618+
width: 1.1em;
619+
height: 1.1em;
620+
margin-right: 0.5em;
621+
cursor: pointer;
622+
accent-color: var(--primary-color);
623+
}}
619624
footer {{
620625
background: var(--surface-color);
621626
border-top: 1px solid var(--border-color);
@@ -675,6 +680,20 @@ def get_page_template(title, nav_active, content, depth=1):
675680
localStorage.setItem('theme', newTheme);
676681
themeIcon.innerHTML = newTheme === 'dark' ? '&#127769;' : '&#9728;';
677682
}});
683+
684+
// Checkbox persistence
685+
const pageKey = 'checklist_' + window.location.pathname;
686+
const checkboxes = document.querySelectorAll('.task-checkbox');
687+
const saved = JSON.parse(localStorage.getItem(pageKey) || '{{}}');
688+
689+
checkboxes.forEach((cb, i) => {{
690+
if (saved[i] !== undefined) cb.checked = saved[i];
691+
cb.addEventListener('change', () => {{
692+
const state = {{}};
693+
checkboxes.forEach((c, j) => state[j] = c.checked);
694+
localStorage.setItem(pageKey, JSON.stringify(state));
695+
}});
696+
}});
678697
</script>
679698
</body>
680699
</html>'''

syllabus/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@
180180
font-size: 0.875rem;
181181
line-height: 1.6;
182182
}
183+
.content .task-checkbox {
184+
width: 1.1em;
185+
height: 1.1em;
186+
margin-right: 0.5em;
187+
cursor: pointer;
188+
accent-color: var(--primary-color);
189+
}
183190
footer {
184191
background: var(--surface-color);
185192
border-top: 1px solid var(--border-color);
@@ -738,6 +745,20 @@ <h3 id="final-exam-period-march-13--17">Final Exam Period (March 13--17)</h3>
738745
localStorage.setItem('theme', newTheme);
739746
themeIcon.innerHTML = newTheme === 'dark' ? '&#127769;' : '&#9728;';
740747
});
748+
749+
// Checkbox persistence
750+
const pageKey = 'checklist_' + window.location.pathname;
751+
const checkboxes = document.querySelectorAll('.task-checkbox');
752+
const saved = JSON.parse(localStorage.getItem(pageKey) || '{}');
753+
754+
checkboxes.forEach((cb, i) => {
755+
if (saved[i] !== undefined) cb.checked = saved[i];
756+
cb.addEventListener('change', () => {
757+
const state = {};
758+
checkboxes.forEach((c, j) => state[j] = c.checked);
759+
localStorage.setItem(pageKey, JSON.stringify(state));
760+
});
761+
});
741762
</script>
742763
</body>
743764
</html>

0 commit comments

Comments
 (0)