|
@@ -68,11 +68,9 @@ import { shallowRef } from 'vue'
|
|
|
import { EntityCreate } from 'quasar-crud'
|
|
import { EntityCreate } from 'quasar-crud'
|
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
import { AnswerBook } from 'src/models/AnswerBook.js'
|
|
import { AnswerBook } from 'src/models/AnswerBook.js'
|
|
|
-import BtnControl from 'src/components/Control/btn.vue'
|
|
|
|
|
import { FormBuilderAssist } from 'quasar-form-builder'
|
|
import { FormBuilderAssist } from 'quasar-form-builder'
|
|
|
import QuestionChoices from 'src/components/FormBuilderCustumComponents/QuestionChoices/QuestionChoices.vue'
|
|
import QuestionChoices from 'src/components/FormBuilderCustumComponents/QuestionChoices/QuestionChoices.vue'
|
|
|
|
|
|
|
|
-const BtnControlComp = shallowRef(BtnControl)
|
|
|
|
|
const QuestionChoicesComp = shallowRef(QuestionChoices)
|
|
const QuestionChoicesComp = shallowRef(QuestionChoices)
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -122,40 +120,7 @@ export default {
|
|
|
{ type: 'input', name: 'answer_text', label: 'متن پاسخ', placeholder: ' ', value: answerSheetItem.answer_text, inputType: 'textarea', col: 'col-12' },
|
|
{ type: 'input', name: 'answer_text', label: 'متن پاسخ', placeholder: ' ', value: answerSheetItem.answer_text, inputType: 'textarea', col: 'col-12' },
|
|
|
{ type: 'file', name: 'answer_attachment', label: 'فایل پیوست', placeholder: ' ', value: answerSheetItem.answer_attachment, col: 'col-12' },
|
|
{ type: 'file', name: 'answer_attachment', label: 'فایل پیوست', placeholder: ' ', value: answerSheetItem.answer_attachment, col: 'col-12' },
|
|
|
{ type: 'hidden', name: 'answer_book', value: this.answerBook.id },
|
|
{ type: 'hidden', name: 'answer_book', value: this.answerBook.id },
|
|
|
- { type: 'hidden', name: 'test_question', value: answerSheetItem.test_question },
|
|
|
|
|
- {
|
|
|
|
|
- type: BtnControlComp,
|
|
|
|
|
- name: 'btn',
|
|
|
|
|
- responseKey: 'btn',
|
|
|
|
|
- label: 'ثبت پاسخ',
|
|
|
|
|
- placeholder: ' ',
|
|
|
|
|
- atClick: () => {
|
|
|
|
|
- this.sendAnswer(answerSheetIndex)
|
|
|
|
|
- // const answerText = FormBuilderAssist.getInputsByName(this.questionInputs[answerSheetIndex], 'answer_text').value
|
|
|
|
|
- // if (!answerText && !hasChoise) {
|
|
|
|
|
- // this.$q.notify({
|
|
|
|
|
- // type: 'negative',
|
|
|
|
|
- // message: 'لطفا متن پاسخ را کامل کنید.'
|
|
|
|
|
- // })
|
|
|
|
|
- // return
|
|
|
|
|
- // }
|
|
|
|
|
- // const entityCreate = this.$refs['entityCreate_' + answerSheetIndex.toString()][0]
|
|
|
|
|
- // entityCreate.entityLoading = true
|
|
|
|
|
- // entityCreate.createEntity(false)
|
|
|
|
|
- // .then(() => {
|
|
|
|
|
- // if (this.questionPanel < this.answerBook.answer_sheet_info.list.length) {
|
|
|
|
|
- // this.changeQuestion(this.questionPanel + 1)
|
|
|
|
|
- // } else if (this.questionPanel === this.answerBook.answer_sheet_info.list.length) {
|
|
|
|
|
- // this.confirmAnswers()
|
|
|
|
|
- // }
|
|
|
|
|
- // entityCreate.entityLoading = false
|
|
|
|
|
- // })
|
|
|
|
|
- // .catch(() => {
|
|
|
|
|
- // entityCreate.entityLoading = false
|
|
|
|
|
- // })
|
|
|
|
|
- },
|
|
|
|
|
- col: 'col-12 flex justify-end'
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ { type: 'hidden', name: 'test_question', value: answerSheetItem.test_question }
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
if (hasChoise) {
|
|
if (hasChoise) {
|