Generate question bank domain model from JDL
This commit is contained in:
1 parent
1d97cc4e31
commit
1d74d8f04b
160 files changed
+26900
-2
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import { type Ref, defineComponent, inject, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import { useAlertService } from '@/shared/alert/alert.service';
|
||||
import { useDateFormat } from '@/shared/composables';
|
||||
import { type IExamAttempt } from '@/shared/model/exam-attempt.model';
|
||||
|
||||
import ExamAttemptService from './exam-attempt.service';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ExamAttemptDetails',
|
||||
setup() {
|
||||
const dateFormat = useDateFormat();
|
||||
const examAttemptService = inject('examAttemptService', () => new ExamAttemptService());
|
||||
const alertService = inject('alertService', () => useAlertService(), true);
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const previousState = () => router.go(-1);
|
||||
const examAttempt: Ref<IExamAttempt> = ref({});
|
||||
|
||||
const retrieveExamAttempt = async examAttemptId => {
|
||||
try {
|
||||
const res = await examAttemptService().find(examAttemptId);
|
||||
examAttempt.value = res;
|
||||
} catch (error) {
|
||||
alertService.showHttpError(error.response);
|
||||
}
|
||||
};
|
||||
|
||||
if (route.params?.examAttemptId) {
|
||||
retrieveExamAttempt(route.params.examAttemptId);
|
||||
}
|
||||
|
||||
return {
|
||||
...dateFormat,
|
||||
examAttempt,
|
||||
|
||||
previousState,
|
||||
t$: useI18n().t,
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user