Skip to content

Commit 8ade85e

Browse files
committed
Refactor module examples and add education quality audit
1 parent 7afd928 commit 8ade85e

126 files changed

Lines changed: 1003 additions & 624 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,18 @@ Run language lint checks with:
6060
- `./scripts/lint.ps1` (PowerShell)
6161
- `bash ./scripts/lint.sh` (Bash)
6262

63+
Run the non-blocking education quality audit with:
64+
65+
- `./scripts/audit-education-quality.ps1` (PowerShell)
66+
- `bash ./scripts/audit-education-quality.sh` (Bash)
67+
6368
These smoke checks also compile standalone C# exercises by generating temporary validation projects during the check.
6469
TypeScript checks restore Node dependencies from `package-lock.json`, compile with `tsc`, and execute the emitted JavaScript with `node`.
6570

6671
The public PowerShell and Bash scripts are thin wrappers over the shared Python automation core in `scripts/automation.py`. Curriculum validation and smoke target metadata live in `scripts/automation_manifest.json`.
6772

73+
Use [EDUCATIONAL_EXAMPLE_REVIEW_RUBRIC.md](EDUCATIONAL_EXAMPLE_REVIEW_RUBRIC.md) when reviewing `example/main.*` files for teaching clarity and parity.
74+
6875
4. Update related README files when behavior or structure changes.
6976
5. Open a pull request with a clear description of what changed and why.
7077

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Educational Example Review Rubric
2+
3+
Use this rubric when reviewing module entry examples under `languages/*/*/*/example/main.*`.
4+
5+
## Purpose
6+
7+
Keep examples easy to learn from while preserving technical correctness and cross-language parity.
8+
9+
## Review Checklist
10+
11+
- The file starts with a module-specific header comment that states the concept and why it matters.
12+
- Comments are intent-first and appear before non-trivial logic blocks (validation, transformation, branching, output checks).
13+
- The example follows one deterministic scenario so learners can rerun and compare outcomes.
14+
- Output is explained in comments so learners can connect printed values to the code path.
15+
- Language-specific adaptation notes are present only when concept mapping differs from C++ semantics.
16+
- Naming and flow emphasize readability over cleverness.
17+
- The example still matches the module topic and does not drift into unrelated concepts.
18+
19+
## Suggested Scoring
20+
21+
Score each category from 0 to 2.
22+
23+
- `Concept Framing`: clear concept + why it matters.
24+
- `Narration Quality`: comments guide reasoning, not syntax.
25+
- `Scenario Determinism`: same inputs lead to predictable learning output.
26+
- `Output Explainability`: printed values are explained and verifiable.
27+
- `Parity Discipline`: cross-language concept intent is preserved.
28+
29+
Interpretation:
30+
31+
- `9-10`: ready
32+
- `7-8`: acceptable with minor polish
33+
- `5-6`: needs focused revision
34+
- `<5`: rewrite required before merge
35+
36+
## Tooling Support
37+
38+
Run the non-blocking audit report:
39+
40+
```bash
41+
python scripts/automation.py audit-education-quality
42+
```
43+
44+
Generated reports:
45+
46+
- `build/reports/education-quality-report.md`
47+
- `build/reports/education-quality-report.json`

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Run checks locally:
155155
./scripts/check-readme-structure.ps1
156156
./scripts/check-module-completeness.ps1
157157
./scripts/check-checkpoint-completeness.ps1
158+
./scripts/audit-education-quality.ps1
158159
./scripts/lint.ps1
159160
./scripts/smoke-languages.ps1
160161
./scripts/build-all.ps1
@@ -166,6 +167,7 @@ bash ./scripts/check-links.sh
166167
bash ./scripts/check-readme-structure.sh
167168
bash ./scripts/check-module-completeness.sh
168169
bash ./scripts/check-checkpoint-completeness.sh
170+
bash ./scripts/audit-education-quality.sh
169171
bash ./scripts/lint.sh
170172
bash ./scripts/smoke-languages.sh
171173
bash ./scripts/build-all.sh
@@ -178,6 +180,8 @@ The public PowerShell and Bash scripts remain the supported entrypoints, but the
178180

179181
The multi-language smoke scripts also compile standalone C# exercises by generating temporary validation projects during the check and compile TypeScript programs before executing their smoke targets.
180182

183+
Use [EDUCATIONAL_EXAMPLE_REVIEW_RUBRIC.md](EDUCATIONAL_EXAMPLE_REVIEW_RUBRIC.md) to keep entry examples pedagogically consistent during reviews. The education audit command is advisory and writes markdown/json findings without failing CI.
184+
181185
Documentation sync also validates that [CONCEPT_INDEX.md](CONCEPT_INDEX.md) covers every implemented module and checkpoint path listed in the automation manifest.
182186

183187
## Contributing

languages/cpp/01-foundations/arrays-and-vectors/example/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// This example shows storing related values in ordered collections and iterating safely.
2-
// In C++, the example keeps value flow, references, and explicit control visible.
1+
// Module focus: Storing related values in ordered collections and iterating safely.
2+
// Why it matters: practicing arrays and vectors patterns makes exercises and checkpoints easier to
3+
// reason about.
34

45
#include <iostream>
56
#include <vector>
67
using namespace std;
78

8-
// Run one deterministic scenario so the console output makes storing related values in ordered
9-
// collections and iterating safely easy to verify.
9+
// Walk through one fixed scenario so arrays and vectors behavior stays repeatable.
1010
int main() {
11-
// Build the sample state first, then let the later output confirm the behavior step by step.
11+
// Prepare sample inputs that exercise the key arrays and vectors path.
1212
const int fixedScores[3] = {72, 88, 95};
1313

14-
// Print the observed state here so learners can connect the code path to a concrete result.
14+
// Report values so learners can verify the arrays and vectors outcome.
1515
cout << "Fixed array values: ";
1616
for (int i = 0; i < 3; ++i) {
1717
cout << fixedScores[i];

languages/cpp/01-foundations/control-flow/example/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// This example shows choosing between branches and repeating work with predictable control flow.
2-
// In C++, the example keeps value flow, references, and explicit control visible.
1+
// Module focus: Choosing between branches and repeating work with predictable control flow.
2+
// Why it matters: practicing control flow patterns makes exercises and checkpoints easier to reason
3+
// about.
34

45
#include <iostream>
56
using namespace std;
67

7-
// Run one deterministic scenario so the console output makes choosing between branches and
8-
// repeating work with predictable control flow easy to verify.
8+
// Walk through one fixed scenario so control flow behavior stays repeatable.
99
int main() {
10-
// Build the sample state first, then let the later output confirm the behavior step by step.
10+
// Prepare sample inputs that exercise the key control flow path.
1111
int value = 0;
12-
// Print the observed state here so learners can connect the code path to a concrete result.
12+
// Report values so learners can verify the control flow outcome.
1313
cout << "Enter an integer: ";
1414
cin >> value;
1515

languages/cpp/01-foundations/formatted-output-and-iomanip/example/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
// This example shows formatting values so output is easier to read and compare.
2-
// In C++, the example keeps value flow, references, and explicit control visible.
1+
// Module focus: Formatting values so output is easier to read and compare.
2+
// Why it matters: practicing formatted output and iomanip patterns makes exercises and checkpoints
3+
// easier to reason about.
34

45
#include <iomanip>
56
#include <iostream>
67
using namespace std;
78

8-
// Run one deterministic scenario so the console output makes formatting values so output is easier
9-
// to read and compare easy to verify.
9+
// Walk through one fixed scenario so formatted output and iomanip behavior stays repeatable.
1010
int main() {
11-
// Build the sample state first, then let the later output confirm the behavior step by step.
11+
// Prepare sample inputs that exercise the key formatted output and iomanip path.
1212
const char* item1 = "Notebook";
1313
const char* item2 = "Pen";
1414
const char* item3 = "Backpack";
@@ -17,7 +17,7 @@ int main() {
1717
const double p2 = 1.2;
1818
const double p3 = 30.0;
1919

20-
// Print the observed state here so learners can connect the code path to a concrete result.
20+
// Report values so learners can verify the formatted output and iomanip outcome.
2121
cout << left << setw(12) << "Item" << right << setw(10) << "Price" << '\n';
2222
cout << "----------------------\n";
2323

languages/cpp/01-foundations/functions/example/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// This example shows breaking behavior into reusable functions with clear inputs and outputs.
2-
// In C++, the example keeps value flow, references, and explicit control visible.
1+
// Module focus: Breaking behavior into reusable functions with clear inputs and outputs.
2+
// Why it matters: practicing functions patterns makes exercises and checkpoints easier to reason
3+
// about.
34

45
#include <iostream>
56
#include <vector>
67
using namespace std;
78

8-
// Define the reusable pieces first so the main flow can focus on one observable scenario.
9+
// Helper setup for functions; this keeps the walkthrough readable.
910
int sum(int a, int b) { return a + b; }
1011

1112
void swapByReference(int& left, int& right) {
@@ -35,11 +36,10 @@ void incrementByReference(int& number) {
3536
cout << "Inside incrementByReference: " << number << '\n';
3637
}
3738

38-
// Run one deterministic scenario so the console output makes breaking behavior into reusable
39-
// functions with clear inputs and outputs easy to verify.
39+
// Walk through one fixed scenario so functions behavior stays repeatable.
4040
int main() {
41-
// Build the sample state first, then let the later output confirm the behavior step by step.
42-
// Print the observed state here so learners can connect the code path to a concrete result.
41+
// Prepare sample inputs that exercise the key functions path.
42+
// Report values so learners can verify the functions outcome.
4343
cout << "sum(4, 6) = " << sum(4, 6) << '\n';
4444

4545
int first = 10;

languages/cpp/01-foundations/operators-and-expressions/example/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// This example shows combining values through expressions and readable calculations.
2-
// In C++, the example keeps value flow, references, and explicit control visible.
1+
// Module focus: Combining values through expressions and readable calculations.
2+
// Why it matters: practicing operators and expressions patterns makes exercises and checkpoints
3+
// easier to reason about.
34

45
#include <iostream>
56
using namespace std;
67

7-
// Run one deterministic scenario so the console output makes combining values through expressions
8-
// and readable calculations easy to verify.
8+
// Walk through one fixed scenario so operators and expressions behavior stays repeatable.
99
int main() {
10-
// Build the sample state first, then let the later output confirm the behavior step by step.
10+
// Prepare sample inputs that exercise the key operators and expressions path.
1111
const int a = 17;
1212
const int b = 5;
1313

14-
// Print the observed state here so learners can connect the code path to a concrete result.
14+
// Report values so learners can verify the operators and expressions outcome.
1515
cout << "a = " << a << ", b = " << b << "\n\n";
1616
cout << "a + b = " << (a + b) << '\n';
1717
cout << "a - b = " << (a - b) << '\n';

languages/cpp/01-foundations/scope-and-lifetime-basics/example/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// This example shows how names stay visible only inside the blocks that own them.
2-
// In C++, the example keeps value flow, references, and explicit control visible.
1+
// Module focus: How names stay visible only inside the blocks that own them.
2+
// Why it matters: practicing scope and lifetime basics patterns makes exercises and checkpoints
3+
// easier to reason about.
34

45
#include <iostream>
56
using namespace std;
67

7-
// Define the reusable pieces first so the main flow can focus on one observable scenario.
8+
// Helper setup for scope and lifetime basics; this keeps the walkthrough readable.
89
void printRangeSum(int from, int to) {
910
int sum = 0;
1011
for (int value = from; value <= to; ++value) {
@@ -13,12 +14,11 @@ void printRangeSum(int from, int to) {
1314
cout << "Sum from " << from << " to " << to << " = " << sum << '\n';
1415
}
1516

16-
// Run one deterministic scenario so the console output makes how names stay visible only inside the
17-
// blocks that own them easy to verify.
17+
// Walk through one fixed scenario so scope and lifetime basics behavior stays repeatable.
1818
int main() {
19-
// Build the sample state first, then let the later output confirm the behavior step by step.
19+
// Prepare sample inputs that exercise the key scope and lifetime basics path.
2020
int value = 10;
21-
// Print the observed state here so learners can connect the code path to a concrete result.
21+
// Report values so learners can verify the scope and lifetime basics outcome.
2222
cout << "Outer value: " << value << '\n';
2323

2424
{

languages/cpp/01-foundations/strings/example/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
// This example shows cleaning and combining text while preserving readable string logic.
2-
// In C++, the example keeps value flow, references, and explicit control visible.
1+
// Module focus: Cleaning and combining text while preserving readable string logic.
2+
// Why it matters: practicing strings patterns makes exercises and checkpoints easier to reason
3+
// about.
34

45
#include <cctype>
56
#include <iostream>
67
#include <limits>
78
#include <string>
89
using namespace std;
910

10-
// Run one deterministic scenario so the console output makes cleaning and combining text while
11-
// preserving readable string logic easy to verify.
11+
// Walk through one fixed scenario so strings behavior stays repeatable.
1212
int main() {
13-
// Build the sample state first, then let the later output confirm the behavior step by step.
13+
// Prepare sample inputs that exercise the key strings path.
1414
int year = 0;
1515
string fullName;
1616
string sentence;
1717

18-
// Print the observed state here so learners can connect the code path to a concrete result.
18+
// Report values so learners can verify the strings outcome.
1919
cout << "Enter your birth year: ";
2020
cin >> year;
2121

0 commit comments

Comments
 (0)