|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div>
|
|
|
|
|
|
|
+ <div>
|
|
|
<el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm" label-position="top">
|
|
<el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm" label-position="top">
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
@@ -63,7 +63,7 @@
|
|
|
<div class="test-form ai-evaluate">
|
|
<div class="test-form ai-evaluate">
|
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
|
<div v-else >
|
|
<div v-else >
|
|
|
- <p v-html="resp"></p>
|
|
|
|
|
|
|
+ <p v-html="resp"></p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -75,7 +75,7 @@
|
|
|
<div class="test-form ai-evaluate">
|
|
<div class="test-form ai-evaluate">
|
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
|
<div v-else >
|
|
<div v-else >
|
|
|
- <p v-html="resp"></p>
|
|
|
|
|
|
|
+ <p v-html="resp"></p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -87,7 +87,7 @@
|
|
|
<div class="test-form ai-evaluate">
|
|
<div class="test-form ai-evaluate">
|
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
|
<div v-else >
|
|
<div v-else >
|
|
|
- <p v-html="resp"></p>
|
|
|
|
|
|
|
+ <p v-html="resp"></p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -99,7 +99,7 @@
|
|
|
<div class="test-form ai-evaluate">
|
|
<div class="test-form ai-evaluate">
|
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
|
<div v-else >
|
|
<div v-else >
|
|
|
- <p v-html="resp"></p>
|
|
|
|
|
|
|
+ <p v-html="resp"></p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -111,7 +111,7 @@
|
|
|
<!-- <div class="test-form ai-evaluate">
|
|
<!-- <div class="test-form ai-evaluate">
|
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
<div v-if="showAIEvaluate"><i class="el-icon-loading"></i></div>
|
|
|
<div v-else >
|
|
<div v-else >
|
|
|
- <p v-html="resp"></p>
|
|
|
|
|
|
|
+ <p v-html="resp"></p>
|
|
|
</div>
|
|
</div>
|
|
|
</div> -->
|
|
</div> -->
|
|
|
</div>
|
|
</div>
|
|
@@ -127,8 +127,8 @@
|
|
|
<div v-else class="opt-area" >
|
|
<div v-else class="opt-area" >
|
|
|
<el-button :disabled="showAIEvaluate" icon="el-icon-check" style="width: 100%;" size="small" type="success" plain @click="onFinish">完成</el-button>
|
|
<el-button :disabled="showAIEvaluate" icon="el-icon-check" style="width: 100%;" size="small" type="success" plain @click="onFinish">完成</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -163,7 +163,7 @@ import { getDictValueByType } from '../api/dict'
|
|
|
|
|
|
|
|
import { mockAI, steps ,tips} from '../mock/gpsren';
|
|
import { mockAI, steps ,tips} from '../mock/gpsren';
|
|
|
|
|
|
|
|
-import {askAI,postGPSREN,getStepModel} from '../api/ai'
|
|
|
|
|
|
|
+import {askAI,postGPSREN,getStepModel} from '../api/ai'
|
|
|
let thisPage = null
|
|
let thisPage = null
|
|
|
|
|
|
|
|
let stepMapToCnt = {}
|
|
let stepMapToCnt = {}
|
|
@@ -174,7 +174,7 @@ export default {
|
|
|
question:Object,
|
|
question:Object,
|
|
|
finish:Function
|
|
finish:Function
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
headers: {
|
|
headers: {
|
|
@@ -228,7 +228,7 @@ export default {
|
|
|
spinner: 'el-icon-loading',
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
});
|
|
});
|
|
|
- this.$nextTick(()=>{
|
|
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
this.stepmodel = {
|
|
this.stepmodel = {
|
|
|
"P":"",
|
|
"P":"",
|
|
|
"S":"",
|
|
"S":"",
|
|
@@ -236,14 +236,14 @@ export default {
|
|
|
"E":""
|
|
"E":""
|
|
|
}
|
|
}
|
|
|
console.log("this.stepmodel===> ",this.stepmodel)
|
|
console.log("this.stepmodel===> ",this.stepmodel)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//todo
|
|
//todo
|
|
|
getStepModel().then(resp=>{
|
|
getStepModel().then(resp=>{
|
|
|
console.log(resp)
|
|
console.log(resp)
|
|
|
if(resp.status == 200) {
|
|
if(resp.status == 200) {
|
|
|
let res = resp.data
|
|
let res = resp.data
|
|
|
if(res.code == 1) {
|
|
if(res.code == 1) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
let stepModels = res.data.dataList
|
|
let stepModels = res.data.dataList
|
|
|
for(let n =0 ;n<stepModels.length;n++) {
|
|
for(let n =0 ;n<stepModels.length;n++) {
|
|
|
let m = stepModels[n]
|
|
let m = stepModels[n]
|
|
@@ -257,7 +257,7 @@ export default {
|
|
|
loading.close()
|
|
loading.close()
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
@@ -265,7 +265,7 @@ export default {
|
|
|
|
|
|
|
|
//提交测评
|
|
//提交测评
|
|
|
onAIEvaluate() {
|
|
onAIEvaluate() {
|
|
|
- let step = steps[this.active]
|
|
|
|
|
|
|
+ let step = steps[this.active]
|
|
|
if(!!!this.form[`${step.toLowerCase()}`]) {
|
|
if(!!!this.form[`${step.toLowerCase()}`]) {
|
|
|
//没有学生答案
|
|
//没有学生答案
|
|
|
this.$message({
|
|
this.$message({
|
|
@@ -276,11 +276,11 @@ export default {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
this.showAIEvaluate = true
|
|
this.showAIEvaluate = true
|
|
|
- let run = () => {
|
|
|
|
|
|
|
+ let run = () => {
|
|
|
return this.remoteAskAI(this.$props.question.courseName ,
|
|
return this.remoteAskAI(this.$props.question.courseName ,
|
|
|
step,
|
|
step,
|
|
|
this.$props.question.gOriented,
|
|
this.$props.question.gOriented,
|
|
|
- this.$props.question[`${step.toLowerCase()}ScoreStd`] + ' '+ this.stepmodel[step],
|
|
|
|
|
|
|
+ this.$props.question[`${step.toLowerCase()}ScoreStd`] + ' '+ this.stepmodel[step]+"\n5.返回的回答直接就是json字符串,不需要```json ```,前端parse可以直接转化的json形式,text为评价内容(为富文本形式,可以有图片之类的),score为分数\n",
|
|
|
this.form[`${step.toLowerCase()}`],
|
|
this.form[`${step.toLowerCase()}`],
|
|
|
this.stepscore[step]
|
|
this.stepscore[step]
|
|
|
)
|
|
)
|
|
@@ -308,7 +308,7 @@ export default {
|
|
|
try{
|
|
try{
|
|
|
let jData = JSON.parse(res.data)
|
|
let jData = JSON.parse(res.data)
|
|
|
this.resp = jData.text
|
|
this.resp = jData.text
|
|
|
- this.score = jData.score
|
|
|
|
|
|
|
+ this.score = jData.score
|
|
|
}catch(e){
|
|
}catch(e){
|
|
|
console.log(e)
|
|
console.log(e)
|
|
|
this.resp = "AI返回值不符合格式要求"
|
|
this.resp = "AI返回值不符合格式要求"
|
|
@@ -319,7 +319,7 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
this.resp = "AI超时"
|
|
this.resp = "AI超时"
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return this.resp
|
|
return this.resp
|
|
|
}).catch(c=>{
|
|
}).catch(c=>{
|
|
|
this.resp = "服务故障,请重试"
|
|
this.resp = "服务故障,请重试"
|
|
@@ -330,12 +330,12 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- onNext() {
|
|
|
|
|
|
|
+ onNext() {
|
|
|
//保存答案
|
|
//保存答案
|
|
|
let step = steps[this.active]
|
|
let step = steps[this.active]
|
|
|
|
|
|
|
|
let a = this.saveForm[`${step.toLowerCase()}Answer`]
|
|
let a = this.saveForm[`${step.toLowerCase()}Answer`]
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if(!!!a) {
|
|
if(!!!a) {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type:"error",
|
|
type:"error",
|
|
@@ -344,9 +344,9 @@ export default {
|
|
|
})
|
|
})
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//进入到下一个步骤
|
|
//进入到下一个步骤
|
|
|
- this.active ++
|
|
|
|
|
|
|
+ this.active ++
|
|
|
|
|
|
|
|
this.resp = ''
|
|
this.resp = ''
|
|
|
this.showAIEvaluate = false
|
|
this.showAIEvaluate = false
|
|
@@ -356,13 +356,13 @@ export default {
|
|
|
|
|
|
|
|
onFinish() {
|
|
onFinish() {
|
|
|
//保存
|
|
//保存
|
|
|
-
|
|
|
|
|
- let params = {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ let params = {
|
|
|
goalInfoId: this.$props.question.id,
|
|
goalInfoId: this.$props.question.id,
|
|
|
nAnswer:this.form.n
|
|
nAnswer:this.form.n
|
|
|
}
|
|
}
|
|
|
let p = Object.assign(params,this.saveForm)
|
|
let p = Object.assign(params,this.saveForm)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
postGPSREN(p).then(d=>{
|
|
postGPSREN(p).then(d=>{
|
|
|
console.log("postGPSREN",d)
|
|
console.log("postGPSREN",d)
|
|
|
if(d.status == 200) {
|
|
if(d.status == 200) {
|
|
@@ -371,10 +371,10 @@ export default {
|
|
|
this.$props.finish && this.$props.finish()
|
|
this.$props.finish && this.$props.finish()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
filters: {
|
|
filters: {
|
|
@@ -383,11 +383,11 @@ export default {
|
|
|
console.log("dddd==>",cs)
|
|
console.log("dddd==>",cs)
|
|
|
if(!!cs) {
|
|
if(!!cs) {
|
|
|
return cs['requires'] || ""
|
|
return cs['requires'] || ""
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
return ""
|
|
return ""
|
|
|
},
|
|
},
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|