mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-09 02:46:46 +08:00
Merge branch 'third'
This commit is contained in:
@@ -94,9 +94,11 @@
|
|||||||
this.loadRecord();
|
this.loadRecord();
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
studyId(newVal){
|
content(newObj){
|
||||||
|
this.loadExamInfo();
|
||||||
this.loadRecord();
|
this.loadRecord();
|
||||||
}
|
},
|
||||||
|
deep:true
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadExamInfo(){
|
loadExamInfo(){
|
||||||
@@ -125,24 +127,25 @@
|
|||||||
if(this.studyId==''){
|
if(this.studyId==''){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.loadExamContent();
|
this.records=[];
|
||||||
if(this.records.length==0){
|
this.loadExamContent();
|
||||||
let params={
|
//if(this.records.length==0){
|
||||||
studyId:this.studyId,
|
let params={
|
||||||
contentId:this.content.id
|
studyId:this.studyId,
|
||||||
}
|
contentId:this.content.id
|
||||||
apiStudy.myExamList2(params).then(examRs=>{
|
|
||||||
if(examRs.status==200){
|
|
||||||
this.records=examRs.result;
|
|
||||||
let len=examRs.result.length;
|
|
||||||
if(this.info.times>len){
|
|
||||||
this.allowSubmit=true;
|
|
||||||
}else{
|
|
||||||
this.allowSubmit=false;
|
|
||||||
}
|
}
|
||||||
}
|
apiStudy.myExamList2(params).then(examRs=>{
|
||||||
})
|
if(examRs.status==200){
|
||||||
}
|
this.records=examRs.result;
|
||||||
|
let len=examRs.result.length;
|
||||||
|
if(this.info.times>len){
|
||||||
|
this.allowSubmit=true;
|
||||||
|
}else{
|
||||||
|
this.allowSubmit=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//}
|
||||||
},
|
},
|
||||||
startTest(){
|
startTest(){
|
||||||
//转向详细页面
|
//转向详细页面
|
||||||
|
|||||||
@@ -92,14 +92,12 @@
|
|||||||
this.loadHomeworkInfo();
|
this.loadHomeworkInfo();
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
studyId(newVal){
|
|
||||||
this.loadHomeworkInfo();
|
|
||||||
},
|
|
||||||
content(newVal,oldVal){
|
content(newVal,oldVal){
|
||||||
if(newVal.id!=oldVal.id){
|
if(newVal.id!=oldVal.id){
|
||||||
this.loadHomeworkInfo();
|
this.loadHomeworkInfo();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
deep:true
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadHomeworkInfo(){
|
loadHomeworkInfo(){
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ let tokenName='';
|
|||||||
let appId=''
|
let appId=''
|
||||||
let fileUrl='';
|
let fileUrl='';
|
||||||
let version=1;
|
let version=1;
|
||||||
|
let scormPlayer='';
|
||||||
|
|
||||||
if(process.env.NODE_ENV === 'development'){
|
if(process.env.NODE_ENV === 'development'){
|
||||||
//本地开发环境
|
//本地开发环境
|
||||||
@@ -16,8 +17,9 @@ if(process.env.NODE_ENV === 'development'){
|
|||||||
oldApiBaseUrl = '/uboeApi';
|
oldApiBaseUrl = '/uboeApi';
|
||||||
statApiBaseUrl='/statApi';
|
statApiBaseUrl='/statApi';
|
||||||
socialApiBaseUrl='/socialApi';
|
socialApiBaseUrl='/socialApi';
|
||||||
fileUrl = 'http://192.168.0.11:9090/cdn/upload';
|
fileUrl = 'http://127.0.0.1:9090/cdn/upload';
|
||||||
loginPath='/pages/login/login';
|
loginPath='/pages/login/login';
|
||||||
|
scormPlayer='http://localhost:9083/scorm-player';
|
||||||
}else if(process.env.ENV_TYPE === 'preview'){
|
}else if(process.env.ENV_TYPE === 'preview'){
|
||||||
// 预发布环境,当前配置未使用上
|
// 预发布环境,当前配置未使用上
|
||||||
context='/mobile-release';
|
context='/mobile-release';
|
||||||
@@ -27,6 +29,7 @@ if(process.env.NODE_ENV === 'development'){
|
|||||||
socialApiBaseUrl='/socialApi';
|
socialApiBaseUrl='/socialApi';
|
||||||
fileUrl = 'https://u.boe.com/upload';
|
fileUrl = 'https://u.boe.com/upload';
|
||||||
loginPath='https://u.boe.com/m/loginuser';
|
loginPath='https://u.boe.com/m/loginuser';
|
||||||
|
scormPlayer='https://u.boe.com/newscorm/scorm-player';
|
||||||
}else if(process.env.ENV_TYPE === 'testing'){
|
}else if(process.env.ENV_TYPE === 'testing'){
|
||||||
// 测试环境
|
// 测试环境
|
||||||
apiBaseUrl = '/systemapi';
|
apiBaseUrl = '/systemapi';
|
||||||
@@ -35,6 +38,7 @@ if(process.env.NODE_ENV === 'development'){
|
|||||||
socialApiBaseUrl='/socialApi';
|
socialApiBaseUrl='/socialApi';
|
||||||
fileUrl = 'https://u-pre.boe.com/upload';
|
fileUrl = 'https://u-pre.boe.com/upload';
|
||||||
loginPath='https://u-pre.boe.com/m/loginuser';
|
loginPath='https://u-pre.boe.com/m/loginuser';
|
||||||
|
scormPlayer='https://u-pre.boe.com/newscorm/scorm-player';
|
||||||
}else{
|
}else{
|
||||||
// 生产环境
|
// 生产环境
|
||||||
apiBaseUrl = '/systemapi';
|
apiBaseUrl = '/systemapi';
|
||||||
@@ -43,6 +47,7 @@ if(process.env.NODE_ENV === 'development'){
|
|||||||
socialApiBaseUrl='/socialApi';
|
socialApiBaseUrl='/socialApi';
|
||||||
fileUrl = 'https://u.boe.com/upload';
|
fileUrl = 'https://u.boe.com/upload';
|
||||||
loginPath='https://u.boe.com/m/loginuser';
|
loginPath='https://u.boe.com/m/loginuser';
|
||||||
|
scormPlayer='https://u.boe.com/newscorm/scorm-player';
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -55,4 +60,5 @@ export default {
|
|||||||
loginPath:loginPath,
|
loginPath:loginPath,
|
||||||
fileUrl:fileUrl,
|
fileUrl:fileUrl,
|
||||||
version:version,
|
version:version,
|
||||||
|
scormPlayer:scormPlayer
|
||||||
}
|
}
|
||||||
@@ -21,8 +21,11 @@
|
|||||||
<view v-if="tipText!=''" style="text-align: center;color:red">
|
<view v-if="tipText!=''" style="text-align: center;color:red">
|
||||||
<text>{{tipText}}</text>
|
<text>{{tipText}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else style="text-align: center;">
|
||||||
<u-button type="primary" :disabled="startButton" v-if="testStatus == 1" @click="startTest()">{{btnText}}</u-button>
|
<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>
|
</view>
|
||||||
<view v-if="examStatus==2" style="text-align: center;color:#6d6d6d; ">考试已结束</view>
|
<view v-if="examStatus==2" style="text-align: center;color:#6d6d6d; ">考试已结束</view>
|
||||||
@@ -62,7 +65,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<!--试题内容-->
|
<!--试题内容-->
|
||||||
<view class="qitem">
|
<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 v-if="curItem.type == 3">
|
||||||
<view class="qitem-opts">
|
<view class="qitem-opts">
|
||||||
<view class="qitem-opt" :class="{check:curItem.userAnswer == 'true'}"
|
<view class="qitem-opt" :class="{check:curItem.userAnswer == 'true'}"
|
||||||
@@ -84,12 +92,18 @@
|
|||||||
{{toLetter(optIdx+1)}}.{{opt.content}}
|
{{toLetter(optIdx+1)}}.{{opt.content}}
|
||||||
<u-icon v-if="opt.id==curItem.userAnswer" name="checkbox-mark" color="#00aa00"></u-icon>
|
<u-icon v-if="opt.id==curItem.userAnswer" name="checkbox-mark" color="#00aa00"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="opt.images" class="qimg">
|
||||||
|
<img class="qimg-fit" :src="imageBaseUrl+opt.images"/>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="qitem-opts" v-if="curItem.type == 2">
|
<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)">
|
<view class="qitem-opt" :class="{check:(curItem.userAnswer && curItem.userAnswer.indexOf(opt.id) > -1)}" @click="chooseOption(opt)">
|
||||||
{{toLetter(optIdx+1)}}.{{opt.content}}
|
{{toLetter(optIdx+1)}}.{{opt.content}}
|
||||||
<u-icon v-if="curItem.userAnswer && curItem.userAnswer.indexOf(opt.id) > -1" name="checkbox-mark" color="#00aa00"></u-icon>
|
<u-icon v-if="curItem.userAnswer && curItem.userAnswer.indexOf(opt.id) > -1" name="checkbox-mark" color="#00aa00"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="opt.images" class="qimg">
|
||||||
|
<img class="qimg-fit" :src="imageBaseUrl+opt.images"/>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -123,6 +137,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import config from '@/config/index.js'
|
||||||
import apiTestPaper from '@/api/modules/testPaper.js'
|
import apiTestPaper from '@/api/modules/testPaper.js'
|
||||||
import { correctJudgment, numberToLetter, examType,toScoreTow } from '@/utils/tools.js';
|
import { correctJudgment, numberToLetter, examType,toScoreTow } from '@/utils/tools.js';
|
||||||
import { formatDate, formatSeconds } from '@/utils/index.js';
|
import { formatDate, formatSeconds } from '@/utils/index.js';
|
||||||
@@ -132,6 +147,7 @@
|
|||||||
return {
|
return {
|
||||||
toScoreTow,
|
toScoreTow,
|
||||||
startButton: false,
|
startButton: false,
|
||||||
|
imageBaseUrl:config.fileUrl,
|
||||||
examId: '', //考试的id
|
examId: '', //考试的id
|
||||||
taskId: '', //考试任务的id
|
taskId: '', //考试任务的id
|
||||||
lastId: '', //最后一次提交的答卷
|
lastId: '', //最后一次提交的答卷
|
||||||
@@ -817,4 +833,11 @@
|
|||||||
// display: flex;
|
// display: flex;
|
||||||
// justify-content: space-around;
|
// justify-content: space-around;
|
||||||
}
|
}
|
||||||
|
.qimg{
|
||||||
|
width:100%;
|
||||||
|
.qimg-fit{
|
||||||
|
width:100%;
|
||||||
|
object-fit:scale-down
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<!--考试页面,用户在此页面一个试题一个试题的回答-->
|
<!--考试页面,此页面是备份 ,未使用到-->
|
||||||
<view>
|
<view>
|
||||||
<u-toast ref="messager"></u-toast>
|
<u-toast ref="messager"></u-toast>
|
||||||
<view style="text-align: center;padding: 10px;"><text class="title-name">{{testPaper.testName}}</text></view>
|
<view style="text-align: center;padding: 10px;"><text class="title-name">{{testPaper.testName}}</text></view>
|
||||||
|
|||||||
@@ -179,11 +179,13 @@
|
|||||||
import apiMessage from '@/api/system/message.js'
|
import apiMessage from '@/api/system/message.js'
|
||||||
import {toScore} from '@/utils/tools.js'
|
import {toScore} from '@/utils/tools.js'
|
||||||
import apiBoeCourse from '@/api/boe/course.js'
|
import apiBoeCourse from '@/api/boe/course.js'
|
||||||
|
import apiUserGroup from "@/api/modules/usergroup.js";
|
||||||
import apiYearMedal from '@/api/phase2/yearMedal.js'
|
import apiYearMedal from '@/api/phase2/yearMedal.js'
|
||||||
import { mapGetters,mapActions} from 'vuex';
|
import { mapGetters,mapActions} from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
audiences:[],
|
||||||
noPageList: true,//判断接口是否还有数据
|
noPageList: true,//判断接口是否还有数据
|
||||||
noDataList: true,//判断接口是否还有数据
|
noDataList: true,//判断接口是否还有数据
|
||||||
msgNum:0,
|
msgNum:0,
|
||||||
|
|||||||
@@ -277,6 +277,8 @@
|
|||||||
import {toScore} from '@/utils/tools.js'
|
import {toScore} from '@/utils/tools.js'
|
||||||
import apiArticle from '@/api/modules/article.js'
|
import apiArticle from '@/api/modules/article.js'
|
||||||
import apiBoeCourse from '@/api/boe/course.js'
|
import apiBoeCourse from '@/api/boe/course.js'
|
||||||
|
import apiUserGroup from "@/api/modules/usergroup.js";
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
export default{
|
export default{
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
@@ -336,9 +338,32 @@
|
|||||||
this.conType=1;
|
this.conType=1;
|
||||||
}
|
}
|
||||||
this.loadSeachWords();
|
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:{
|
computed:{
|
||||||
|
...mapGetters(['userInfo'])
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.onReachBottom();
|
this.onReachBottom();
|
||||||
@@ -452,16 +477,16 @@
|
|||||||
this.qa.params.keyword=this.keyword;
|
this.qa.params.keyword=this.keyword;
|
||||||
if(this.keyword!=''){
|
if(this.keyword!=''){
|
||||||
if(this.conType==1){
|
if(this.conType==1){
|
||||||
if(this.course.loadStatus=='more'){
|
if(this.course.loadStatus=='more' && this.course.list.length==0){
|
||||||
this.loadCourseData();
|
this.loadCourseData();
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(this.conType==2){
|
}else if(this.conType==2){
|
||||||
if(this.article.loadStatus=='more'){
|
if(this.article.loadStatus=='more' && this.article.list.length==0){
|
||||||
this.loadArticleData();
|
this.loadArticleData();
|
||||||
}
|
}
|
||||||
}else if(this.conType==4){
|
}else if(this.conType==4){
|
||||||
if(this.qa.loadStatus=='more'){
|
if(this.qa.loadStatus=='more' && this.qa.list.length==0){
|
||||||
this.loadQaData();
|
this.loadQaData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -497,23 +522,29 @@
|
|||||||
resetFilters(){
|
resetFilters(){
|
||||||
this.stepIndex=2;
|
this.stepIndex=2;
|
||||||
this.filterTags=[];
|
this.filterTags=[];
|
||||||
|
|
||||||
|
this.course.filters=[];
|
||||||
|
this.course.list=[];
|
||||||
|
this.course.params.pageIndex=1;
|
||||||
|
this.course.loadStatus='more';
|
||||||
|
|
||||||
|
this.article.filters=[];
|
||||||
|
this.article.list=[];
|
||||||
|
this.article.params.pageIndex=1;
|
||||||
|
this.article.loadStatus='more';
|
||||||
|
|
||||||
|
this.qa.filters=[];
|
||||||
|
this.qa.list=[];
|
||||||
|
this.qa.params.pageIndex=1;
|
||||||
|
this.qa.loadStatus='more';
|
||||||
|
|
||||||
if(this.conType==1){
|
if(this.conType==1){
|
||||||
this.course.filters=[];
|
|
||||||
this.course.list=[];
|
|
||||||
this.course.params.pageIndex=1;
|
|
||||||
this.course.loadStatus='more';
|
|
||||||
this.loadCourseData();
|
this.loadCourseData();
|
||||||
}else if(this.conType==2){
|
}else if(this.conType==2){
|
||||||
this.article.filters=[];
|
|
||||||
this.article.list=[];
|
|
||||||
this.article.params.pageIndex=1;
|
|
||||||
this.article.loadStatus='more';
|
|
||||||
this.loadArticleData();
|
this.loadArticleData();
|
||||||
}else if(this.conType==4){
|
}else if(this.conType==4){
|
||||||
this.qa.filters=[];
|
|
||||||
this.qa.list=[];
|
|
||||||
this.qa.params.pageIndex=1;
|
|
||||||
this.qa.loadStatus='more';
|
|
||||||
this.loadQaData();
|
this.loadQaData();
|
||||||
}
|
}
|
||||||
if(this.keyword!=''){
|
if(this.keyword!=''){
|
||||||
@@ -553,6 +584,7 @@
|
|||||||
async loadCourseData(){
|
async loadCourseData(){
|
||||||
uni.showLoading({title:'加载中...'});
|
uni.showLoading({title:'加载中...'});
|
||||||
this.course.params.keyword=this.keyword;
|
this.course.params.keyword=this.keyword;
|
||||||
|
this.course.params.audiences=this.audiences.join(',');
|
||||||
//查询课程
|
//查询课程
|
||||||
let $this=this;
|
let $this=this;
|
||||||
let dataList = [];
|
let dataList = [];
|
||||||
|
|||||||
@@ -82,6 +82,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-if="articleMore" @click="showMore" style="text-align: center;color: #387DF7;"><text>查看更多∨</text> </view>
|
<view v-if="articleMore" @click="showMore" style="text-align: center;color: #387DF7;"><text>查看更多∨</text> </view>
|
||||||
</view>
|
</view>
|
||||||
|
<div v-if="curContent.contentType == 50" style="min-height: 500px;">
|
||||||
|
<!--因为web-view 动态切换地址不好用,所以这里先使用iframe-->
|
||||||
|
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" scrolling="no" border="0px" style="width:100%;height:500px;border:0px;"></iframe>
|
||||||
|
</div>
|
||||||
<view v-if="curContent.contentType==52">
|
<view v-if="curContent.contentType==52">
|
||||||
<!--外连接-->
|
<!--外连接-->
|
||||||
<view v-if="conLink.url!=''" style="min-height: 400px;position: relative;">
|
<view v-if="conLink.url!=''" style="min-height: 400px;position: relative;">
|
||||||
@@ -395,6 +399,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import config from '@/config/index.js'
|
||||||
import apiCoursePortal from '@/api/modules/coursePortal.js'
|
import apiCoursePortal from '@/api/modules/coursePortal.js'
|
||||||
import apiCourseStudy from '@/api/modules/courseStudy.js'
|
import apiCourseStudy from '@/api/modules/courseStudy.js'
|
||||||
import apiVideoStudy from "@/api/modules/videoStudy.js";
|
import apiVideoStudy from "@/api/modules/videoStudy.js";
|
||||||
@@ -473,7 +478,8 @@
|
|||||||
localTimeKey:'boeu-study-time' ,//本地存储的学习时长的key json格式
|
localTimeKey:'boeu-study-time' ,//本地存储的学习时长的key json格式
|
||||||
localTimeValue:0,//计算的时间
|
localTimeValue:0,//计算的时间
|
||||||
appendStudyOtherHandle:null,
|
appendStudyOtherHandle:null,
|
||||||
articleMore:true
|
articleMore:true,
|
||||||
|
scormUrl:'',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -704,7 +710,20 @@
|
|||||||
this.playContent(this.curContent,0);
|
this.playContent(this.curContent,0);
|
||||||
//this.curSection=this.sectionList[0];
|
//this.curSection=this.sectionList[0];
|
||||||
}else{
|
}else{
|
||||||
this.curContent=this.contentList[0];
|
let treelist=this.catalogTree;
|
||||||
|
this.curSection=treelist[0].sec;
|
||||||
|
this.curContent=treelist[0].children[0];
|
||||||
|
// this.curContent=this.contentList[0];
|
||||||
|
// this.curSection=this.sectionList[0];
|
||||||
|
//要不要在这里处理?
|
||||||
|
// if(this.curContent.contentType==10 || this.curContent.contentType==20){
|
||||||
|
// if(this.contentList[0].content.startsWith('\{')){
|
||||||
|
// this.curriculumData=JSON.parse(this.contentList[0].content);
|
||||||
|
// }else{
|
||||||
|
// this.curriculumData.url=this.contentList[0].content;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//this.curContent=this.contentList[0];
|
||||||
this.playContent(this.curContent,0);
|
this.playContent(this.curContent,0);
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@@ -813,8 +832,10 @@
|
|||||||
},
|
},
|
||||||
//更换播放内容
|
//更换播放内容
|
||||||
changePlayRes(con){
|
changePlayRes(con){
|
||||||
|
this.scormUrl='';//清空地址
|
||||||
this.articleMore=true;
|
this.articleMore=true;
|
||||||
this.clearTimeHandle();
|
this.clearTimeHandle();
|
||||||
|
//this.curContent=0;
|
||||||
// console.log(con,'con');
|
// console.log(con,'con');
|
||||||
this.playerBoxShow=false;
|
this.playerBoxShow=false;
|
||||||
if(con.contentType==40){
|
if(con.contentType==40){
|
||||||
@@ -831,6 +852,31 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}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模块自动根据学习记录定位
|
||||||
|
pars+='&r='+Math.random();//加一个随机数,以便重新加载
|
||||||
|
let urlPre=window.location.protocol;
|
||||||
|
let configUrl=config.scormPlayer;
|
||||||
|
configUrl=urlPre+configUrl.substring(configUrl.indexOf(':')+1);
|
||||||
|
|
||||||
|
this.scormUrl=configUrl+pars;//播放的首页
|
||||||
|
console.log(this.scormUrl,'this.scormUrl')
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}else if(con.contentType==52){
|
}else if(con.contentType==52){
|
||||||
if(con.content.startsWith('\{')){
|
if(con.content.startsWith('\{')){
|
||||||
this.conLink=JSON.parse(con.content);
|
this.conLink=JSON.parse(con.content);
|
||||||
@@ -848,6 +894,7 @@
|
|||||||
this.blobUrl=this.fileBaseUrl+this.curriculumData.url;
|
this.blobUrl=this.fileBaseUrl+this.curriculumData.url;
|
||||||
//console.log(this.blobUrl,'this.blobUrl');
|
//console.log(this.blobUrl,'this.blobUrl');
|
||||||
}
|
}
|
||||||
|
//console.log(con.contentType,'con.contentType');
|
||||||
this.curContent=con;
|
this.curContent=con;
|
||||||
this.catalogShow=false;
|
this.catalogShow=false;
|
||||||
this.scoreInfo.itemId=con.id;
|
this.scoreInfo.itemId=con.id;
|
||||||
|
|||||||
@@ -12,13 +12,19 @@
|
|||||||
</view>
|
</view>
|
||||||
<!--试题内容-->
|
<!--试题内容-->
|
||||||
<view class="qitem">
|
<view class="qitem">
|
||||||
<view class="qitem-info">[{{getTypeName(curItem.type)}}]{{curItem.content}}</view>
|
<view class="qitem-info">
|
||||||
|
<view> [{{getTypeName(curItem.type)}}]{{curItem.content}}</view>
|
||||||
|
<view class="qimg" v-if="curItem.images"><img class="qimg-fit" :src="imageBaseUrl+curItem.images"/></view>
|
||||||
|
</view>
|
||||||
<view v-for="(opt,optIdx) in curItem.options" :key="optIdx">
|
<view v-for="(opt,optIdx) in curItem.options" :key="optIdx">
|
||||||
<view class="qitem-opts">
|
<view class="qitem-opts">
|
||||||
<view class="qitem-opt" :class="{check:opt.checked}" @click="chooseOption(opt)">
|
<view class="qitem-opt" :class="{check:opt.checked}" @click="chooseOption(opt)">
|
||||||
{{toLetter(optIdx+1)}}.{{opt.content}}
|
{{toLetter(optIdx+1)}}.{{opt.content}}
|
||||||
<u-icon v-if="opt.checked" name="checkbox-mark" color="#00aa00"></u-icon>
|
<u-icon v-if="opt.checked" name="checkbox-mark" color="#00aa00"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="opt.images" class="qimg">
|
||||||
|
<img class="qimg-fit" :src="imageBaseUrl+opt.images"/>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -51,8 +57,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import config from '@/config/index.js'
|
||||||
import apiCourseStudy from '@/api/modules/courseStudy.js'
|
import apiCourseStudy from '@/api/modules/courseStudy.js'
|
||||||
import apiCourse from '@/api/modules/course.js';
|
import apiCourse from '@/api/modules/course.js';
|
||||||
|
import apiExamPaper from '@/api/modules/paper.js';
|
||||||
import {formatDate,getQuestionType,correctJudgment,numberToLetter} from '@/utils/tools.js';
|
import {formatDate,getQuestionType,correctJudgment,numberToLetter} from '@/utils/tools.js';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -63,6 +71,7 @@
|
|||||||
startTime:null,
|
startTime:null,
|
||||||
toLetter:numberToLetter,
|
toLetter:numberToLetter,
|
||||||
getTypeName:getQuestionType,
|
getTypeName:getQuestionType,
|
||||||
|
imageBaseUrl:config.fileUrl,
|
||||||
info:{},
|
info:{},
|
||||||
stop:false,
|
stop:false,
|
||||||
paper:[],
|
paper:[],
|
||||||
@@ -100,28 +109,48 @@
|
|||||||
apiCourse.getExam(this.examId).then(res=>{
|
apiCourse.getExam(this.examId).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
this.info=res.result;
|
this.info=res.result;
|
||||||
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=res.result.testDuration;
|
|
||||||
this.timer=setInterval(this.changeTimer,60000);
|
|
||||||
this.loadStudyItemId();
|
this.loadStudyItemId();
|
||||||
|
if(this.info.paperType==2){
|
||||||
|
apiExamPaper.getPaperContent(this.info.paperId).then(rs=>{
|
||||||
|
if(rs.status==200){
|
||||||
|
//console.log(rs.result)
|
||||||
|
let paperItems=JSON.parse(rs.result);
|
||||||
|
//console.log(this.examPaper.json,'this.examPaper.json');
|
||||||
|
let qitems=this.convertToItems(paperItems);
|
||||||
|
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);
|
||||||
|
}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=res.result.testDuration;
|
||||||
|
this.timer=setInterval(this.changeTimer,60000);
|
||||||
|
|
||||||
|
}
|
||||||
}else if(res.status==404){
|
}else if(res.status==404){
|
||||||
//没有找到考试信息
|
//没有找到考试信息
|
||||||
}else{
|
}else{
|
||||||
@@ -129,6 +158,56 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//独立考试的试题转化为课内考试的试题
|
||||||
|
convertToItems(questions){
|
||||||
|
let qitems=[];
|
||||||
|
questions.forEach(item=>{
|
||||||
|
let q={
|
||||||
|
id:item.id,
|
||||||
|
type:item.type==1? 101:item.type==2? 102:103,
|
||||||
|
score:item.defaultScore,
|
||||||
|
checked:false,
|
||||||
|
userAnswer:'',
|
||||||
|
optShow:true,
|
||||||
|
content:item.title,
|
||||||
|
images:item.images,
|
||||||
|
options:[]
|
||||||
|
}
|
||||||
|
if(item.type==3){
|
||||||
|
q.options.push({
|
||||||
|
id:item.id+'1',
|
||||||
|
images:'',
|
||||||
|
content:"正确",
|
||||||
|
answer:item.answer=='true'? true:false,
|
||||||
|
checked:false
|
||||||
|
});
|
||||||
|
q.options.push({
|
||||||
|
id:item.id+'2',
|
||||||
|
images:'',
|
||||||
|
content:"错误",
|
||||||
|
answer:item.answer=='true'? false:true,
|
||||||
|
checked:false
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
item.optionList.forEach(opt=>{
|
||||||
|
q.options.push({
|
||||||
|
id:opt.id,
|
||||||
|
images:opt.images,
|
||||||
|
content:opt.content,
|
||||||
|
answer:opt.isAnswer,
|
||||||
|
checked:false
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(q.type==102){
|
||||||
|
q.userAnswer=[];
|
||||||
|
}
|
||||||
|
qitems.push(q);
|
||||||
|
});
|
||||||
|
console.log(qitems,'qitems')
|
||||||
|
return qitems;
|
||||||
|
},
|
||||||
loadStudyItemId(){
|
loadStudyItemId(){
|
||||||
//获取studyItemId;
|
//获取studyItemId;
|
||||||
apiCourseStudy.getStudyContentItem(this.studyId,this.info.contentId).then(rs=>{
|
apiCourseStudy.getStudyContentItem(this.studyId,this.info.contentId).then(rs=>{
|
||||||
@@ -363,5 +442,14 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
}
|
}
|
||||||
|
.qimg{
|
||||||
|
//padding-left: 30px;
|
||||||
|
width:100%;
|
||||||
|
text-align: left;
|
||||||
|
.qimg-fit{
|
||||||
|
width:100%;
|
||||||
|
|
||||||
|
object-fit:scale-down
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<!--考试试卷详细信息,考试过的试卷内容-->
|
<!--考试试卷详细信息,考试过的试卷内容-->
|
||||||
<view>
|
<view style="padding-bottom: 60px;">
|
||||||
<u-toast ref="messager"></u-toast>
|
<u-toast ref="messager"></u-toast>
|
||||||
<page-title :showBack="true">查看我的答卷</page-title>
|
<page-title :showBack="true">查看我的答卷</page-title>
|
||||||
<view style="background-color: #FFFFFF;">
|
<view style="background-color: #FFFFFF;">
|
||||||
@@ -14,10 +14,16 @@
|
|||||||
<view style="padding-top: 10upx;color: #757575; ">第{{curIndex+1}}题 / 共{{total}}题</view>
|
<view style="padding-top: 10upx;color: #757575; ">第{{curIndex+1}}题 / 共{{total}}题</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="qitem">
|
<view class="qitem">
|
||||||
<view class="qitem-content">[{{getTypeName(curItem.type)}}]{{curItem.content}}</view>
|
<view class="qitem-content">
|
||||||
|
<view>[{{getTypeName(curItem.type)}}]{{curItem.content}}</view>
|
||||||
|
<view class="qimg" v-if="curItem.images"><img class="qimg-fit" :src="imageBaseUrl+curItem.images"/></view>
|
||||||
|
</view>
|
||||||
<view v-for="(opt,optIdx) in curItem.options" :key="optIdx" class="qitem-opt" :class="{'qitem-opt-user':userOptIdxs.indexOf(optIdx)>-1}">
|
<view v-for="(opt,optIdx) in curItem.options" :key="optIdx" class="qitem-opt" :class="{'qitem-opt-user':userOptIdxs.indexOf(optIdx)>-1}">
|
||||||
<view>
|
<view>
|
||||||
<view>{{toLetter(optIdx+1)}}, {{opt.content}}</view>
|
<view>{{toLetter(optIdx+1)}}, {{opt.content}}</view>
|
||||||
|
<view v-if="opt.images" class="qimg">
|
||||||
|
<img class="qimg-fit" :src="imageBaseUrl+opt.images"/>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text v-if="userOptIdxs.indexOf(optIdx)>-1 && correctOptIdxs.indexOf(optIdx)>-1" style="color: #00aa00; ">√</text>
|
<text v-if="userOptIdxs.indexOf(optIdx)>-1 && correctOptIdxs.indexOf(optIdx)>-1" style="color: #00aa00; ">√</text>
|
||||||
@@ -56,6 +62,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import config from '@/config/index.js'
|
||||||
import apiCourseStudy from '@/api/modules/courseStudy.js'
|
import apiCourseStudy from '@/api/modules/courseStudy.js'
|
||||||
import {formatDate,getQuestionType,correctJudgment,numberToLetter} from '@/utils/tools.js';
|
import {formatDate,getQuestionType,correctJudgment,numberToLetter} from '@/utils/tools.js';
|
||||||
export default {
|
export default {
|
||||||
@@ -64,6 +71,7 @@
|
|||||||
recordId:'',//保存的考试记录的id
|
recordId:'',//保存的考试记录的id
|
||||||
toLetter:numberToLetter,
|
toLetter:numberToLetter,
|
||||||
getTypeName:getQuestionType,
|
getTypeName:getQuestionType,
|
||||||
|
imageBaseUrl:config.fileUrl,
|
||||||
paper:{
|
paper:{
|
||||||
items:[]
|
items:[]
|
||||||
},
|
},
|
||||||
@@ -392,4 +400,14 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 52px;
|
line-height: 52px;
|
||||||
}
|
}
|
||||||
|
.qimg{
|
||||||
|
//padding-left: 30px;
|
||||||
|
width:100%;
|
||||||
|
text-align: left;
|
||||||
|
.qimg-fit{
|
||||||
|
width:100%;
|
||||||
|
|
||||||
|
object-fit:scale-down
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user