Skip to content

Commit

Permalink
QuizSummaryPage - remove unnecessary quiz property, fix errors due to it
Browse files Browse the repository at this point in the history
  • Loading branch information
nucleogenesis committed Dec 11, 2024
1 parent 4aa277c commit fce634d
Showing 1 changed file with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</KGrid>
<ManageExamModals
:currentAction="currentAction"
:quiz="quiz"
:quiz="exam"
@submit_delete="handleSubmitDelete"
@submit_copy="handleSubmitCopy"
@cancel="closeModal"
Expand All @@ -100,7 +100,6 @@
import ExamResource from 'kolibri-common/apiResources/ExamResource';
import { enhancedQuizManagementStrings } from 'kolibri-common/strings/enhancedQuizManagementStrings';
import useSnackbar from 'kolibri/composables/useSnackbar';
import { PageNames } from '../../../constants';
import { QUIZZES_TABS_ID, QuizzesTabs } from '../../../constants/tabsConstants';
import { useCoachTabs } from '../../../composables/useCoachTabs';
Expand Down Expand Up @@ -148,19 +147,11 @@
},
data() {
return {
quiz: {
active: false,
assignments: [],
learners_see_fixed_order: false,
question_sources: [],
title: '',
},
loading: true,
currentAction: '',
QUIZZES_TABS_ID,
QuizzesTabs,
difficultQuestions: [],
PageNames,
};
},
computed: {
Expand Down Expand Up @@ -208,7 +199,7 @@
tabsList.forEach(tab => {
tab.to = this.classRoute(
this.group ? PageNames.GROUP_EXAM_SUMMARY : PageNames.EXAM_SUMMARY,
this.group ? this.PageNames.GROUP_EXAM_SUMMARY : this.PageNames.EXAM_SUMMARY,
{ tabId: tab.id },
);
});
Expand Down Expand Up @@ -260,8 +251,7 @@
methods: {
// @public
setData(data) {
const { exam, difficultQuestions } = data;
this.quiz = exam;
const { difficultQuestions } = data;
this.difficultQuestions = difficultQuestions;
this.loading = false;
this.$store.dispatch('notLoading');
Expand All @@ -275,7 +265,7 @@
setCurrentAction(action) {
if (action === 'EDIT_DETAILS') {
this.$router.push({
name: PageNames.EXAM_CREATION_ROOT,
name: this.PageNames.EXAM_CREATION_ROOT,
params: { ...this.$route.params, sectionIndex: 0 },
});
} else {
Expand Down Expand Up @@ -339,10 +329,10 @@
});
},
handleSubmitDelete() {
return deleteExam(this.quiz.id)
return deleteExam(this.quizId)
.then(() => {
this.$store.commit('classSummary/DELETE_ITEM', { map: 'examMap', id: this.quiz.id });
this.$router.replace(this.classRoute(PageNames.EXAMS_ROOT), () => {
this.$store.commit('classSummary/DELETE_ITEM', { map: 'examMap', id: this.quizId });
this.$router.replace(this.classRoute(this.PageNames.EXAMS_ROOT), () => {
this.showSnackbarNotification('quizDeleted');
});
})
Expand All @@ -351,7 +341,7 @@
});
},
detailLink(learnerId) {
return this.classRoute(PageNames.QUIZ_LEARNER_PAGE_ROOT, {
return this.classRoute(this.PageNames.QUIZ_LEARNER_PAGE_ROOT, {
learnerId,
});
},
Expand Down

0 comments on commit fce634d

Please sign in to comment.