-
+
-
+
+
+
+
+ 能力测评
+
+
+
{{question.currentQuestionSortNo}}/{{question.totalQuestionNum}}
+
({{question.questionTypeName}})
+
{{question.questionStem}}
+
+
+
倒计时:{{countdown}}
+
+
+
+
+
+
+
+
+
+ {{result.isPassed}}
+
+
+
+ {{result.totalScore}}分
+
+
{{result.isPassed == '通过' ? '恭喜' : ''}}你答对{{result.correctQuestionNum}}题,正确率{{result.correctRate}}!
+
+
+
+
+
+
+
+ 成绩详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 得分:{{totalScore}}分
+
@@ -31,12 +105,43 @@
export default {
data() {
return {
- title:'期权交易虚仿实验',
- contentText:'本项目构建了面向实战的期权交易场景,让学生面对实际存在的农业生产相关问题,设计交易策略。分为期权套期保值实验和期权组合保险实验,期权套期保值实验为单一期权的实验,需利用一个期权合约对现货进行套期保值;期权组合保险实验为期货期权组合的实验,需利用多个期权的组合满足较为复杂的套期保值需求。'
+ title:'期权交易虚仿实验',
+ contentText:'本项目构建了面向实战的期权交易场景,让学生面对实际存在的农业生产相关问题,设计交易策略。分为期权套期保值实验和期权组合保险实验,期权套期保值实验为单一期权的实验,需利用一个期权合约对现货进行套期保值;期权组合保险实验为期货期权组合的实验,需利用多个期权的组合满足较为复杂的套期保值需求。',
+ passExam: [1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513].includes(this.$store.state.studentId),
+
+ userId: this.$store.state.userId,
+ evaluationVisible: false,
+ resultVisible: false,
+ detailVisible: false,
+ lastOne: false,
+ question: {
+ options: {}
+ },
+ countdown: '',
+ selected: '',
+ result: {},
+ detail: {},
+ timer: null,
+ totalScore: 0,
+ detailData: [],
+ isDone: false,
+ history: [],
+ btnType: 1,
+ showProject: false,
};
},
+ watch: {
+ question: {
+ handler(newVal,oldVal) {
+ for(let n in newVal.options) {
+ if(newVal.options[n] == '') delete(newVal.options[n])
+ }
+ },
+ deep: true
+ }
+ },
mounted(){
-
+ console.log(11,this.passExam)
},
methods: {
toIndex() {
@@ -48,6 +153,167 @@ export default {
toNext(index) {
this.$router.push(`ProjectPattern?pattern=${index}`)
},
+ async toEvaluation(type,btn) {
+ clearInterval(this.timer)
+ this.lastOne = false
+ this.selected = ''
+ this.resultVisible = false
+ this.history = []
+ if(btn) this.btnType = btn
+ if(type && !this.passExam){
+ let res = await this.$get(this.api.openExerciseOrTeaching, { userId: this.userId })
+ if(res.errmessage == 'true'){
+ this.toNext(this.btnType == 2 ? 0 : 1)
+ }else{
+ this.$alert('请先完成能力测评并达到80分以上才可以进行实验', '提示', {
+ confirmButtonText: '进入测评',
+ callback: action => {
+ if(action == 'confirm') this.toEvaluation(0)
+ }
+ });
+ }
+ }else{
+ this.start()
+ this.getCountdown()
+ }
+ },
+ handleQues() {
+ this.question.options = {}
+ for(let n in this.question) {
+ if(n.includes('option') && n != 'options') {
+ this.question.options[n.replace('option','')] = this.question[n]
+ }
+ }
+ if(this.question.currentQuestionSortNo == this.question.totalQuestionNum){
+ this.lastOne = true
+ }else{
+ this.lastOne = false
+ }
+ },
+ async start() {
+ let res = await this.$get(this.api.experimentStart, { userId: this.userId,types: this.btnType })
+ if(res.data){
+ this.question = res.data
+ this.isDone = false
+ this.question.currentQuestionSortNo == 1 && this.$store.commit("answerHistoryData", { answerHistory : []})
+ this.handleQues()
+ this.evaluationVisible = true
+ }else{
+ this.$message.warning(res.message)
+ }
+ },
+ async getCountdown() {
+ let res = await this.$get(this.api.experimentRemaining, { userId: this.userId })
+ res.data && this.countDown(res.data)
+ // this.countDown('00:00:05')
+ },
+ countDown(time) {
+ this.countdown = time
+ this.timer = setInterval(() => {
+ let timeList = this.countdown.split(':')
+ let total = Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2])
+ if(total > 0){
+ --total
+ let minutes = Math.floor(total / 60)
+ let seconds = Math.floor(total % 60)
+ this.countdown = `00:${this.core.formateTime(minutes)}:${this.core.formateTime(seconds)}`
+ }else{
+ this.isDone = true
+ this.$message.warning('测评时间结束');
+ clearInterval(this.timer)
+ }
+ },1000)
+ },
+ selectOption(option) {
+ if(!this.isDone) {
+ if(this.selected.includes(option)) {
+ this.selected = this.selected.replace(option,'')
+ }else{
+ if(this.question.questionType == 2) {
+ this.selected += option
+ }else{
+ this.selected = option
+ }
+ }
+ }
+ },
+ getHistory() {
+ this.history = this.$store.state.answerHistory
+ },
+ async nextQues() {
+ if(!this.selected) return this.$message.warning('请选择答案')
+ this.getHistory()
+ if(this.history.length > this.question.currentQuestionSortNo){
+ this.history[this.question.currentQuestionSortNo-1] = this.selected
+ }else if(this.history.length < this.question.currentQuestionSortNo){
+ this.history.push(this.selected)
+ }
+ this.$store.commit("answerHistoryData", { answerHistory : this.history})
+ let res = await this.$post(this.api.experimentNext, {
+ id: this.question.id,
+ currentQuestionSortNo: this.question.currentQuestionSortNo,
+ userAnswer: this.selected
+ })
+ if(res.data){
+ this.question = res.data
+ this.selected = ''
+ if(this.history.length >= this.question.currentQuestionSortNo){
+ this.selected = this.history[this.question.currentQuestionSortNo-1]
+ }else{
+ this.selected = ''
+ }
+ this.handleQues()
+ }
+ },
+ async prevQues() {
+ if(this.question.currentQuestionSortNo > 1){
+ this.getHistory()
+ let res = await this.$post(this.api.experimentPrevious, {
+ id: this.question.id,
+ currentQuestionSortNo: this.question.currentQuestionSortNo,
+ userAnswer: this.selected
+ })
+ if(res.data){
+ this.question = res.data
+ this.selected = this.history[this.question.currentQuestionSortNo-1]
+ this.handleQues()
+ }
+ }
+ },
+ async submitQues() {
+ if(!this.selected) return this.$message.warning('请选择答案');
+ let res = await this.$post(this.api.experimentSubmit, {
+ id: this.question.id,
+ currentQuestionSortNo: this.question.currentQuestionSortNo,
+ userAnswer: this.selected,
+ userId: this.userId,
+ types: this.btnType
+ })
+ if(res.data) {
+ this.result = res.data
+ this.evaluationVisible = false
+ this.resultVisible = true
+ }
+ },
+ async passQues(){
+ this.resultVisible = false
+ this.toNext(this.btnType == 2 ? 0 : 1)
+ },
+ async getDetail() {
+ let res = await this.$get(this.api.experimentDetail, {
+ evaluationRecordId: this.question.id
+ })
+ if(res.data){
+ this.totalScore = res.data.totalScore
+ this.detailData = res.data.evaluationDetailVOS
+ this.resultVisible = false
+ this.detailVisible = true
+ }
+ },
+ toSonSys() {
+ this.resultVisible = false
+ this.toNext(this.btnType == 2 ? 0 : 1)
+ }
},
};
@@ -177,4 +443,198 @@ export default {
color: white;
line-height: 60px;
}
+
+/deep/.el-tabs__item:focus{
+ outline: none;
+ box-shadow: none !important;
+}
+.back_index:hover{
+ opacity: 0.8;
+ cursor: pointer;
+}
+.back_index{
+ position: fixed;
+ right: 0px;
+ top: 48%;
+ width: 80px;
+ height: 80px;
+ background: white;
+ text-align: center;
+ z-index: 100;
+}
+.icon-home{
+ font-size: 50px;
+ color: #FF5288;
+ font-weight: 600;
+ line-height: 80px;
+}
+h3{
+ color: #328aff;
+ margin-bottom: 10px;
+}
+.mar0{
+ margin-top: 0;
+}
+/deep/.evaluation_dialog{
+ min-height: 700px;
+ background: url(../../assets/img/evaluation_bg1.png) 0 0/100% 100% no-repeat;
+}
+/deep/.evaluation_dialog .el-dialog__headerbtn,/deep/.evaluation_dialog .el-dialog__headerbtn,/deep/.detail_dialog .el-dialog__headerbtn{
+ font-size: 28px;
+}
+/deep/.evaluation_dialog .title,/deep/.detail_dialog .title{
+ margin-bottom: 45px;
+ text-align: center;
+ font-size: 24px
+}
+/deep/.evaluation_dialog .title{
+ margin-bottom: 55px;
+}
+/deep/.evaluation_dialog .serial{
+ font-size: 12px;
+ text-align: center;
+}
+/deep/.evaluation_dialog .content{
+ width: 80%;
+ margin: 0 auto;
+}
+/deep/.evaluation_dialog .type{
+ color: #666;
+}
+/deep/.evaluation_dialog .ques{
+ margin: 20px 0;
+ min-height: 145px;
+ color: #666;
+ font-size: 16px;
+}
+/deep/.evaluation_dialog .countdown{
+ margin-bottom: 20px;
+ justify-content: center;
+ text-align: center;
+ color: #DC3434;
+ font-size: 14px;
+}
+/deep/.evaluation_dialog .countdown img{
+ width: 15px !important;
+ margin-right: 10px;
+}
+/deep/.evaluation_dialog .options{
+ display: flex;
+ flex-direction: column;
+ min-height: 340px;
+}
+/deep/.evaluation_dialog .options.isDone{
+ min-height: 395px;
+}
+/deep/.evaluation_dialog .options li{
+ padding: 0 15px;
+ margin-bottom: 15px;
+ line-height: 40px;
+ border: 1px solid #9070FF;
+ border-radius: 20px;
+ color: #666;
+ cursor: pointer;
+}
+/deep/.evaluation_dialog .options li:hover{
+ color: #fff;
+ background-color: #b038bb;
+ border-color: #b038bb;
+}
+/deep/.evaluation_dialog .options li.active{
+ color: #fff;
+ background-color: #916CFF;
+ border-color: #916CFF;
+}
+/deep/.evaluation_dialog .options em{
+ margin-right: 10px;
+ font-weight: bold;
+ font-style: normal;
+ font-size: 16px;
+}
+/deep/.evaluation_dialog .options span{
+ font-size: 16px;
+}
+/deep/.evaluation_dialog .el-dialog__footer{
+ text-align: center;
+}
+/deep/.evaluation_dialog .first,/deep/.result_dialog .first{
+ color: #fff;
+ background-color: #9268FF;
+ border-color: #9268FF;
+}
+/deep/.evaluation_dialog .second,/deep/.result_dialog .second{
+ color: #fff;
+ background-color: #E371DA;
+ border-color: #E371DA;
+}
+/deep/.evaluation_dialog .pass,/deep/.result_dialog .pass{
+ color: #fff;
+ background-color: #e42c85;
+ border-color: #e42c85;
+}
+
+/deep/.result_dialog{
+ min-height: 500px;
+ background: url(../../assets/img/evaluation_bg2.png) 0 0/100% 100% no-repeat;
+}
+/deep/.result_dialog .el-dialog__headerbtn .el-dialog__close{
+ color: #5a5a5a;
+ font-size: 28px;
+}
+/deep/.result_dialog .result{
+ margin-top: 60px;
+ text-align: center;
+ color: #fff;
+ font-size: 24px;
+}
+/deep/.result_dialog .point{
+ margin: 30px 0 20px;
+ text-align: center;
+ font-size: 30px;
+ color: #666;
+}
+/deep/.result_dialog .point span{
+ font-size: 120px;
+ font-weight: bold;
+}
+/deep/.result_dialog .tips{
+ color: #666;
+ text-align: center;
+ font-size: 14px;
+}
+/deep/.result_dialog .third{
+ color: #fff;
+ background-color: #418cf5;
+ border-color: #418cf5;
+}
+
+/deep/.detail_dialog{
+ background: url(../../assets/img/evaluation_bg3.png) 0 0/100% 100% no-repeat;
+}
+/deep/.detail_dialog .title{
+ margin-top: -20px;
+}
+/deep/.detail_dialog .el-table__header th:nth-last-child(2){
+ text-align: center;
+}
+/deep/.detail_dialog .total{
+ margin-top: 20px;
+ text-align: center;
+ font-size: 30px;
+ color: #DC3434;
+}
+/deep/.evaluation_dialog{
+ margin:0 !important;
+ position:absolute;
+ top:50%;
+ left:50%;
+ transform:translate(-50%,-50%);
+ max-height:calc(100% - 30px);
+ max-width:calc(100% - 30px);
+}
+
+/deep/.evaluation_dialog .el-dialog__body{
+ flex:1;
+ overflow: auto;
+}
\ No newline at end of file
diff --git a/src/components/page/ProjectPattern.vue b/src/components/page/ProjectPattern.vue
index 1fbefa7..e882109 100644
--- a/src/components/page/ProjectPattern.vue
+++ b/src/components/page/ProjectPattern.vue
@@ -25,11 +25,11 @@