Thanks @FPtje, that’s a good chain of questions to stimulate a more disciplined and requirements-oriented outcome. (But I’d have to challenge your “can often be directly translated to code”: stakeholders are like the blindfolded people each trying to make sense of a different part of an elephant – they have only a vague idea how the bits connect together.)
Also I hope teachers emphasise the separation-of-duties between stating requirements vs the data model vs the program code. Ideally even when there’s staff equally competent in each discipline, assign different people to each role on a given project, to force each to make explicit their assumptions/guesses and avoid ‘tunnel thinking’. I really don’t like sweeping it all under the responsibility of ‘programmers’.
- I think we don’t have to probe too deeply into
lesson
: it’s atomic for our purposes; it has aname
. We want to give it a number for human-understandable purposes – see below. - I’m going to avoid the term “section” because that’s too vague; and seems to be used to mean different things. (I’m also puzzled why the very first
"Getting started"
section has"reset_lesson_position": false
. Doesn’t the very first (thing) want to say it’s a start point?) -
lesson
s appear in sequences, I guess/and from my experience in education because knowledge-gain works by building on earlier knowledge.
What seems to be going on (again I’m guessing/this needs confirming with stakeholders) is that some sequences-of-lessons build on earlier sequences-of-lessons. Whereas once the student has built up a sufficient foundation, later sequences-of-lessons can be taken in any relative ordering. This is known in education as ‘prerequisites’. Critically, it’s an attribute of a later sequence-of-lessons to point backwards to its prerequisite sequence(s)-of-lesson(s).
Now there would be a challenge to sift out imperative/sequential vs (lazy) functional approaches! At least validate the JSON to make sure the prerequisite(s) for a sequence-of-lessons does appear earlier in the file.
- In the example JSON, I imagine once the learner gets past “Basic operator”, they can opt to go on to either the “Mutability; Immutability” sequence-of-lessons, or the (making something up) “Function definition” sequence-of-lessons without either being a prerequisite.
I agree (but as you say we’re supposing/guessing). It’s for human readers of a coursebook to navigate/customise their learning. The JSON (if we take that as a database) knows perfectly well how to navigate a sequential file/it doesn’t need no numbering.
Yesss! Now we’re getting a decent programming challenge: output the TOC with page numbers at the start of the display, having by then numbered the lessons-within-sequence and each sequence-of-lessons.
Do we need something meeting the purpose of the reset_lesson_position
flag? I’d say:
- for an advanced design challenge: no. Number afresh if the
prerequisite
(s) for this sequence-of-lessons does not include the immediately preceding sequence-of-lessons.
or there’s a later sequence-of-lessons that branches off from somewhere earlier, jumping over me. [**] - for a newbie to FP: yes. There’s to be an extra layer of grouping in the JSON: outer-group
"Basics"
is to include inner-groups"Getting started", "Basic operator"
. Next outer-group"Advanced topics"
(with prerequisite"Basics"
) has a single inner-group"Mutating"
, with a single sequence-of-lessons (2 of). (And we need some more data in the example to help see how this structure works.)
[**] Hmm I’m not explaining that very well. An example would help: "Function definition"
branches off from prerequisite "Basics"
, jumping over the “Mutability; Immutability” lessons.