/
githubmirror
/
oppia
Обзор
Документация
Войти
/
githubmirror
/
oppia
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
core/templates/domain/exploration/chapter-progress-summary.model.ts
71 строка
2 KB
Kartik Suryavanshi
[GSoC 2026] M1.6 - Fix part of #19614: Implement checkpoint-bar for lesson card (#26390)
19 июн 2026, 08:27
Не верифицирован
19 июн 2026, 08:27
026b024
Код
Авторство
О чём код?
// Copyright 2022 The Oppia Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Model for displaying instances of frontend learner group * user progress domain objects. */ export interface ChapterProgressSummaryBackendDict { exploration_id: string; total_checkpoints_count: number; visited_checkpoints_count: number; is_chapter_complete: boolean; } export class ChapterProgressSummary { _explorationId: string; _totalCheckpointsCount: number; _visitedCheckpointsCount: number; _isChapterComplete: boolean; constructor( explorationId: string, totalCheckpointsCount: number, visitedCheckpointsCount: number, isChapterComplete: boolean ) { this._explorationId = explorationId; this._totalCheckpointsCount = totalCheckpointsCount; this._visitedCheckpointsCount = visitedCheckpointsCount; this._isChapterComplete = isChapterComplete; } get explorationId(): string { return this._explorationId; } get totalCheckpoints(): number { return this._totalCheckpointsCount; } get visitedCheckpoints(): number { return this._visitedCheckpointsCount; } get isChapterComplete(): boolean { return this._isChapterComplete; } static createFromBackendDict( chapterProgressSummaryBackendDict: ChapterProgressSummaryBackendDict ): ChapterProgressSummary { return new ChapterProgressSummary( chapterProgressSummaryBackendDict.exploration_id, chapterProgressSummaryBackendDict.total_checkpoints_count, chapterProgressSummaryBackendDict.visited_checkpoints_count, chapterProgressSummaryBackendDict.is_chapter_complete ); } }