Skip to content
JournalTORIS / FIELD NOTES

← Blog Project notes

One Cover Page Shook the Numbering: When I Loaded Too Much Meaning into index

Computing lesson numbers and quiz numbers that exclude the cover in an education viewer, and the standard for separating array position from the number shown to users.

2 min read Read the Korean original

Joohwan Yu · Founder, Full Stack Developer

Toris · Published

Contents

Adding a cover looked like the job of dropping in one more screen. But in the education viewer, the cover must not count toward the lesson number, and quizzes needed a number separate from their original array position. Everywhere the existing index was used as is, I had to recheck what it meant.

A Wrong Number Means a Rule Was Hidden

An array position is decided mechanically. The number shown to users is decided by a product rule. Depending on whether you count every scene, skip the cover, or count only quizzes, the same scene gets a different number. If you scatter this rule through rendering as things like index - coverCount, it becomes hard to trace the impact when earlier scenes change.

At the time, I weighed keeping the original index while creating a separate quizIndex and showing numbers that exclude the cover. Looking back, not overwriting the original value was what mattered. If you change the array position itself to fix the on-screen number, content lookup and navigation logic are affected.

Compute Once and Tell Them Apart by Name

If I did it again now, I would gather the numbering rule in the step that builds a display model from the scene list. Below is pseudo-data that illustrates that direction.

type SceneView = {
  sceneId: string;
  sourceIndex: number;
  learningNumber: number | null;
  quizNumber: number | null;
};

A cover that has no number can be expressed as null. You avoid giving the number 0 the extra meaning of “none because it’s a cover.” This way the button panel can use the display info it is handed instead of recalculating the cover count.

The Condition Check Did Not End at the First Item

Looking only at the first item when judging the content type was a similar problem. If one scene can hold several contents, you first have to decide whether the condition is about the whole list or about a specific item. Choosing between some and every is not a syntax matter but a question of whether the requirement is “at least one” or “all.”

This small numbering job showed me the value of data transformation. Rather than making screen components interpret the rule every time, computing the meaning in one place and giving it a name held up better against change. Next time, I will first check the numbering with a material that has no cover and one that has consecutive covers side by side.

Related record: Education Content State Boundaries Retrospective

Advertisement