添加测验题型,判断题及简答题

This commit is contained in:
yangjun 2024-11-21 14:14:27 +08:00
parent bf38afc422
commit 0257cb8f73
5 changed files with 365 additions and 63 deletions

View File

@ -159,7 +159,7 @@
<a-col :span="24">
<a-row style="min-height: 100px">
<a-col :span="4" style="padding: 10px">
<a-card title="可选题型" style="height: 300px; border: 1px solid #e8e8e8">
<a-card title="可选题型" style="height: 370px; border: 1px solid #e8e8e8">
<p
><a-button type="primary" @click="addTigan(3)" :disabled="editDisabled"
>单选题</a-button
@ -180,6 +180,16 @@
>文件题</a-button
></p
>
<p
><a-button type="primary" @click="addTigan(502)" :disabled="editDisabled"
>简答题</a-button
></p
>
<p
><a-button type="primary" @click="addTigan(305)" :disabled="editDisabled"
>判断题</a-button
></p
>
</a-card>
<a-card title="引用题库">
<p><a-button type="primary" @click="handleYylx('0')" :disabled="editDisabled">我的题库</a-button></p>
@ -192,7 +202,7 @@
<template #item="{ index, element: item }">
<div>
<!-- 单选题 -->
<div style="width: 100%" v-if="item.wjType == 3 || item.wjType == '3'">
<div style="width: 100%" v-if="(item.wjType == 3 || item.wjType == '3') && item.wjSubtype == null">
<a-card>
<template #title>
<div>
@ -211,18 +221,6 @@
>
<a-select-option :value="item" v-for="(item) in scoreData">{{item}}</a-select-option>
</a-select>
<!-- <span v-if="item.wjSfqh == '0'" @click="handleQiehuan(item, '1')" style="color: #9e9e9e" :disabled="editDisabled"
>自定义分数</span
>
<a-input-number
v-model:value="item.wjScore"
style="width: 120px"
v-if="item.wjSfqh == '1'"
:disabled="editDisabled"
></a-input-number>
<span v-if="item.wjSfqh == '1'" @click="handleQiehuan(item, '0')" style="color: #9e9e9e" :disabled="editDisabled"
>返回</span
> -->
</a-tooltip>
<a-tooltip placement="topRight" title="删除此题"
><Icon
@ -300,18 +298,6 @@
>
<a-select-option :value="item" v-for="(item) in scoreData">{{item}}</a-select-option>
</a-select>
<!-- <span v-if="item.wjSfqh == '0'" @click="handleQiehuan(item, '1')" style="color: #9e9e9e" :disabled="editDisabled"
>自定义分数</span
>
<a-input-number
v-model:value="item.wjScore"
style="width: 120px"
v-if="item.wjSfqh == '1'"
:disabled="editDisabled"
></a-input-number>
<span v-if="item.wjSfqh == '1'" @click="handleQiehuan(item, '0')" style="color: #9e9e9e" :disabled="editDisabled"
>返回</span
> -->
</a-tooltip>
<a-tooltip placement="topRight" title="删除此题"
><Icon
@ -371,7 +357,7 @@
</a-card>
</div>
<!-- 填空题 -->
<div style="width: 100%" v-else-if="item.wjType == 5 || item.wjType == '5'">
<div style="width: 100%" v-else-if="(item.wjType == 5 || item.wjType == '5') && item.wjSubtype == null">
<a-card>
<template #title>
<div>
@ -391,18 +377,6 @@
<a-select-option :value="item" v-for="(item) in scoreData">{{item}}</a-select-option>
</a-select>
<!-- <span v-if="item.wjSfqh == '0'" @click="handleQiehuan(item, '1')" style="color: #9e9e9e" :disabled="editDisabled"
>自定义分数</span
>
<a-input-number
v-model:value="item.wjScore"
style="width: 120px"
v-if="item.wjSfqh == '1'"
:disabled="editDisabled"
></a-input-number>
<span v-if="item.wjSfqh == '1'" @click="handleQiehuan(item, '0')" style="color: #9e9e9e" :disabled="editDisabled"
>返回</span
> -->
</a-tooltip>
<a-tooltip placement="topRight" title="删除此题"
><Icon
@ -461,18 +435,6 @@
<a-select-option :value="item" v-for="(item) in scoreData">{{item}}</a-select-option>
</a-select>
<!-- <span v-if="item.wjSfqh == '0'" @click="handleQiehuan(item, '1')" style="color: #9e9e9e" :disabled="editDisabled"
>自定义分数</span
>
<a-input-number
v-model:value="item.wjScore"
style="width: 120px"
v-if="item.wjSfqh == '1'"
:disabled="editDisabled"
></a-input-number>
<span v-if="item.wjSfqh == '1'" @click="handleQiehuan(item, '0')" style="color: #9e9e9e" :disabled="editDisabled"
>返回</span
> -->
</a-tooltip>
<a-tooltip placement="topRight" title="删除此题"
><Icon
@ -498,6 +460,127 @@
</template>
</a-card>
</div>
<!-- 判断题 -->
<div style="width: 100%" v-if="(item.wjType == 3 || item.wjType == '3') && (item.wjSubtype == 305 || item.wjSubtype == '305')">
<a-card>
<template #title>
<div>
<a-row>
<a-col :span="12">
<span>{{ index + 1 }}<span style="color: #c2bfbf">[判断题]</span></span>
</a-col>
<a-col :span="12" style="text-align: right;">
<a-tooltip placement="topLeft" title="题目分数" v-if="isShow">
<a-select
style="width: 120px"
v-model:value="item.wjScore"
placeholder="请选择分数"
v-if="item.wjSfqh == '0'"
:disabled="editDisabled"
>
<a-select-option :value="item" v-for="(item) in scoreData">{{item}}</a-select-option>
</a-select>
</a-tooltip>
<a-tooltip placement="topRight" title="删除此题"
><Icon
icon="ant-design:delete-outlined"
style="cursor: pointer; font-size: 20px; margin: 10px"
@click="handleDelTigan(item, index)"
v-if="!editDisabled"
/></a-tooltip>
</a-col>
</a-row>
</div>
<JEditor2 placeholder="请填写文件题题干"
v-model:value="item.wjTitle"
:bordered="false"
:style="{ width: '30rem' }"
:auto-size="{ minRows: 1, maxRows: 5 }"
:disabled="editDisabled" v-if="!editDisabled"/>
<div v-else v-html="item.wjTitle"></div>
<div style="text-align: right;color: #c2bfbf" v-if="isShow">是否加入题库
<j-dict-select-tag type='radio' v-model:value="item.sftjtk" dictCode="yn" placeholder="是否加入题库" :disabled="editDisabled"/>
</div>
</template>
<a-row v-if="isShow">
<a-col :span="24" style="color: darkgrey; font-size: 13px"> 选中即为正确答案 </a-col>
</a-row>
<a-radio-group v-model:value="item.itemSelected" style="width: 100%" size="default" :disabled="!isShow">
<div style="width: 100%" v-for="(tmxx, index) in item.wjxWjxxTmxxList" :key="index">
<a-radio :value="tmxx.itemIndex + ``" style="width: 100%">
<a-input
placeholder="请填写选项"
v-model:value="tmxx.itemTitle"
:style="{ width: '30rem' }"
:bordered="false"
:disabled="editDisabled"
/>
<span style="color: #ecb646" v-if="item.itemSelected == tmxx.itemIndex">(正确答案)</span>
<a-tooltip placement="topLeft" title="在下方添加新的选项"
><Icon
icon="ant-design:plus-circle-outlined"
style="cursor: pointer; margin: 5px; font-size: 20px; color: #1890ff"
@click="handleAddTmxx(tmxx, index, item.wjxWjxxTmxxList)"
v-if="!editDisabled"
/></a-tooltip>
<a-tooltip placement="topLeft" title="删除选项"
><Icon
icon="ant-design:minus-circle-outlined"
style="cursor: pointer; margin: 5px; font-size: 20px; color: #1890ff"
@click="handleRemTmxx(tmxx, index, item.wjxWjxxTmxxList)"
v-if="!editDisabled"
/></a-tooltip>
</a-radio>
</div>
</a-radio-group>
</a-card>
</div>
<!-- 简答题 -->
<div style="width: 100%" v-else-if="(item.wjType == 5 || item.wjType == '5') && (item.wjSubtype == 5 || item.wjSubtype == '5')">
<a-card>
<template #title>
<div>
<a-row>
<a-col :span="12">
<span>{{ index + 1 }}<span style="color: #c2bfbf">[简答题]</span></span>
</a-col>
<a-col :span="12" style="text-align: right;">
<a-tooltip placement="topLeft" title="题目分数" v-if="isShow">
<a-select
style="width: 120px"
v-model:value="item.wjScore"
placeholder="请选择分数"
v-if="item.wjSfqh == '0'"
:disabled="editDisabled"
>
<a-select-option :value="item" v-for="(item) in scoreData">{{item}}</a-select-option>
</a-select>
</a-tooltip>
<a-tooltip placement="topRight" title="删除此题"
><Icon
icon="ant-design:delete-outlined"
style="cursor: pointer; font-size: 20px; margin: 10px"
@click="handleDelTigan(item, index)"
v-if="!editDisabled"
/></a-tooltip>
</a-col>
</a-row>
</div>
<JEditor2 placeholder="请填写简答题题干"
v-model:value="item.wjTitle"
:bordered="false"
:style="{ width: '30rem' }"
:auto-size="{ minRows: 1, maxRows: 5 }"
:disabled="editDisabled" v-if="!editDisabled"/>
<div v-else v-html="item.wjTitle"></div>
<div style="text-align: right;color: #c2bfbf" v-if="isShow">是否加入题库
<j-dict-select-tag type='radio' v-model:value="item.sftjtk" dictCode="yn" placeholder="是否加入题库" :disabled="editDisabled"/>
</div>
</template>
</a-card>
</div>
<div v-else></div>
</div>
@ -1604,16 +1687,13 @@ function handinpwei(value) {
//
function addTigan(type) {
console.log('😸', type);
var list = tiganData.value;
console.log('👩‍🦱', list);
//
if (type == 3) {
console.log('11111111111111111111');
var chk = '';
if (isShow.value) {
chk = '1';
}
console.log('2222222222222222222');
let params = {
wjType: parseInt(type),
wjIndex: list.length + 1,
@ -1633,6 +1713,7 @@ function addTigan(type) {
list.push(params);
console.log('👩‍🔬', list);
tiganData.value = [...list];
//
} else if (type == 4) {
let chk = '';
if (isShow.value) {
@ -1655,9 +1736,11 @@ function addTigan(type) {
};
list.push(params);
tiganData.value = [...list];
//
} else if (type == 5) {
let params = {
wjType: parseInt(type),
wjSubtype: null,
wjIndex: list.length + 1,
mainId: mainId,
wjTitle: null,
@ -1669,6 +1752,7 @@ function addTigan(type) {
};
list.push(params);
tiganData.value = [...list];
//
} else if (type == 8) {
var chk = '';
if (isShow.value) {
@ -1686,7 +1770,47 @@ function addTigan(type) {
};
list.push(params);
tiganData.value = [...list];
}
//
}else if (type == 305) {
var chk = '';
if (isShow.value) {
chk = '1';
}
let params = {
wjType: 3,
wjSubtype: 305,
wjIndex: list.length + 1,
mainId: mainId,
wjTitle: null,
wjScore: null,
wjLeixing,
itemSelected: chk,
wjSfqh: '0',
sftjtk: '1',
wjxWjxxTmxxList: [
{ itemTitle: '对', itemIndex: '1' },
{ itemTitle: '错', itemIndex: '2' },
],
};
list.push(params);
tiganData.value = [...list];
} else if (type == 502) {
let params = {
wjType: 5,
wjSubtype: 5,
wjIndex: list.length + 1,
mainId: mainId,
wjTitle: null,
wjScore: null,
wjLeixing,
wjAnswer: null,
wjSfqh: '0',
sftjtk: '1',
};
list.push(params);
tiganData.value = [...list];
//
}
}
/**

View File

@ -16,7 +16,7 @@
<!-- 题干信息 -->
<div style="width: 100%; padding: 0 40px; margin: 0 auto" v-for="(item, index) in tiganData" :key="index">
<!-- 单选题 -->
<div style="width: 100%" v-if="item.wjType == 3">
<div style="width: 100%" v-if="item.wjType == 3 && item.wjSubtype==null">
<div style="text-align: left; width: 100%; font-weight: bold; line-height: 80px; font-size: 18px">单选题</div>
<a-card>
<template #title>
@ -39,6 +39,30 @@
</a-radio-group>
</a-card>
</div>
<!-- 判断题 -->
<div style="width: 100%" v-if="item.wjType == 3 && item.wjSubtype == 305">
<div style="text-align: left; width: 100%; font-weight: bold; line-height: 80px; font-size: 18px">判断题</div>
<a-card>
<template #title>
<span>{{ index + 1 }}</span><span v-html="item.wjTitle" style="white-space: pre-wrap; word-wrap: break-word"></span>
<div v-if="item.picPath">
<j-upload v-model:value="item.picPath" fileType="image" disabled :maxCount="item.picPath.split(',').length" :buttonVisible="true" ></j-upload>
</div>
</template>
<template #extra>
<span style="margin-left: 40px" v-if="isShow"
>题目分值 <span class="answer-word">{{ item.wjScore }}</span> </span
>
</template>
<a-radio-group v-model:value="item.itemSelected" style="width: 100%" size="default" :disabled="disabled">
<div style="width: 100%" v-for="(tmxx, index) in item.wjxWjxxTmxxList" :key="index">
<a-radio :value="tmxx.itemIndex + ``" style="width: 100%; margin-bottom: 5px">
<span v-html="tmxx.itemTitle" style="width: 80%; font-size: 16px"></span>
</a-radio>
</div>
</a-radio-group>
</a-card>
</div>
<!-- 多选题 -->
<div style="width: 100%" v-else-if="item.wjType == 4">
<div style="text-align: left; width: 100%; font-weight: bold; line-height: 80px; font-size: 18px">多选题</div>
@ -66,7 +90,7 @@
</a-card>
</div>
<!-- 填空题 -->
<div style="width: 100%" v-else-if="item.wjType == 5">
<div style="width: 100%" v-else-if="item.wjType == 5 && item.wjSubtype==null">
<div style="text-align: left; width: 100%; font-weight: bold; line-height: 80px; font-size: 18px">填空题</div>
<a-card>
<template #title>
@ -94,7 +118,36 @@
</a-row>
</a-card>
</div>
<!-- 填空题 -->
<!-- 简答题 -->
<div style="width: 100%" v-else-if="item.wjType == 5 && item.wjSubtype == 5">
<div style="text-align: left; width: 100%; font-weight: bold; line-height: 80px; font-size: 18px">简答题</div>
<a-card>
<template #title>
<span>{{ index + 1 }}</span
><span v-html="item.wjTitle" style="font-weight: bold; white-space: pre-wrap; word-wrap: break-word" />
<div v-if="item.picPath">
<j-upload v-model:value="item.picPath" fileType="image" disabled :maxCount="item.picPath.split(',').length" :buttonVisible="true" ></j-upload>
</div>
</template>
<template #extra>
<span style="margin-left: 40px" v-if="isShow"
>题目分值 <span class="answer-word">{{ item.wjScore }}</span> </span
>
</template>
<a-row>
<a-col :span="24">
<a-textarea
placeholder="请填写答案"
v-model:value="item.wjAnswer"
style="width: 100%"
:auto-size="{ minRows: 2, maxRows: 5 }"
:disabled="disabled"
/>
</a-col>
</a-row>
</a-card>
</div>
<!-- 文件题 -->
<div style="width: 100%" v-else-if="item.wjType == 8">
<div style="text-align: left; width: 100%; font-weight: bold; line-height: 80px; font-size: 18px">文件题</div>
<a-card>
@ -123,7 +176,7 @@
</a-row>
</a-card>
</div>
<div v-else> 无对应类型 </div>
<div v-else> 无对应类型-{{item.wjType}}-{{item.wjSubtype}}=</div>
</div>
</a-col>
<a-col :span="24" style="text-align: center" v-if="!sfsxs">
@ -242,10 +295,12 @@ function edit(record, isDisabled, type, flag) {
}
}
tiganData.value = res;
console.log("🚀 ~ defHttp.get1111 ~ tiganData.value:", tiganData.value)
});
} else {
defHttp.get({ url: '/wjxWjxxTmlb/wjxWjxxTmlb/queryDjByMainId', params: { id: record.id } }).then((res) => {
tiganData.value = res;
console.log("🚀 ~ defHttp.get2222 ~ tiganData.value:", tiganData.value)
});
}
}

View File

@ -12,7 +12,7 @@
<!-- 题干信息 -->
<div style="width: 100%" v-for="(item, index) in tiganData" :key="index">
<!-- 单选题 -->
<div style="width: 92%; margin: 0 auto" v-if="item.wjType == 3">
<div style="width: 92%; margin: 0 auto" v-if="item.wjType == 3 && (item.wjSubtype==null || item.wjSubtype == '')">
<div style="text-align: left; width: 100%; font-weight: bold; font-size: 18px; padding: 20px">单选题</div>
<a-card>
<template #title>
@ -46,6 +46,41 @@
</a-radio-group>
</a-card>
</div>
<!-- 判断题 -->
<div style="width: 92%; margin: 0 auto" v-else-if="(item.wjType == 3 || item.wjType == '3') && (item.wjSubtype==305 || item.wjSubtype=='305')">
<div style="text-align: left; width: 100%; font-weight: bold; font-size: 18px; padding: 20px">判断题</div>
<a-card>
<template #title>
<span>{{ index + 1 }}</span><span v-html:value="item.wjTitle" style="white-space: pre-wrap; word-wrap: break-word"></span>
<div v-if="item.picPath">
<j-upload
v-model:value="item.picPath"
fileType="image"
disabled
:maxCount="item.picPath.split(',').length"
:buttonVisible="false"
></j-upload>
</div>
</template>
<template #extra v-if="djxxData.atype == 6">
<div style="margin-left: 40px"
>题目分值<span class="answer-word"> {{ item.wjScore }}</span> </div
>
<div style="margin-left: 40px"
>所得分值<span class="answer-word"> {{ item.itemScore }}</span> </div
>
</template>
<a-radio-group v-model:value="item.itemSelected" style="width: 100%" size="default" disabled>
<div style="width: 100%" v-for="(tmxx, index) in item.wjxWjxxTmxxList">
<a-radio :value="tmxx.itemIndex + ``" style="width: 100%; margin-bottom: 5px">
<span v-html:value="tmxx.itemTitle" style="width: 80%; font-size: 16px; color: #000"></span>
<span v-if="tmxx.itemSelected == 'true'" style="color: #9e9e9e; margin-left: 30px; font-size: 12px">(此选项是正确答案)</span>
</a-radio>
</div>
</a-radio-group>
</a-card>
</div>
<!-- 多选题 -->
<div style="width: 92%; margin: 0 auto" v-else-if="item.wjType == 4">
<div style="text-align: left; width: 100%; font-weight: bold; font-size: 18px; padding: 20px">多选题</div>
@ -86,7 +121,7 @@
</a-card>
</div>
<!-- 填空题 -->
<div style="width: 92%; margin: 0 auto" v-else-if="item.wjType == 5">
<div style="width: 92%; margin: 0 auto" v-else-if="item.wjType == 5 && item.wjSubtype == null">
<div style="text-align: left; width: 100%; font-weight: bold; font-size: 18px; padding: 20px">填空题</div>
<a-card>
<template #title>
@ -119,6 +154,39 @@
</a-row>
</a-card>
</div>
<!-- 简答题 -->
<div style="width: 92%; margin: 0 auto" v-else-if="item.wjType == 5 && item.wjSubtype == 5">
<div style="text-align: left; width: 100%; font-weight: bold; font-size: 18px; padding: 20px">简答题</div>
<a-card>
<template #title>
<span>{{ index + 1 }}</span><span v-html:value="item.wjTitle" style="white-space: pre-wrap; word-wrap: break-word" />
<div v-if="item.picPath">
<j-upload
v-model:value="item.picPath"
fileType="image"
disabled
:maxCount="item.picPath.split(',').length"
:buttonVisible="false"
></j-upload>
</div>
</template>
<template #extra v-if="djxxData.atype == 6">
<div style="margin-left: 40px"
>题目分值<span class="answer-word">{{ item.wjScore }}</span> </div
>
<div style="margin-left: 40px"
>所得分值<span class="answer-word">{{ item.itemScore?item.itemScore:'待评' }}</span> </div
>
</template>
<a-row>
<a-col :span="24">
<span v-html="item.answerText"></span>
<!-- <a-textarea v-model:value="item.answerText" style="width:100%;" :auto-size="{ minRows: 2, maxRows: 5 }" disabled/> -->
</a-col>
</a-row>
</a-card>
</div>
<!-- 文件题 -->
<div style="width: 92%; margin: 0 auto" v-else-if="item.wjType == '8'">
<div style="text-align: left; width: 100%; font-weight: bold; font-size: 18px; padding: 20px">文件题</div>

View File

@ -62,15 +62,57 @@
@change="emitChange(item)"
/>
</div>
<div style="text-align: center; margin-top: 20px">
<!-- <div style="text-align: center; margin-top: 20px">
<a-button type="primary" @click="submitForm">保存</a-button>
<a-button type="primary" @click="submitNextForm" style="margin-left: 10px">保存并下一个</a-button>
</div> -->
</a-col>
</a-row>
</a-card>
</div>
<!-- 简答题 -->
<div style="width: 92%; margin: 0 auto" v-if="item.wjType == '5' && item.wjSubtype == '5'">
<div style="text-align: left; width: 100%; font-weight: bold; font-size: 18px; padding: 20px">简答题</div>
<a-card>
<template #title>
<span>{{ index + 1 }}</span><span v-html:value="item.wjTitle" style="white-space: pre-wrap; word-wrap: break-word" />
</template>
<template #extra v-if="djxxData.atype == 6">
<div style="margin-left: 40px"
>题目分值<span class="answer-word">{{ item.wjScore }}</span> </div
>
<div style="margin-left: 40px"
>所得分值<span class="answer-word">{{ item.itemScore ? item.itemScore : '待评' }}</span> </div
>
</template>
<a-row>
<a-col :span="18">
<div >
{{item.answerText}}
</div>
</a-col>
<a-col :span="6">
<div style="text-align: right">
<span>评分</span>
<a-input
placeholder="请输入评分"
v-model:value="item.itemScore2"
style="width: 70%; margin-bottom: 5px; margin-left: 10px"
@change="emitChange(item)"
/>
</div>
</a-col>
</a-row>
</a-card>
</div>
</div>
<div>
<div style="text-align: center; margin-top: 20px">
<a-button type="primary" @click="submitForm">保存</a-button>
<a-button type="primary" @click="submitNextForm" style="margin-left: 10px">保存并下一个</a-button>
</div>
</div>
</a-col>
</a-row>
</a-spin>
@ -122,7 +164,9 @@ function edit(record) {
}
}
tiganData.value = list;
console.log("🚀 ~ defHttp.get ~ tiganData.value:", tiganData.value)
djxxData.value = djxx;
console.log("🚀 ~ defHttp.get ~ djxxData.value:", djxxData.value)
} else {
createMessage.warning('暂无需要评分数据');
}

View File

@ -1008,6 +1008,13 @@ function handlepiyue(record: Recordable) {
registerPiyueModal.value.edit(record);
}
function handleScccjg(record: Recordable){
// defHttp.get({url:'/zyInfoStudent/zyInfoStudent/Scccjg',params:{id:record.id}}).then(res=>{
// })
}
/**
* 操作栏
*/
@ -1023,6 +1030,10 @@ function getTableAction(record) {
// label: '',
// onClick: handleSzyb.bind(null, record),
// },
// {
// label: '',
// onClick: handleScccjg.bind(null, record),
// },
{
label: '下载',
onClick: handleDown.bind(null, record.filePath),