Skip to content

Implement table-driven F.O.S. lesson completion - #28

Merged
reiserFSs merged 2 commits into
reiserFSs:masterfrom
ToumanLin:codex/fos-course-completion
Sep 12, 2026
Merged

reiserFSs merged 2 commits into
reiserFSs:masterfrom
ToumanLin:codex/fos-course-completion

Conversation

@ToumanLin

@ToumanLin ToumanLin commented Sep 11, 2026

Copy link
Copy Markdown

Problem

F.O.S. lessons and assessments can be entered and played, but valid lesson-result submissions are rejected because the server has no supported lesson chapter-clear rule. This prevents progress from being persisted and can leave later assessments and rewards unavailable.

Summary

  • Resolve submitted lessons from the authoritative course-stage table.
  • Persist accepted lesson stage results and mark a lesson clear once every configured stage has a saved record.
  • Keep lesson completion distinct from maximum points/full-star completion.
  • Preserve the configured ClearPoint threshold for exams.
  • Preserve existing pending/saved result, downgrade, reward, retry, and BSON persistence behavior.
  • Add C1/C2 coverage, including a partial-star final C2 stage.

Evidence and data sources

A controlled check on the official 4.7.0 server confirmed that a lesson chapter becomes clear when its configured stages are complete even when the final Vol is not full-star. This establishes that lesson chapter clear is distinct from full-star/max-point completion.

The authoritative CourseChapter table identifies lessons with StageType=1 and lists their stage IDs; lesson rows have no ClearPoint. Exams use StageType=2 and ClearPoint=9. The inspected course schemas contain no FinishCondition field. The 4.7.0 client consumes the server's chapter IsClear flag while calculating stage-record completion and full-star completion separately.

No captured response, stage-specific value, or player state is used by production code. Captured/observed transitions are test oracles only.

Testing

  • dotnet build AscNet/AscNet.csproj
  • dotnet run --project AscNet.Test/AscNet.Test.csproj -- --course-only

@reiserFSs

Copy link
Copy Markdown
Owner

Reviewed against 67b9b1ec794540da4a805f9b5deb2a0adca54b7f. Hold pending confirmation of the lesson-completion rule.

The project builds, --course-only passes, and GitHub reports a clean merge. No published CI checks were reported.

The actual runtime change in CourseModule.cs:44-53 treats every lesson chapter as having a completion rule and sets it clear once all configured stage IDs have saved records. It does not read the configured lesson FinishCondition/score threshold described in the PR body; those fields are not present in the inspected CourseStage schema.

The client consumes the server's chapter IsClear flag. Its stage-record presence checks and distinction between completion and maximum points do not independently establish the proposed chapter-completion formula. The added C1/C2 tests exercise the chosen formula using full-star results, rather than providing an independent oracle for it.

Please provide authoritative source or a controlled retail transition establishing the rule, and align the description/tests with that evidence. Alternatively, this needs explicit maintainer approval as a documented local policy rather than a claim of established parity.

To be clear: I have not established that a zero-star result must be rejected or that lessons require full stars. The blocker is the missing authority for the formerly unsupported chapter-clear rule, not a proven score-threshold defect. No changes were pushed during review.

@ToumanLin

Copy link
Copy Markdown
Author

Thanks — your review is correct. The original PR description overstated the available table data: the inspected course schemas do not contain a FinishCondition, and lesson rows do not define a score threshold. I have removed that claim from the intended description.

I also performed a controlled check against the official 4.7.0 server:

  • All configured Vols in a lesson were completed.
  • At least one optional star was deliberately left unearned.
  • The client still showed the lesson chapter as clear.

This confirms that lesson chapter completion does not require full stars or the maximum lesson-point total.

That retail observation is consistent with the authoritative tables and client behavior:

  • Lesson chapters are identified by StageType=1 and their configured StageIds; they have no ClearPoint.
  • Exams use StageType=2 and the configured ClearPoint=9.
  • The client considers a stage complete when its saved stage record exists.
  • Chapter IsClear is consumed from the server, while full-star completion is calculated separately.

I pushed follow-up commit 5c811a780786b438e362793fe984c6f12b35c407. The C2 test now saves the final lesson stage with only one star, verifies that its total remains below the full-star maximum, and verifies that IsClear becomes true only after all configured stage records exist.

Validation after the update:

  • dotnet build AscNet/AscNet.csproj
  • dotnet run --project AscNet.Test/AscNet.Test.csproj -- --course-only

Both pass. Production code remains table-driven and does not use captured response values or player-state fixtures.

@reiserFSs
reiserFSs merged commit e8a63f9 into reiserFSs:master Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants