功能修改

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> <el-button type="primary">确认</el-button>
</div> </div>
<div class="tz-line2"> <div class="tz-line2">
<el-button :loading="downloadLoading" style="margin:0 0 20px 0;" type="primary" icon="el-icon-download" @click="handleDownload"> <el-button :loading="downloadLoading" style="margin:0 0 20px 0;" type="primary" icon="el-icon-download" @click="handleDownload">
批量导入模板下载 批量导入模板下载
</el-button> </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"> <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"> <input ref="uploadExcel" type="file" accept=".xlsx" style="display:none;" @change="uploadExcel">
@ -55,7 +60,7 @@
<script> <script>
import * as questionApi from '@/api/question' import * as questionApi from '@/api/question'
import * as course from '@/api/course'
export default { export default {
filters: { filters: {
statusFilter(status) { statusFilter(status) {
@ -83,6 +88,8 @@ export default {
create: 'Create' create: 'Create'
}, },
dialogFormVisible: false, dialogFormVisible: false,
courseId: null,
courseOptions: [],
provincOtions: [{ provincOtions: [{
id: '1', id: '1',
name: '北京' name: '北京'
@ -106,7 +113,12 @@ export default {
}, },
methods: { methods: {
fetchData() { 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) { beforeUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 1 const isLt1M = file.size / 1024 / 1024 < 1
@ -150,7 +162,7 @@ export default {
const rawFile = files[0] // only use files[0] const rawFile = files[0] // only use files[0]
questionApi.importQuestion({ questionApi.importQuestion({
file: rawFile, file: rawFile,
courseId: 6, courseId: this.courseId,
levelId: 0 levelId: 0
}).then(res=>{ }).then(res=>{
if(res.code == 200){ if(res.code == 200){

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

Binary file not shown.

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

Loading…
Cancel
Save