功能修改

master
tianea 3 years ago
parent 920be2f0d9
commit 35e4aa91f3

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -5,10 +5,15 @@
<el-button type="primary">确认</el-button>
</div>
<div class="tz-line2">
<el-button :loading="downloadLoading" style="margin:0 0 20px 0;" type="primary" icon="el-icon-download" @click="handleDownload">
批量导入模板下载
</el-button>
<el-select v-model="courseId" class="filter-item" placeholder="请选择归属课程">
<el-option v-for="item in courseOptions" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<el-button :loading="uploading" style="margin:0 20px 20px 20px;" type="primary" icon="el-icon-upload" @click="handelUpload">
批量导入
<input ref="uploadExcel" type="file" accept=".xlsx" style="display:none;" @change="uploadExcel">
@ -55,7 +60,7 @@
<script>
import * as questionApi from '@/api/question'
import * as course from '@/api/course'
export default {
filters: {
statusFilter(status) {
@ -83,6 +88,8 @@ export default {
create: 'Create'
},
dialogFormVisible: false,
courseId: null,
courseOptions: [],
provincOtions: [{
id: '1',
name: '北京'
@ -106,7 +113,12 @@ export default {
},
methods: {
fetchData() {
// this.listLoading = true
course.getList({pageNo: 0, pageSize: 1000}).then(res=>{
if(res.code==200){
this.courseOptions = res.data.page.content
}
this.listLoading = false
})
},
beforeUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 1
@ -150,7 +162,7 @@ export default {
const rawFile = files[0] // only use files[0]
questionApi.importQuestion({
file: rawFile,
courseId: 6,
courseId: this.courseId,
levelId: 0
}).then(res=>{
if(res.code == 200){

@ -3,8 +3,8 @@
<div class="filter-container">
<el-form>
<el-form-item label="课程筛选">
<el-select v-model="listQuery.couserId" >
<el-option v-for="item in cousrseOptions" :key="item.id" :value="item.name">{{ item.name }}</el-option>
<el-select v-model="listQuery.courseId" >
<el-option v-for="item in cousrseOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-input v-model="listQuery.stem" style="width: 200px;" placeholder="题干/题目ID" />
<el-button @click="fetchData"></el-button>
@ -13,7 +13,7 @@
</el-form>
<el-button @click="$router.push({ path: '/resource/exam/add'})" >新增</el-button>
<el-button>批量导入</el-button>
<el-button @click="$router.push({ path: '/resource/exam/batch'})" >批量导入</el-button>
<el-button @click="batch(1)"></el-button>
<el-button @click="batch(0)"></el-button>

Binary file not shown.

@ -40,7 +40,7 @@
单选题
</div>
<div class="tz-exam-box-content">
<span v-for="(item,$index) in singleQuestion" :key="$index" :class="getStatus(item.id)" @click="anchor(item.id)" > {{ item.id }} </span>
<span v-for="(item,$index) in singleQuestion" :key="$index" :class="getStatus(item)" @click="anchor(item.id)" > {{ item.id }} </span>
</div>
</div>
<div class="tz-exam-box">
@ -49,7 +49,7 @@
多选题
</div>
<div class="tz-exam-box-content">
<span v-for="(item,$index) in multiQuestion" :key="$index" :class="getStatus(item.id)" @click="anchor(item.id)" > {{ item.id }} </span>
<span v-for="(item,$index) in multiQuestion" :key="$index" :class="getStatus(item)" @click="anchor(item.id)" > {{ item.id }} </span>
</div>
</div>
<div class="tz-exam-box">
@ -58,7 +58,7 @@
判断题
</div>
<div class="tz-exam-box-content">
<span v-for="(item,$index) in judgeQuestion" :key="$index" :class="getStatus(item.id)" @click="anchor(item.id)" > {{ item.id }} </span>
<span v-for="(item,$index) in judgeQuestion" :key="$index" :class="getStatus(item)" @click="anchor(item.id)" > {{ item.id }} </span>
</div>
</div>
<!-- <div class="tz-exam-box-tips">
@ -251,18 +251,32 @@ export default {
}
},
methods:{
getStatus(id){
let c = "";
if(id == this.current){
c = "current "
}
if(this.markList.indexOf(id)>=0){
return c +" sign"
getStatus(cq){
console.log(cq.item)
var myAnswer = this.getMyAnswer(cq.item.id,0)
if(myAnswer == ''){
return "not_anwser";
}
if(this.doneList.indexOf(id)>=0){
return c+ " done"
var rightAnswer = this.getRightAnswer(cq.item,0)
console.log("my:"+myAnswer,"right:"+rightAnswer)
if(myAnswer == rightAnswer){
return "right";
}
return c +" notAnwser";
return "wrong";
// let c = "";
// if(id == this.current){
// c = "current "
// }
// if(this.markList.indexOf(id)>=0){
// return c +" sign"
// }
// if(this.doneList.indexOf(id)>=0){
// return c+ " done"
// }
// return c +" notAnwser";
},
changeTab(id){
this.tabId = id
@ -661,14 +675,19 @@ export default {
margin-top: 1rem;
}
.done {
background-color: #e1e4ec !important;
.right {
background-color: white !important;
color: black !important;
}
.notAnwser{
.wrong{
background-color: #e64d50 !important;
color: white !important;
}
.not_answer {
background-color: #e1e4ec !important;
color: black !important;
}
.sign{
background-color: #0260ca !important;
color: white !important;

Loading…
Cancel
Save