|
|
|
@ -0,0 +1,949 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="quiz-container">
|
|
|
|
|
<!-- 顶部栏 -->
|
|
|
|
|
<view >
|
|
|
|
|
<view class="top-bar">
|
|
|
|
|
<view class="question-info">
|
|
|
|
|
<text class="question-text" v-if="quizData[activeIndex]">{{ }} ({{ }} 分)</text>
|
|
|
|
|
</view>
|
|
|
|
|
<button class="answer-card-btn" @click="showAnswerCard">提交</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view>
|
|
|
|
|
<text>{{ moment.utc(totaltime * 1000).format('hh:mm:ss')}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 动态渲染题目 -->
|
|
|
|
|
<view v-for="(question, index) in quizData" :key="question.uuid" class="question">
|
|
|
|
|
<view>
|
|
|
|
|
<view>
|
|
|
|
|
<!-- 题目文本 -->
|
|
|
|
|
<view>
|
|
|
|
|
<image v-if="question.tm.lx==='pic'" :src="question.tm.pic" mode="aspectFit" class="question-image" />
|
|
|
|
|
<text v-if="question.tm.lx==='wb'">{{ question.tm.wb}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<text>{{question.leixing}}</text>
|
|
|
|
|
<!-- 选项:支持图片或文本 -->
|
|
|
|
|
<view v-if="question.lx==='单选题'">
|
|
|
|
|
<view v-for="(item_choose, index_choose) in question.xuexiang" :key="index_choose" >
|
|
|
|
|
<view class="choose-xx" @click="danchoose(index,zm[index_choose])" >
|
|
|
|
|
<button
|
|
|
|
|
:style="{backgroundColor:question.daan===zm[index_choose]?'blue':'#aaa'}"
|
|
|
|
|
class="choose-button"
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
{{zm[index_choose]}}
|
|
|
|
|
</button>
|
|
|
|
|
<view class="choose-wborpic" >
|
|
|
|
|
<image v-if="item_choose.lx==='pic'" :src="item_choose.pic" class="choose-image" mode="aspectFit" />
|
|
|
|
|
<text v-if="item_choose.lx==='wb'" >{{item_choose.wb}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="question.lx==='简答题'" class="duoxuanti_all">
|
|
|
|
|
<button type="button" @click="scpic">上传图片</button>
|
|
|
|
|
<text>12345</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="question.lx==='多选题'" class="duoxuanti_all">
|
|
|
|
|
<view v-for="(item_choose, index_choose) in question.xuexiang" :key="index_choose" >
|
|
|
|
|
<view class="choose-xx" @click="duochoose(index,zm[index_choose])">
|
|
|
|
|
<button
|
|
|
|
|
:style="{backgroundColor:question.daan.includes(zm[index_choose])?'blue':'#aaa'}"
|
|
|
|
|
class="choose-button"
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
{{zm[index_choose]}}
|
|
|
|
|
</button>
|
|
|
|
|
<view class="choose-wborpic">
|
|
|
|
|
<image v-if="item_choose.lx==='pic'" :src="item_choose.pic" class="choose-image" mode="aspectFit" />
|
|
|
|
|
<text v-if="item_choose.lx==='wb'">{{item_choose.wb}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="question.lx==='填空题'">
|
|
|
|
|
<view >
|
|
|
|
|
|
|
|
|
|
<input :value="question.sr" @input="val=>{tkt_one(val.detail.value,index);}" type="text" class="tkt-input" />
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="question.lx==='判断题'">
|
|
|
|
|
<view class="grid-container-pd" >
|
|
|
|
|
<view key="2" class="grid-item">
|
|
|
|
|
<button
|
|
|
|
|
|
|
|
|
|
:style="{backgroundColor:question.daan==='对'?'blue':''}"
|
|
|
|
|
class="choose-button1"
|
|
|
|
|
@click="pdt_one('对',index)"
|
|
|
|
|
>
|
|
|
|
|
√
|
|
|
|
|
</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view key="index" class="grid-item">
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<view key="index+1" class="grid-item">
|
|
|
|
|
<button
|
|
|
|
|
|
|
|
|
|
:style="{backgroundColor:question.daan==='错'?'blue':''}"
|
|
|
|
|
class="choose-button1"
|
|
|
|
|
@click="pdt_one('错',index)"
|
|
|
|
|
>
|
|
|
|
|
×
|
|
|
|
|
</button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 其他题型类似处理 -->
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 答案反馈 -->
|
|
|
|
|
<view v-if="showResult" class="result">
|
|
|
|
|
<text v-for="(res, key) in results" :key="key" :style="{ color: res ? 'green' : 'red' }">
|
|
|
|
|
第 {{ key + 1 }} 题:{{ res ? '✅ 正确' : '❌ 错误' }}
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="quizData[activeIndex]">
|
|
|
|
|
<view v-if="isNumber(quizData[activeIndex].stuprint)" class="score-and-answer">
|
|
|
|
|
<text>本题得分:{{ quizData[activeIndex].stuprint }}</text>
|
|
|
|
|
<view v-if="quizData[activeIndex].leixing==='多选题'">
|
|
|
|
|
<text>我的答案:{{quizData[activeIndex].duoxuexiang.sort().join(",") }}</text><br/>
|
|
|
|
|
<text>正确答案:{{JSON.parse(quizData[activeIndex].information).daan.sort().join(",") }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="quizData[activeIndex].leixing==='单选题'">
|
|
|
|
|
<text>我的答案:{{quizData[activeIndex].xuexiang }}</text><br/>
|
|
|
|
|
<text>正确答案:{{JSON.parse(quizData[activeIndex].information).daan }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="quizData[activeIndex].leixing==='判断题'">
|
|
|
|
|
<text>我的答案:{{quizData[activeIndex].xuexiang }}</text><br/>
|
|
|
|
|
<text>正确答案:{{JSON.parse(quizData[activeIndex].information).daan }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="quizData[activeIndex].leixing==='填空题'">
|
|
|
|
|
|
|
|
|
|
<view v-for="(item_choose, index_tkx) in JSON.parse(quizData[activeIndex].information).daan" :key="index_tkx" >
|
|
|
|
|
<text>我的答案:{{quizData[activeIndex].tk[index_tkx]}}</text>
|
|
|
|
|
<text>正确答案:{{item_choose.daan }}</text>
|
|
|
|
|
|
|
|
|
|
</view><br/>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 答题卡 --><br/>
|
|
|
|
|
<view v-if="showAnswerCardFlag" class="answer-card">
|
|
|
|
|
<view class="dtk-top">
|
|
|
|
|
<view class="dtk-left">
|
|
|
|
|
<text>刘东阳</text>
|
|
|
|
|
<text class="stuxuehao">202413501062</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="dtk-right">
|
|
|
|
|
<text class="dtk-print-title">作业得分</text>
|
|
|
|
|
<text class="dtk-print-stu">100</text>
|
|
|
|
|
<text class="dtk-print-all">/100</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
<view>题目列表</view>
|
|
|
|
|
<view class="tm-list">
|
|
|
|
|
<view v-for="(question, index) in quizData" :key="question.id" :class="index===activeIndex?'card-item-choose':(isNumber(question.stuprint)?'card-item-nochoose':'card-item-choose-noprint')" @click="goToQuestion(question.id)">
|
|
|
|
|
<view v-if="isNumber(question.stuprint)">
|
|
|
|
|
<view v-if="question.stuprint==getprint(question)">
|
|
|
|
|
<uni-badge class="uni-badge-left-margin" text="√" absolute="rightTop" :offset="[-16, -4]" size="small" :customStyle="{background: 'green'}">
|
|
|
|
|
<view>
|
|
|
|
|
<text>{{ index + 1 }} </text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</uni-badge>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="question.stuprint!==getprint(question)">
|
|
|
|
|
<uni-badge class="uni-badge-left-margin" :text='question.stuprint.toString()' absolute="rightTop" :offset="[-16, -4]" size="small" :customStyle="{background: 'red'}">
|
|
|
|
|
<view>
|
|
|
|
|
<text>{{ index + 1 }}</text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</uni-badge>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="!isNumber(question.stuprint)" >
|
|
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
<text>{{ index + 1 }}</text>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view>
|
|
|
|
|
<button class="return-button" @click="returndati">返回答题</button>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view :style="{height: '20px'}">
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 得分与正确答案展示 -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 底部控制按钮 -->
|
|
|
|
|
<view class="bottom-controls">
|
|
|
|
|
<button @click="prevQuestion">上一题</button>
|
|
|
|
|
<button @click="submitAnswers" type="primary">提交答案</button>
|
|
|
|
|
<button @click="nextQuestion">下一题</button>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import {ref, computed, watch, watchEffect} from 'vue'
|
|
|
|
|
import {onLoad} from "@dcloudio/uni-app";
|
|
|
|
|
import UniBadge from "@/uni_modules/uni-badge/components/uni-badge/uni-badge.vue";
|
|
|
|
|
const zm=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
|
|
|
|
|
import moment from "moment/moment";
|
|
|
|
|
import path from "path";
|
|
|
|
|
import {info} from "sass";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 题目数据(模拟从接口获取)
|
|
|
|
|
const quizData = ref([])
|
|
|
|
|
const uid=ref("0")
|
|
|
|
|
// 当前激活的问题索引
|
|
|
|
|
const fujianuuid=ref("0")
|
|
|
|
|
const intervalId = ref<number | null>(null);
|
|
|
|
|
const activeIndex = ref(0)
|
|
|
|
|
const dati_able=ref(true)
|
|
|
|
|
// 控制是否显示答案结果
|
|
|
|
|
const showResult = ref(false)
|
|
|
|
|
|
|
|
|
|
// 控制答题卡显示/隐藏
|
|
|
|
|
const showAnswerCardFlag = ref(false)
|
|
|
|
|
const endtime=ref("")
|
|
|
|
|
// 获取当前题目
|
|
|
|
|
const currentQuestion = computed(() => {
|
|
|
|
|
return quizData[activeIndex.value] || {}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 存储用户答案,以题目 ID 为键
|
|
|
|
|
const userAnswers = ref<Record<number, any>>({})
|
|
|
|
|
|
|
|
|
|
// 存储每道题的结果(true/false)
|
|
|
|
|
const results = ref<boolean[]>([])
|
|
|
|
|
|
|
|
|
|
// 处理单选题选择变化
|
|
|
|
|
function handleRadioChange(id: number, value: string) {
|
|
|
|
|
userAnswers.value[id] = value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 上一题按钮逻辑
|
|
|
|
|
function prevQuestion() {
|
|
|
|
|
if (activeIndex.value > 0) activeIndex.value--
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 下一题按钮逻辑
|
|
|
|
|
function nextQuestion() {
|
|
|
|
|
if (activeIndex.value < quizData.length - 1) activeIndex.value++
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 点击答题卡跳转到指定题目
|
|
|
|
|
function goToQuestion(index: number) {
|
|
|
|
|
const id=quizData.value.findIndex(item=>item.id==index)
|
|
|
|
|
if(id!==-1) {
|
|
|
|
|
activeIndex.value = id
|
|
|
|
|
showAnswerCardFlag.value = false // 关闭答题卡
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
watch(quizData,function (newValue, oldValue) {
|
|
|
|
|
if(1===3) {
|
|
|
|
|
uni.request({
|
|
|
|
|
url: 'http://localhost:3400/api/updatezxdt_ex',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data: { // 注意:GET 请求的参数需放在 `data` 而非 `params` 字段:ml-citation{ref="8" data="citationList"}
|
|
|
|
|
alltm: newValue,
|
|
|
|
|
ksh: uid.value,
|
|
|
|
|
xuehao: "202413501062"
|
|
|
|
|
},
|
|
|
|
|
success: (res) => { /* ... */
|
|
|
|
|
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},{deep: true});
|
|
|
|
|
// 提交答案并判断正误
|
|
|
|
|
const totaltime=ref(5)
|
|
|
|
|
function getprint(question){
|
|
|
|
|
if(question.leixing==='填空题'){
|
|
|
|
|
let print =0;
|
|
|
|
|
JSON.parse(question.information).daan.map((daan, key) => {
|
|
|
|
|
print+=parseInt(daan.print);
|
|
|
|
|
})
|
|
|
|
|
return print;
|
|
|
|
|
}else if(question.leixing==='多选题'){
|
|
|
|
|
|
|
|
|
|
return parseInt(JSON.parse(question.information).df);
|
|
|
|
|
|
|
|
|
|
}else if(question.leixing==='单选题'){
|
|
|
|
|
|
|
|
|
|
return parseInt(JSON.parse(question.information).df);
|
|
|
|
|
|
|
|
|
|
}else if(question.leixing==='判断题'){
|
|
|
|
|
|
|
|
|
|
return parseInt(JSON.parse(question.information).df);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function submitAnswers() {
|
|
|
|
|
// 重置当前题目的结果
|
|
|
|
|
console.log(quizData.value[activeIndex.value])
|
|
|
|
|
if(quizData.value[activeIndex.value].leixing==="填空题"){
|
|
|
|
|
let print =0;
|
|
|
|
|
JSON.parse(quizData.value[activeIndex.value].information).daan.map((daan, key) => {
|
|
|
|
|
|
|
|
|
|
if(daan.daan===quizData.value[activeIndex.value].tk[key]){
|
|
|
|
|
print+=parseInt(daan.print);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(print)
|
|
|
|
|
quizData.value[activeIndex.value].stuprint=print;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(quizData.value[activeIndex.value].leixing==="多选题"){
|
|
|
|
|
let print =0;
|
|
|
|
|
let zq=true;
|
|
|
|
|
JSON.parse(quizData.value[activeIndex.value].information).daan.map((choose_one)=>{
|
|
|
|
|
if(!quizData.value[activeIndex.value].duoxuexiang.includes(choose_one)){
|
|
|
|
|
zq=false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if(quizData.value[activeIndex.value].duoxuexiang.length!==JSON.parse(quizData.value[activeIndex.value].information).daan.length){
|
|
|
|
|
zq=false;
|
|
|
|
|
}
|
|
|
|
|
if(zq){
|
|
|
|
|
print=parseInt(JSON.parse(quizData.value[activeIndex.value].information).df)
|
|
|
|
|
}
|
|
|
|
|
console.log(print)
|
|
|
|
|
quizData.value[activeIndex.value].stuprint= print;
|
|
|
|
|
}else if(quizData.value[activeIndex.value].leixing==="单选题"){
|
|
|
|
|
if(quizData.value[activeIndex.value].xuexiang===JSON.parse(quizData.value[activeIndex.value].information).daan){
|
|
|
|
|
quizData.value[activeIndex.value].stuprint=parseInt(JSON.parse(quizData.value[activeIndex.value].information).df)
|
|
|
|
|
}else {
|
|
|
|
|
quizData.value[activeIndex.value].stuprint=0
|
|
|
|
|
}
|
|
|
|
|
}else if(quizData.value[activeIndex.value].leixing==="判断题"){
|
|
|
|
|
if(quizData.value[activeIndex.value].xuexiang===JSON.parse(quizData.value[activeIndex.value].information).daan){
|
|
|
|
|
quizData.value[activeIndex.value].stuprint=JSON.parse(quizData.value[activeIndex.value].information).df
|
|
|
|
|
}else {
|
|
|
|
|
quizData.value[activeIndex.value].stuprint=0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//////无效
|
|
|
|
|
if(1===3) {
|
|
|
|
|
results.value[activeIndex.value] = false
|
|
|
|
|
|
|
|
|
|
const currentQuestion = quizData[activeIndex.value]
|
|
|
|
|
const userAnswer = userAnswers.value[currentQuestion.id] ?? ''
|
|
|
|
|
const correctAnswer = String(currentQuestion.answer)
|
|
|
|
|
|
|
|
|
|
const normalizedUserAnswer = String(userAnswer).trim().toUpperCase()
|
|
|
|
|
const normalizedCorrectAnswer = correctAnswer.trim().toUpperCase()
|
|
|
|
|
|
|
|
|
|
const isCorrect = normalizedUserAnswer == normalizedCorrectAnswer
|
|
|
|
|
results.value[activeIndex.value] = isCorrect
|
|
|
|
|
showResult.value = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 计算当前题目得分
|
|
|
|
|
const score = computed(() => {
|
|
|
|
|
const currentResult = results.value[activeIndex.value]
|
|
|
|
|
return currentResult ? currentQuestion.value.score : 0
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 获取当前题目的正确答案
|
|
|
|
|
const correctAnswer = computed(() => {
|
|
|
|
|
const currentQuestion = quizData[activeIndex.value]
|
|
|
|
|
if (!currentQuestion) return ''
|
|
|
|
|
const correctOption = currentQuestion.options.find(
|
|
|
|
|
option => option.value === currentQuestion.answer
|
|
|
|
|
)
|
|
|
|
|
return correctOption ? correctOption.text : ''
|
|
|
|
|
})
|
|
|
|
|
function pdt_one(xx:string,index:number){
|
|
|
|
|
quizData.value[index].daan = xx
|
|
|
|
|
}
|
|
|
|
|
const startTimer = () => {
|
|
|
|
|
intervalId.value = setInterval(() => {
|
|
|
|
|
|
|
|
|
|
if (totaltime.value>0) {
|
|
|
|
|
|
|
|
|
|
totaltime.value=moment(endtime.value).diff(moment(),'seconds')
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
stopTimer();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 停止倒计时
|
|
|
|
|
const stopTimer = () => {
|
|
|
|
|
if (intervalId.value !== null) {
|
|
|
|
|
clearInterval(intervalId.value);
|
|
|
|
|
intervalId.value = null;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
function danchoose(index: number,choose:string) {
|
|
|
|
|
console.log(choose);
|
|
|
|
|
console.log(index)
|
|
|
|
|
quizData.value[index].daan = choose
|
|
|
|
|
}
|
|
|
|
|
function duochoose(index: number,choose:string) {
|
|
|
|
|
console.log(choose);
|
|
|
|
|
console.log(index)
|
|
|
|
|
if(quizData.value[index].daan.includes(choose)) {
|
|
|
|
|
quizData.value[index].daan = quizData.value[index].daan.filter(item => item !== choose);
|
|
|
|
|
}else {
|
|
|
|
|
quizData.value[index].daan.push(choose);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 显示或隐藏答题卡
|
|
|
|
|
function showAnswerCard() {
|
|
|
|
|
showAnswerCardFlag.value = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isNumber(value) {
|
|
|
|
|
return typeof value === 'number';
|
|
|
|
|
}
|
|
|
|
|
function updatwfujianuuid(){
|
|
|
|
|
uni.request({
|
|
|
|
|
url: 'http://localhost:3400/helpwx/uuid',
|
|
|
|
|
method: 'GET',
|
|
|
|
|
data: { // 注意:GET 请求的参数需放在 `data` 而非 `params` 字段:ml-citation{ref="8" data="citationList"}
|
|
|
|
|
|
|
|
|
|
}, success: (res) => { /* ... */
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
fujianuuid.value=res.data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function tkt_one(xx:string,index:number){
|
|
|
|
|
|
|
|
|
|
quizData.value[index].sr=xx;
|
|
|
|
|
}
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
console.log(options)
|
|
|
|
|
uid.value=options.uuid;
|
|
|
|
|
updatwfujianuuid()
|
|
|
|
|
uni.request({
|
|
|
|
|
url: 'http://localhost:3400/kaoshi/select',
|
|
|
|
|
method: 'GET',
|
|
|
|
|
data: { // 注意:GET 请求的参数需放在 `data` 而非 `params` 字段:ml-citation{ref="8" data="citationList"}
|
|
|
|
|
ks:options.uuid,
|
|
|
|
|
xuehao:"202413501062"
|
|
|
|
|
},
|
|
|
|
|
success: (res) => { /* ... */
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let temp=[...res.data.infor]
|
|
|
|
|
res.data.infor.map((value,index)=>{
|
|
|
|
|
if(value.lx==="多选题"){
|
|
|
|
|
if (!temp[index].daan)
|
|
|
|
|
temp[index].daan=[]
|
|
|
|
|
}else if(value.lx==="简答题"){
|
|
|
|
|
if (!temp[index].filelist)
|
|
|
|
|
temp[index].filelist=[]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(temp)
|
|
|
|
|
quizData.value=temp;
|
|
|
|
|
console.log(quizData)
|
|
|
|
|
if(res.data.end==="end"){
|
|
|
|
|
// setTishi("已提交不能再次进入")
|
|
|
|
|
dati_able.value=false
|
|
|
|
|
//clearInterval(timer)
|
|
|
|
|
}else {
|
|
|
|
|
// const seconds=JSON.parse(res.data.information).seconds;
|
|
|
|
|
// let end=moment(res.data.stustart)
|
|
|
|
|
// end.add(seconds,'seconds');
|
|
|
|
|
// endtime.value=end.format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
// console.log(end.format('YYYY-MM-DD HH:mm:ss'))
|
|
|
|
|
startTimer();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
function returndati(){
|
|
|
|
|
showAnswerCardFlag.value = false
|
|
|
|
|
}
|
|
|
|
|
// function uppic(imageUrl,uuid) {
|
|
|
|
|
// return new Promise((resolve, reject) => {
|
|
|
|
|
// uni.chooseMedia({
|
|
|
|
|
// count: 1, //所要上传图片的数量
|
|
|
|
|
// mediaType: ['image'], //所要上传文件的类型
|
|
|
|
|
// sourceType: ['album', 'camera'], //所要上传文件的来源
|
|
|
|
|
// sizeType: ['original', 'compressed'], //所要上传文件是否需要压缩
|
|
|
|
|
// success(res) {
|
|
|
|
|
// const tempFilePath = res.tempFiles[0].tempFilePath
|
|
|
|
|
// uni.uploadFile({
|
|
|
|
|
// url: imageUrl, // 上传图片的接口地址
|
|
|
|
|
// filePath: tempFilePath, //所要上传的图片地址
|
|
|
|
|
// name: 'file', //所要上传的文件类型
|
|
|
|
|
// header: {
|
|
|
|
|
// accept: 'application/json',
|
|
|
|
|
// th: uid.value ,
|
|
|
|
|
// xx: uuid,
|
|
|
|
|
// lx: "kaoshi"
|
|
|
|
|
// },
|
|
|
|
|
// success: (uploadFileRes) => { //成功的回调函数
|
|
|
|
|
// console.log(uploadFileRes);
|
|
|
|
|
// let src=uid.value + "/" + uuid + path.extname(tempFilePath)
|
|
|
|
|
//
|
|
|
|
|
// resolve({value1:uploadFileRes,src:src,lujing:res.tempFiles[0].tempFilePath})
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function scpic(){
|
|
|
|
|
//console.log(uppic("http://localhost:3400/api/uploadtm",fujianuuid.value))
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.quiz-container {
|
|
|
|
|
padding: 5px;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 顶部栏样式 */
|
|
|
|
|
.top-bar {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 3px;
|
|
|
|
|
border-bottom: 1px solid #e0e0e0;
|
|
|
|
|
background-color: #d97e7e;
|
|
|
|
|
}
|
|
|
|
|
.top-bar1 {
|
|
|
|
|
display: inline;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 3px;
|
|
|
|
|
border-bottom: 1px solid #e0e0e0;
|
|
|
|
|
background-color: #d97e7e;
|
|
|
|
|
width: 100vw;
|
|
|
|
|
}
|
|
|
|
|
.question-text1 {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.answer-card-btn1 {
|
|
|
|
|
background-color: #63a2cf;
|
|
|
|
|
border: 1px solid #a8d5ff;
|
|
|
|
|
color: #000;
|
|
|
|
|
padding: 3px 6px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 新增左侧竖线装饰 */
|
|
|
|
|
.question-info1::before {
|
|
|
|
|
content: '';
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 4px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
background-color: #007bff;
|
|
|
|
|
margin-right: 3px;
|
|
|
|
|
}
|
|
|
|
|
.question-text {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.answer-card-btn {
|
|
|
|
|
background-color: #63a2cf;
|
|
|
|
|
border: 1px solid #a8d5ff;
|
|
|
|
|
color: #000;
|
|
|
|
|
padding: 3px 6px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
background-color: #4490ca;
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 新增左侧竖线装饰 */
|
|
|
|
|
.question-info::before {
|
|
|
|
|
content: '';
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 4px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
background-color: #007bff;
|
|
|
|
|
margin-right: 3px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.question {
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column; /* 设置主轴为纵向 */
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.question-text {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.option {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin: 5px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.option-image {
|
|
|
|
|
width: 50px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.result {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.answer-card {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-item-choose {
|
|
|
|
|
padding: 8px;
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
background-color: #0ef306;
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
}
|
|
|
|
|
.card-item-nochoose {
|
|
|
|
|
padding: 8px;
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
background-color: #fcffea;
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
}
|
|
|
|
|
.card-item-choose-noprint {
|
|
|
|
|
padding: 8px;
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
background-color: #fbfbfb;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.score-and-answer {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
background-color: #f0f0f0;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bottom-controls {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
padding: 5px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bottom-controls button {
|
|
|
|
|
padding: 5px 10px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background-color: #f0f0f0;
|
|
|
|
|
color: #333;
|
|
|
|
|
border: none;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bottom-controls button:hover {
|
|
|
|
|
background-color: #e0e0e0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.bottom-controls button[type="primary"] {
|
|
|
|
|
background-color: #2196f3;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
.question-image{
|
|
|
|
|
margin-left: 35px;
|
|
|
|
|
}
|
|
|
|
|
.bottom-controls button[type="primary"]:hover {
|
|
|
|
|
background-color: #1976d2;
|
|
|
|
|
}
|
|
|
|
|
.choose-button{
|
|
|
|
|
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 3vw;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
height: 14vw;
|
|
|
|
|
width: 14vw;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.choose-wborpic{
|
|
|
|
|
position: relative;
|
|
|
|
|
left: 17vw;
|
|
|
|
|
top: 1vh;
|
|
|
|
|
}
|
|
|
|
|
.choose-image{
|
|
|
|
|
|
|
|
|
|
height: 12vh;
|
|
|
|
|
|
|
|
|
|
max-width: 70vw;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: -2vh;
|
|
|
|
|
}
|
|
|
|
|
.choose-xx{
|
|
|
|
|
|
|
|
|
|
margin-bottom: 40px;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.tkt-input {
|
|
|
|
|
border: 1rpx solid black;
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
padding: 10rpx 20rpx;
|
|
|
|
|
margin: 20rpx 0;
|
|
|
|
|
width: 60vw;
|
|
|
|
|
color: #00f0ff;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
position: relative;
|
|
|
|
|
top: 24px;
|
|
|
|
|
left: 10px;
|
|
|
|
|
}
|
|
|
|
|
.xuhao{
|
|
|
|
|
width: 35px;
|
|
|
|
|
height: 35px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
background-color: #4a90e2;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.xuhao_wb{
|
|
|
|
|
display: inline-block;
|
|
|
|
|
font-size:25px;
|
|
|
|
|
margin-left: 6px;
|
|
|
|
|
}
|
|
|
|
|
.print-wb{
|
|
|
|
|
display: inline-block;
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
}
|
|
|
|
|
.grid-container-pd
|
|
|
|
|
{
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
margin-left: 60px;
|
|
|
|
|
}
|
|
|
|
|
.grid-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
margin-left: 10vw;
|
|
|
|
|
}
|
|
|
|
|
.grid-item {
|
|
|
|
|
width: calc(25% - 10px); /* 每个项目宽度为25%,减去间距 */
|
|
|
|
|
|
|
|
|
|
margin: 5px; /* 项目之间的间距 */
|
|
|
|
|
|
|
|
|
|
box-sizing: border-box; /* 确保padding和border不会影响宽度 */
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.choose-button1{
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
height: 18vw;
|
|
|
|
|
width: 18vw;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center; /* 水平居中 */
|
|
|
|
|
align-items: center; /* 垂直居中 */
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
.container1 {
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-info {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
margin-bottom: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
|
width: 120rpx;
|
|
|
|
|
height: 120rpx;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
margin-right: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-text {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.username {
|
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin-bottom: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-id {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #999;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.score-card {
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-header {
|
|
|
|
|
margin-bottom: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-title {
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
display: block;
|
|
|
|
|
margin-bottom: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-subtitle {
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #999;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.score-content {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.score-item {
|
|
|
|
|
flex: 1;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.score-label {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #666;
|
|
|
|
|
display: block;
|
|
|
|
|
margin-bottom: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.score-value {
|
|
|
|
|
font-size: 40rpx;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #07c160;
|
|
|
|
|
}
|
|
|
|
|
.dtk-left{
|
|
|
|
|
display:flex ;
|
|
|
|
|
flex-direction:column;
|
|
|
|
|
}
|
|
|
|
|
.dtk-right {
|
|
|
|
|
display:flex;
|
|
|
|
|
position: absolute; /* 绝对定位 */
|
|
|
|
|
right: 5px; /* 右对齐 */
|
|
|
|
|
align-items: end; /* 使子元素垂直对齐到容器的底部 */
|
|
|
|
|
}
|
|
|
|
|
.dtk-top {
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 100vw;
|
|
|
|
|
}
|
|
|
|
|
.dtk-print-stu{
|
|
|
|
|
font-size: 25px;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.dtk-print-all{
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
position: relative;
|
|
|
|
|
top: 12px;
|
|
|
|
|
}
|
|
|
|
|
.dtk-print-title{
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
position: relative;
|
|
|
|
|
top: 12px;
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
}
|
|
|
|
|
.stuname{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.stuxuehao{
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
}
|
|
|
|
|
.tm-list{
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.return-button{
|
|
|
|
|
width: 80vw;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
color: green;
|
|
|
|
|
border: 3px solid green;
|
|
|
|
|
}
|
|
|
|
|
.duoxuanti_all{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.danxuanti_all{
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
}
|
|
|
|
|
</style>
|