feat: aktualisiere Übungsanzeige, um synthetische Kapitel-MCs auszuschließen
All checks were successful
Deploy to production / deploy (push) Successful in 2m6s
All checks were successful
Deploy to production / deploy (push) Successful in 2m6s
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
class="tab-button"
|
class="tab-button"
|
||||||
>
|
>
|
||||||
{{ $t('socialnetwork.vocab.courses.exercises') }}
|
{{ $t('socialnetwork.vocab.courses.exercises') }}
|
||||||
<span v-if="hasExercises" class="exercise-count">({{ effectiveExercises?.length || 0 }})</span>
|
<span v-if="hasExercises" class="exercise-count">({{ displayExercises?.length || 0 }})</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="lesson-meta-item">
|
<div class="lesson-meta-item">
|
||||||
<span class="lesson-meta-label">{{ $t('socialnetwork.vocab.courses.exerciseLoad') }}</span>
|
<span class="lesson-meta-label">{{ $t('socialnetwork.vocab.courses.exerciseLoad') }}</span>
|
||||||
<strong>{{ effectiveExercises?.length || 0 }} {{ $t('socialnetwork.vocab.courses.exercisesShort') }}</strong>
|
<strong>{{ displayExercises?.length || 0 }} {{ $t('socialnetwork.vocab.courses.exercisesShort') }}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -557,7 +557,7 @@
|
|||||||
<div class="exercise-flow-header__stats">
|
<div class="exercise-flow-header__stats">
|
||||||
<div class="exercise-flow-stat">
|
<div class="exercise-flow-stat">
|
||||||
<span>{{ $t('socialnetwork.vocab.courses.exerciseProgressLabel') }}</span>
|
<span>{{ $t('socialnetwork.vocab.courses.exerciseProgressLabel') }}</span>
|
||||||
<strong>{{ exerciseCorrectCount }}/{{ effectiveExercises.length }}</strong>
|
<strong>{{ exerciseCorrectCount }}/{{ displayExercises.length }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="exercise-flow-stat">
|
<div class="exercise-flow-stat">
|
||||||
<span>{{ $t('socialnetwork.vocab.courses.successRate') }}</span>
|
<span>{{ $t('socialnetwork.vocab.courses.successRate') }}</span>
|
||||||
@@ -1367,15 +1367,30 @@ export default {
|
|||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
|
// Visible exercises for UI counts: exclude synthetic chapter MCs (ids starting with 'syn-')
|
||||||
|
displayExercises() {
|
||||||
|
try {
|
||||||
|
const raw = this.effectiveExercises || [];
|
||||||
|
return raw.filter((e) => {
|
||||||
|
try {
|
||||||
|
return !(typeof e.id === 'string' && e.id.startsWith('syn-'));
|
||||||
|
} catch (err) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
return this.effectiveExercises || [];
|
||||||
|
}
|
||||||
|
},
|
||||||
exerciseCorrectCount() {
|
exerciseCorrectCount() {
|
||||||
return this.effectiveExercises.filter((exercise) => Boolean(this.exerciseResults[exercise.id]?.correct)).length;
|
return this.displayExercises.filter((exercise) => Boolean(this.exerciseResults[exercise.id]?.correct)).length;
|
||||||
},
|
},
|
||||||
exerciseAnsweredCount() {
|
exerciseAnsweredCount() {
|
||||||
return this.effectiveExercises.filter((exercise) => Boolean(this.exerciseResults[exercise.id])).length;
|
return this.displayExercises.filter((exercise) => Boolean(this.exerciseResults[exercise.id])).length;
|
||||||
},
|
},
|
||||||
exerciseProgressPercent() {
|
exerciseProgressPercent() {
|
||||||
if (!this.effectiveExercises.length) return 0;
|
if (!this.displayExercises.length) return 0;
|
||||||
return Math.round((this.exerciseCorrectCount / this.effectiveExercises.length) * 100);
|
return Math.round((this.exerciseCorrectCount / this.displayExercises.length) * 100);
|
||||||
},
|
},
|
||||||
exerciseTargetScore() {
|
exerciseTargetScore() {
|
||||||
return Number(this.lesson?.targetScorePercent) || 80;
|
return Number(this.lesson?.targetScorePercent) || 80;
|
||||||
|
|||||||
Reference in New Issue
Block a user