修改考试控制及scorm课件部分

This commit is contained in:
daihh
2023-01-03 18:18:26 +08:00
parent e404e980a5
commit 3af2d10631
6 changed files with 93 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ let tokenName='';
let appId=''
let fileUrl='';
let version=1;
let scormPlayer='';
if(process.env.NODE_ENV === 'development'){
//本地开发环境
@@ -16,8 +17,9 @@ if(process.env.NODE_ENV === 'development'){
oldApiBaseUrl = '/uboeApi';
statApiBaseUrl='/statApi';
socialApiBaseUrl='/socialApi';
fileUrl = 'http://192.168.0.11:9090/cdn/upload';
fileUrl = 'http://127.0.0.1:9090/cdn/upload';
loginPath='/pages/login/login';
scormPlayer='http://localhost:9083/scorm-player';
}else if(process.env.ENV_TYPE === 'preview'){
// 预发布环境,当前配置未使用上
context='/mobile-release';
@@ -27,6 +29,7 @@ if(process.env.NODE_ENV === 'development'){
socialApiBaseUrl='/socialApi';
fileUrl = 'https://u.boe.com/upload';
loginPath='https://u.boe.com/m/loginuser';
scormPlayer='https://u.boe.com/newscorm/scorm-player';
}else if(process.env.ENV_TYPE === 'testing'){
// 测试环境
apiBaseUrl = '/systemapi';
@@ -35,6 +38,7 @@ if(process.env.NODE_ENV === 'development'){
socialApiBaseUrl='/socialApi';
fileUrl = 'https://u-pre.boe.com/upload';
loginPath='https://u-pre.boe.com/m/loginuser';
scormPlayer='https://u-pre.boe.com/newscorm/scorm-player';
}else{
// 生产环境
apiBaseUrl = '/systemapi';
@@ -43,6 +47,7 @@ if(process.env.NODE_ENV === 'development'){
socialApiBaseUrl='/socialApi';
fileUrl = 'https://u.boe.com/upload';
loginPath='https://u.boe.com/m/loginuser';
scormPlayer='https://u.boe.com/newscorm/scorm-player';
}
export default {
@@ -55,4 +60,5 @@ export default {
loginPath:loginPath,
fileUrl:fileUrl,
version:version,
scormPlayer:scormPlayer
}

View File

@@ -21,8 +21,11 @@
<view v-if="tipText!=''" style="text-align: center;color:red">
<text>{{tipText}}</text>
</view>
<view v-else>
<u-button type="primary" :disabled="startButton" v-if="testStatus == 1" @click="startTest()">{{btnText}}</u-button>
<view v-else style="text-align: center;">
<view v-if="testPaper.enabled">
<u-button type="primary" :disabled="startButton" v-if="testStatus == 1" @click="startTest()">{{btnText}}</u-button>
</view>
<view v-else style="color: #666666;">此考试已下架</view>
</view>
</view>
<view v-if="examStatus==2" style="text-align: center;color:#6d6d6d; ">考试已结束</view>
@@ -62,7 +65,12 @@
</view>
<!--试题内容-->
<view class="qitem">
<view class="qitem-info">[{{getQuestionType(curItem.type)}}]{{curItem.title}}</view>
<view class="qitem-info">
<view>[{{getQuestionType(curItem.type)}}]{{curItem.title}}</view>
<view v-if="curItem.images" class="qimg">
<img class="qimg-fit" :src="imageBaseUrl+curItem.images"/>
</view>
</view>
<view v-if="curItem.type == 3">
<view class="qitem-opts">
<view class="qitem-opt" :class="{check:curItem.userAnswer == 'true'}"
@@ -84,12 +92,18 @@
{{toLetter(optIdx+1)}}.{{opt.content}}
<u-icon v-if="opt.id==curItem.userAnswer" name="checkbox-mark" color="#00aa00"></u-icon>
</view>
<view v-if="opt.images" class="qimg">
<img class="qimg-fit" :src="imageBaseUrl+opt.images"/>
</view>
</view>
<view class="qitem-opts" v-if="curItem.type == 2">
<view class="qitem-opt" :class="{check:(curItem.userAnswer && curItem.userAnswer.indexOf(opt.id) > -1)}" @click="chooseOption(opt)">
{{toLetter(optIdx+1)}}.{{opt.content}}
<u-icon v-if="curItem.userAnswer && curItem.userAnswer.indexOf(opt.id) > -1" name="checkbox-mark" color="#00aa00"></u-icon>
</view>
<view v-if="opt.images" class="qimg">
<img class="qimg-fit" :src="imageBaseUrl+opt.images"/>
</view>
</view>
</view>
</view>
@@ -123,6 +137,7 @@
</template>
<script>
import config from '@/config/index.js'
import apiTestPaper from '@/api/modules/testPaper.js'
import { correctJudgment, numberToLetter, examType,toScoreTow } from '@/utils/tools.js';
import { formatDate, formatSeconds } from '@/utils/index.js';
@@ -132,6 +147,7 @@
return {
toScoreTow,
startButton: false,
imageBaseUrl:config.fileUrl,
examId: '', //考试的id
taskId: '', //考试任务的id
lastId: '', //最后一次提交的答卷
@@ -817,4 +833,11 @@
// display: flex;
// justify-content: space-around;
}
.qimg{
width:100%;
.qimg-fit{
width:100%;
object-fit:scale-down
}
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<!--考试页面用户在此页面一个试题一个试题的回答-->
<!--考试页面此页面是备份 未使用到-->
<view>
<u-toast ref="messager"></u-toast>
<view style="text-align: center;padding: 10px;"><text class="title-name">{{testPaper.testName}}</text></view>

View File

@@ -179,11 +179,13 @@
import apiMessage from '@/api/system/message.js'
import {toScore} from '@/utils/tools.js'
import apiBoeCourse from '@/api/boe/course.js'
import apiUserGroup from "@/api/modules/usergroup.js";
import apiYearMedal from '@/api/phase2/yearMedal.js'
import { mapGetters,mapActions} from 'vuex';
export default {
data(){
return {
audiences:[],
noPageList: true,//判断接口是否还有数据
noDataList: true,//判断接口是否还有数据
msgNum:0,

View File

@@ -277,6 +277,8 @@
import {toScore} from '@/utils/tools.js'
import apiArticle from '@/api/modules/article.js'
import apiBoeCourse from '@/api/boe/course.js'
import apiUserGroup from "@/api/modules/usergroup.js";
import { mapGetters } from 'vuex'
export default{
data(){
return{
@@ -336,9 +338,32 @@
this.conType=1;
}
this.loadSeachWords();
if(this.audiences.length==0){
//let hasIds;
// let hasIds=sessionStorage.getItem(localKey);
// if(hasIds && hasIds.length>0){
// this.audiences=hasIds.split(",");
// this.search();
// }else{
//console.log(this.userInfo,'this.userInfo')
Promise.all([apiBoeCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
//console.log(rs,'rs');
let aids=[];
if(rs[0].status==200){
aids.push(rs[0].result);
}
if(rs[1].status==200){
aids.push(rs[1].result);
}
this.audiences=aids;
//sessionStorage.setItem(localKey,this.audiences);
//this.search();
})
//}
}
},
computed:{
...mapGetters(['userInfo'])
},
onPullDownRefresh() {
this.onReachBottom();
@@ -553,6 +578,7 @@
async loadCourseData(){
uni.showLoading({title:'加载中...'});
this.course.params.keyword=this.keyword;
this.course.params.audiences=this.audiences.join(',');
//查询课程
let $this=this;
let dataList = [];

View File

@@ -82,6 +82,9 @@
</view>
<view v-if="articleMore" @click="showMore" style="text-align: center;color: #387DF7;"><text>查看更多</text> </view>
</view>
<div v-if="curContent.contentType == 50" style="min-height: 500px;">
<web-view v-if="scormUrl" :src="scormUrl" frameborder="0" scrolling="no" border="0px" style="width:100%;height:100%;border:0px;"></web-view>
</div>
<view v-if="curContent.contentType==52">
<!--外连接-->
<view v-if="conLink.url!=''" style="min-height: 400px;position: relative;">
@@ -395,6 +398,7 @@
</template>
<script>
import config from '@/config/index.js'
import apiCoursePortal from '@/api/modules/coursePortal.js'
import apiCourseStudy from '@/api/modules/courseStudy.js'
import apiVideoStudy from "@/api/modules/videoStudy.js";
@@ -473,7 +477,8 @@
localTimeKey:'boeu-study-time' ,//本地存储的学习时长的key json格式
localTimeValue:0,//计算的时间
appendStudyOtherHandle:null,
articleMore:true
articleMore:true,
scormUrl:'',
}
},
computed: {
@@ -813,6 +818,7 @@
},
//更换播放内容
changePlayRes(con){
this.scormUrl='';//清空地址
this.articleMore=true;
this.clearTimeHandle();
// console.log(con,'con');
@@ -831,6 +837,29 @@
}
});
}
}else if(con.contentType==50){ //scorm课件的内容
apiCourseFile.detail(con.contentRefId).then(cfrs => {
if(cfrs.status==200){
//this.curCFile = cfrs.result;
//this.scormUrl=cfrs
let pars='?mode=normal&r='+Math.random();
pars+='&scormId='+cfrs.result.id;
pars+='&courseId='+this.courseId;
pars+='&contentId='+con.id;
pars+='&studentId='+this.userInfo.aid;
pars+='&studentName='+encodeURIComponent(this.userInfo.name);
pars+='&lmsId='+this.studyId;
pars+='&scoId=';//不指定scorm模块自动根据学习记录定位
let urlPre=window.location.protocol;
let configUrl=config.scormPlayer;
configUrl=urlPre+configUrl.substring(configUrl.indexOf(':')+1);
this.scormUrl=configUrl+pars;//播放的首页
}
});
}else if(con.contentType==52){
if(con.content.startsWith('\{')){
this.conLink=JSON.parse(con.content);