Skip to content

SLG User Progress

Ekaterina Bogacheva edited this page Jun 18, 2024 · 14 revisions

User progress updates upon task completion.

Record of completed tasks

SLGUserProgress class handles the progress of a user. This class contains a set of ids of completed tasks (which basically is a progress of a user) and provides methods such as markTaskAsCompleted, updateScore, updateSubtopicScore and updateTopicScore to manipulate the progress.

Score updating mechanism

When you've successfully submitted the task, checkResult method within SLGTaskView triggers an event, which is handled by a model (cause each task's view has a corresponding task object). SLGSubtopic and SLGTopic observe #taskCompleted, verify completion (using methods isCompleted, onSubtopicCompleted and onTopicCompleted), and trigger update of the view if needed.

The check of whether you deserve a score is simply a chain of calls isCompleted method on every level of the hierarchy (as reflected in a domain model).

Clone this wiki locally