Generate question bank domain model from JDL

This commit is contained in:
jieun committed 2026-10-20 18:46:29 +09:00
1 parent 1d97cc4e31
commit 1d74d8f04b
160 files changed
+26900 -2

No files matched your search

@@ -0,0 +1,120 @@
<template>
<div class="d-flex justify-content-center">
<div class="col-8">
<form name="editForm" novalidate @submit.prevent="save()">
<h2 id="questionBankApp.choice.home.createOrEditLabel" data-cy="ChoiceCreateUpdateHeading">
{{ t$('questionBankApp.choice.home.createOrEditLabel') }}
</h2>
<div>
<div class="mb-3" v-if="choice.id">
<label for="id">{{ t$('global.field.id') }}</label>
<input type="text" class="form-control" id="id" name="id" v-model="choice.id" readonly />
</div>
<div class="mb-3">
<label class="form-control-label" for="choice-optionKey">{{ t$('questionBankApp.choice.optionKey') }}</label>
<select
class="form-control"
name="optionKey"
:class="{ valid: !v$.optionKey.$invalid, invalid: v$.optionKey.$invalid }"
v-model="v$.optionKey.$model"
id="choice-optionKey"
data-cy="optionKey"
required
>
<option
v-for="optionKey in optionKeyValues"
:key="optionKey"
:value="optionKey"
:label="t$('questionBankApp.OptionKey.' + optionKey)"
>
{{ optionKey }}
</option>
</select>
<div v-if="v$.optionKey.$anyDirty && v$.optionKey.$invalid">
<small class="form-text text-danger" v-for="error of v$.optionKey.$errors" :key="error.$uid">{{ error.$message }}</small>
</div>
</div>
<div class="mb-3">
<label class="form-control-label" for="choice-content">{{ t$('questionBankApp.choice.content') }}</label>
<input
type="text"
class="form-control"
name="content"
id="choice-content"
data-cy="content"
:class="{ valid: !v$.content.$invalid, invalid: v$.content.$invalid }"
v-model="v$.content.$model"
required
/>
<div v-if="v$.content.$anyDirty && v$.content.$invalid">
<small class="form-text text-danger" v-for="error of v$.content.$errors" :key="error.$uid">{{ error.$message }}</small>
</div>
</div>
<div class="mb-3">
<label class="form-control-label" for="choice-displayOrder">{{ t$('questionBankApp.choice.displayOrder') }}</label>
<input
type="number"
class="form-control"
name="displayOrder"
id="choice-displayOrder"
data-cy="displayOrder"
:class="{ valid: !v$.displayOrder.$invalid, invalid: v$.displayOrder.$invalid }"
v-model.number="v$.displayOrder.$model"
required
/>
<div v-if="v$.displayOrder.$anyDirty && v$.displayOrder.$invalid">
<small class="form-text text-danger" v-for="error of v$.displayOrder.$errors" :key="error.$uid">{{ error.$message }}</small>
</div>
</div>
<div class="mb-3 form-check">
<input
type="checkbox"
class="form-check-input"
name="correct"
id="choice-correct"
data-cy="correct"
:class="{ valid: !v$.correct.$invalid, invalid: v$.correct.$invalid }"
v-model="v$.correct.$model"
required
/>
<label class="form-check-label" for="choice-correct">{{ t$('questionBankApp.choice.correct') }}</label>
<div v-if="v$.correct.$anyDirty && v$.correct.$invalid">
<small class="form-text text-danger" v-for="error of v$.correct.$errors" :key="error.$uid">{{ error.$message }}</small>
</div>
</div>
<div class="mb-3">
<label class="form-control-label" for="choice">{{ t$('questionBankApp.choice.question') }}</label>
<select class="form-control" id="choice-question" data-cy="question" name="question" v-model="choice.question" required>
<option v-if="!choice.question" :value="null" selected></option>
<option
:value="choice.question && questionOption.id === choice.question.id ? choice.question : questionOption"
v-for="questionOption in questions"
:key="questionOption.id"
>
{{ questionOption.id }}
</option>
</select>
</div>
<div v-if="v$.question.$anyDirty && v$.question.$invalid">
<small class="form-text text-danger" v-for="error of v$.question.$errors" :key="error.$uid">{{ error.$message }}</small>
</div>
</div>
<div>
<button type="button" id="cancel-save" data-cy="entityCreateCancelButton" class="btn btn-secondary" @click="previousState()">
<font-awesome-icon icon="ban"></font-awesome-icon>&nbsp;<span>{{ t$('entity.action.cancel') }}</span>
</button>
<button
type="submit"
id="save-entity"
data-cy="entityCreateSaveButton"
:disabled="v$.$invalid || isSaving"
class="btn btn-primary"
>
<font-awesome-icon icon="save"></font-awesome-icon>&nbsp;<span>{{ t$('entity.action.save') }}</span>
</button>
</div>
</form>
</div>
</div>
</template>
<script lang="ts" src="./choice-update.component.ts"></script>