mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-07 01:46:42 +08:00
Merge branch 'master_1008' into dev_master
This commit is contained in:
@@ -72,6 +72,9 @@ const querypaper = function(data) {
|
||||
const getPaperContent = function(id) {
|
||||
return ajax.get('/xboe/m/exam/paper/paper-content?id=' + id);
|
||||
}
|
||||
const newPaperContent = function(id){
|
||||
return ajax.get('/xboe/m/course/content/exam/paper-content?courseExamId='+id);
|
||||
}
|
||||
export default {
|
||||
detail,
|
||||
update,
|
||||
@@ -80,6 +83,7 @@ export default {
|
||||
querylist,
|
||||
querypaper,
|
||||
getPaperContent,
|
||||
newPaperContent,
|
||||
batchImportCount,
|
||||
batchImportData
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 362 KiB After Width: | Height: | Size: 69 KiB |
@@ -85,6 +85,28 @@
|
||||
<el-form-item label="考试说明">
|
||||
<el-input type="textarea" show-word-limit v-model="examInfo.info" placeholder="关于考试的说明(限255字以内)" maxlength="255"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="随机模式">
|
||||
<el-col :span="4">
|
||||
<el-radio-group v-model="examInfo.randomMode">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="20" v-if="examInfo.randomMode&&examInfo.paperType==1">
|
||||
<el-form-item label="数量">
|
||||
<el-input-number v-model="examInfo.qnum" :min="1" :max="examPaper.items.length" label="数量"></el-input-number>
|
||||
<span style="margin-left:10px;" v-if="examPaper.items.length==0">先添加试题</span>
|
||||
<span style="margin-left:10px;" v-if="examPaper.items.length>0">试卷有 {{examPaper.items.length}} 道试题</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20" v-if="examInfo.randomMode&&examInfo.paperType==2">
|
||||
<el-form-item label="数量">
|
||||
<el-input-number v-model="examInfo.qnum" :min="1" :max="usePaper.counts" label="数量"></el-input-number>
|
||||
<span style="margin-left:10px;" v-if="usePaper.counts==0">先选择试卷</span>
|
||||
<span style="margin-left:10px;" v-if="usePaper.counts>0">试卷有 {{usePaper.counts}} 道试题</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-if="examInfo.paperType==1">
|
||||
@@ -285,7 +307,9 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!this.examInfo.randomMode){
|
||||
this.examInfo.qnum = 0
|
||||
}
|
||||
this.$emit("save",this.examInfo);
|
||||
},
|
||||
deleteExam(){ //删除
|
||||
@@ -294,6 +318,8 @@
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.examInfo.randomMode = false;
|
||||
this.examInfo.qnum = 0;
|
||||
this.$emit("remove",this.examInfo);
|
||||
}).catch(() => {
|
||||
|
||||
|
||||
@@ -326,12 +326,11 @@ export default {
|
||||
return qitems;
|
||||
},
|
||||
startTest(){
|
||||
if(this.info.paperType==2){
|
||||
apiExamPaper.getPaperContent(this.info.paperId).then(rs=>{
|
||||
if(rs.status=200){
|
||||
this.examPaper.json=JSON.parse(rs.result);
|
||||
//console.log(this.examPaper.json,'this.examPaper.json');
|
||||
let qitems=this.convertToItems(this.examPaper.json);
|
||||
apiExamPaper.newPaperContent(this.info.id).then(res=>{
|
||||
if(res.error == ''&&res.result != ''){
|
||||
if(this.info.paperType==2){
|
||||
this.examPaper.json=res.result;
|
||||
let qitems=this.convertToItems(this.examPaper.json);
|
||||
this.paper ={items:qitems};
|
||||
this.total=qitems.length;
|
||||
this.curItem=qitems[this.curIndex];
|
||||
@@ -340,34 +339,74 @@ export default {
|
||||
this.timer=setInterval(this.changeTimer,60000);
|
||||
this.testStart=true;
|
||||
}else{
|
||||
this.$message.error('加载试卷内容失败,请与管理员联系,试卷是否已删除');
|
||||
}
|
||||
})
|
||||
}else{
|
||||
let paper= JSON.parse(this.info.paperContent);
|
||||
paper.items.forEach(item=>{
|
||||
//console.log(item);
|
||||
if(item.type==101){
|
||||
item.userAnswer='';
|
||||
}else if(item.type==102){
|
||||
item.userAnswer=[];
|
||||
}else{
|
||||
item.userAnswer=''
|
||||
}
|
||||
item.options.forEach(opt=>{
|
||||
opt.checked=false;
|
||||
})
|
||||
});
|
||||
this.total=paper.items.length;
|
||||
this.paper =paper;
|
||||
//console.log(this.paper);
|
||||
let paper= {items:res.result};
|
||||
paper.items.forEach(item=>{
|
||||
if(item.type==101){
|
||||
item.userAnswer='';
|
||||
}else if(item.type==102){
|
||||
item.userAnswer=[];
|
||||
}else{
|
||||
item.userAnswer=''
|
||||
}
|
||||
item.options.forEach(opt=>{
|
||||
opt.checked=false;
|
||||
})
|
||||
});
|
||||
this.total=paper.items.length;
|
||||
this.paper =paper;
|
||||
|
||||
this.curItem=paper.items[this.curIndex];
|
||||
this.startTime=new Date();//记录开始时间
|
||||
this.timerValue=this.info.testDuration;
|
||||
this.timer=setInterval(this.changeTimer,60000);
|
||||
this.testStart=true;
|
||||
}
|
||||
this.curItem=paper.items[this.curIndex];
|
||||
this.startTime=new Date();//记录开始时间
|
||||
this.timerValue=this.info.testDuration;
|
||||
this.timer=setInterval(this.changeTimer,60000);
|
||||
this.testStart=true;
|
||||
}
|
||||
}else{
|
||||
this.$message.error('加载试卷内容失败,请与管理员联系,试卷是否已删除');
|
||||
}
|
||||
})
|
||||
// if(this.info.paperType==2){
|
||||
// apiExamPaper.getPaperContent(this.info.paperId).then(rs=>{
|
||||
// if(rs.status=200){
|
||||
// this.examPaper.json=JSON.parse(rs.result);
|
||||
// //console.log(this.examPaper.json,'this.examPaper.json');
|
||||
// let qitems=this.convertToItems(this.examPaper.json);
|
||||
// this.paper ={items:qitems};
|
||||
// this.total=qitems.length;
|
||||
// this.curItem=qitems[this.curIndex];
|
||||
// this.startTime=new Date();//记录开始时间
|
||||
// this.timerValue=this.info.testDuration;
|
||||
// this.timer=setInterval(this.changeTimer,60000);
|
||||
// this.testStart=true;
|
||||
// }else{
|
||||
// this.$message.error('加载试卷内容失败,请与管理员联系,试卷是否已删除');
|
||||
// }
|
||||
// })
|
||||
// }else{
|
||||
// let paper= JSON.parse(this.info.paperContent);
|
||||
// paper.items.forEach(item=>{
|
||||
// //console.log(item);
|
||||
// if(item.type==101){
|
||||
// item.userAnswer='';
|
||||
// }else if(item.type==102){
|
||||
// item.userAnswer=[];
|
||||
// }else{
|
||||
// item.userAnswer=''
|
||||
// }
|
||||
// item.options.forEach(opt=>{
|
||||
// opt.checked=false;
|
||||
// })
|
||||
// });
|
||||
// this.total=paper.items.length;
|
||||
// this.paper =paper;
|
||||
// //console.log(this.paper);
|
||||
|
||||
// this.curItem=paper.items[this.curIndex];
|
||||
// this.startTime=new Date();//记录开始时间
|
||||
// this.timerValue=this.info.testDuration;
|
||||
// this.timer=setInterval(this.changeTimer,60000);
|
||||
// this.testStart=true;
|
||||
// }
|
||||
},
|
||||
chooseOption(opt){
|
||||
if(this.curItem.type==101 || this.curItem.type==103){
|
||||
|
||||
@@ -401,6 +401,28 @@
|
||||
<el-form-item label="考试说明">
|
||||
<el-input type="textarea" show-word-limit v-model="exam.info.info" placeholder="关于考试的说明(限255字以内)" maxlength="255"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="随机模式">
|
||||
<el-col :span="4">
|
||||
<el-radio-group v-model="exam.info.randomMode">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="20" v-if="exam.info.randomMode&&exam.info.paperType==1">
|
||||
<el-form-item label="数量">
|
||||
<el-input-number v-model="exam.info.qnum" :min="1" :max="exam.paperJson.items.length" label="数量"></el-input-number>
|
||||
<span style="margin-left:10px;" v-if="exam.paperJson.items.length==0">先添加试题</span>
|
||||
<span style="margin-left:10px;" v-if="exam.paperJson.items.length>0">试卷有 {{exam.paperJson.items.length}} 道试题</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20" v-if="exam.info.randomMode&&exam.info.paperType==2">
|
||||
<el-form-item label="数量">
|
||||
<el-input-number v-model="exam.info.qnum" :min="1" :max="usePaper.counts" label="数量"></el-input-number>
|
||||
<span style="margin-left:10px;" v-if="usePaper.counts==0">先选择试卷</span>
|
||||
<span style="margin-left:10px;" v-if="usePaper.counts>0">试卷有 {{usePaper.counts}} 道试题</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-if="exam.info.paperType==1">
|
||||
@@ -1059,12 +1081,14 @@
|
||||
if(this.exam.info.paperType==2){
|
||||
if(!this.exam.info.paperId){
|
||||
this.$message.error("您还未选择任何试卷");
|
||||
this.loading=false;
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
//检查是不是所有的试题都有了答案
|
||||
if(this.exam.paperJson.items.length==0){
|
||||
this.$message.error("您还没有添加考试的试题");
|
||||
this.loading=false;
|
||||
return;
|
||||
}
|
||||
let pass=true;
|
||||
@@ -1087,6 +1111,9 @@
|
||||
}
|
||||
this.exam.info.paperContent=JSON.stringify(this.exam.paperJson);
|
||||
}
|
||||
if(!this.exam.info.randomMode){
|
||||
this.exam.info.qnum = 0
|
||||
}
|
||||
postData.exam=this.exam.info;
|
||||
postData.content.contentName='考试';
|
||||
this.examChange = deepClone(this.exam);
|
||||
@@ -1152,6 +1179,8 @@
|
||||
postData.id=this.exam.content.id;
|
||||
postData.ctype=this.exam.content.contentType;
|
||||
curContent=this.exam.content;
|
||||
this.exam.info.randomMode = false;
|
||||
this.exam.info.qnum = 0
|
||||
}else if(index==4){
|
||||
postData.id=this.assess.content.id;
|
||||
postData.ctype=this.assess.content.contentType;
|
||||
|
||||
@@ -373,6 +373,17 @@ export default {
|
||||
this.isCursorStatic = false;
|
||||
this.timeoutControlsHint = 2000;
|
||||
});
|
||||
this.videoDom.addEventListener('loadstart', function(){
|
||||
console.log('\x1b[34m%s\x1b[0m','*****************视频加载中**************')
|
||||
})
|
||||
|
||||
this.videoDom.addEventListener('loadeddata', function(){
|
||||
console.log('\x1b[32m%s\x1b[0m','*****************加载完毕*************')
|
||||
})
|
||||
|
||||
this.videoDom.addEventListener('error', function(){
|
||||
console.log('\x1b[31m%s\x1b[0m','*****************加载失败**********')
|
||||
})
|
||||
// 监听全屏事件的变化,保存数据
|
||||
window.addEventListener("fullscreenchange", () => {
|
||||
this.isFullscreen = this.isFullScreen();
|
||||
|
||||
@@ -423,6 +423,7 @@ export function translate(field) {
|
||||
let name = '';
|
||||
switch (field) {
|
||||
case 'total':name = '累计'; break;
|
||||
case 'now':name = '当前'; break;
|
||||
case 'weeks':name = '本周'; break;
|
||||
case 'months':name = '本月'; break;
|
||||
case 'years':name = '本年'; break;
|
||||
|
||||
@@ -118,7 +118,7 @@ export default {
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '认证讲师库(2023)';
|
||||
content: '认证讲师库';
|
||||
position: absolute;
|
||||
bottom: 25px;
|
||||
left: 180px;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user