Update js/logic/logic.js
Browse files- js/logic/logic.js +16 -21
js/logic/logic.js
CHANGED
|
@@ -179,27 +179,22 @@ class LearningLogic {
|
|
| 179 |
}
|
| 180 |
|
| 181 |
completeLesson(day, duration, interactions = 0) {
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
reward: reward,
|
| 199 |
-
feedback: feedback,
|
| 200 |
-
completed: true
|
| 201 |
-
};
|
| 202 |
-
}
|
| 203 |
|
| 204 |
updateUserProgress(updates) {
|
| 205 |
const previousScore = this.userProgress.totalScore;
|
|
|
|
| 179 |
}
|
| 180 |
|
| 181 |
completeLesson(day, duration, interactions = 0) {
|
| 182 |
+
// این متد از قبل وجود دارد - فقط اطمینان از صحت
|
| 183 |
+
const reward = this.rewardSystem.calculateLessonReward(duration, interactions);
|
| 184 |
+
|
| 185 |
+
this.updateUserProgress({
|
| 186 |
+
score: reward,
|
| 187 |
+
completedLesson: day,
|
| 188 |
+
lessonDuration: duration,
|
| 189 |
+
interactions: interactions
|
| 190 |
+
});
|
| 191 |
+
|
| 192 |
+
return {
|
| 193 |
+
reward: reward,
|
| 194 |
+
feedback: this.rewardSystem.getRewardFeedback(reward, 20, 'lesson'),
|
| 195 |
+
completed: true
|
| 196 |
+
};
|
| 197 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
updateUserProgress(updates) {
|
| 200 |
const previousScore = this.userProgress.totalScore;
|