Mhdeusi commited on
Commit
839f9ea
·
verified ·
1 Parent(s): a3b3b89

Update js/logic/logic.js

Browse files
Files changed (1) hide show
  1. 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
- const reward = this.rewardSystem.calculateLessonReward(duration, interactions);
183
-
184
- this.updateUserProgress({
185
- score: reward,
186
- completedLesson: day,
187
- lessonDuration: duration,
188
- interactions: interactions
189
- });
190
-
191
- const feedback = this.rewardSystem.getRewardFeedback(
192
- reward,
193
- 20,
194
- 'lesson'
195
- );
196
-
197
- return {
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;