|
@@ -20,21 +20,6 @@
|
|
|
<el-rate v-model="e.cog"></el-rate>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- <div
|
|
|
- v-if="scoTitList.length > 2"
|
|
|
- style="color:#4188FC;cursor: pointer;width: 30%;"
|
|
|
- @click="allList"
|
|
|
- >
|
|
|
- <div>
|
|
|
- <span style="margin-right:5px;">{{
|
|
|
- !showAll ? "全部" : "折叠"
|
|
|
- }}</span>
|
|
|
- <i
|
|
|
- :class="!showAll ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
|
|
|
- ></i>
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
</div>
|
|
|
<div style="width:100%;display:flex;justify-content: flex-end;">
|
|
|
<el-button size="mini" @click="reset">重置</el-button>
|
|
@@ -76,6 +61,7 @@ export default {
|
|
|
total: 0
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
computed: {
|
|
|
totalScore() {
|
|
|
let a = 0;
|
|
@@ -89,20 +75,13 @@ export default {
|
|
|
val2: this.wIndex,
|
|
|
val3: data
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
return data;
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- refreshKey(newV, old) {
|
|
|
- this.getData();
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
mounted() {
|
|
|
this.scoTitList = JSON.parse(JSON.stringify(this.scoTit));
|
|
|
- // console.log("scoCon", this.scoCon);
|
|
|
- // console.log("scoTit", this.scoTit);
|
|
|
-
|
|
|
this.getData();
|
|
|
},
|
|
|
|
|
@@ -116,7 +95,7 @@ export default {
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "selectWorksEvaScore", params)
|
|
|
.then(res => {
|
|
|
- console.log(res);
|
|
|
+ // console.log(res);
|
|
|
if (res.data[0].length > 0) {
|
|
|
let data2 = [];
|
|
|
res.data[0].forEach((val, index) => {
|
|
@@ -125,9 +104,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- console.log("this.task", this.task);
|
|
|
- console.log("data2", data2);
|
|
|
-
|
|
|
let data = JSON.parse(data2.rate);
|
|
|
|
|
|
this.scoTitList.forEach((e, index) => {
|
|
@@ -138,6 +114,8 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ // console.log("this.scoTitList", this.scoTitList);
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
@@ -146,35 +124,40 @@ export default {
|
|
|
},
|
|
|
// 重置
|
|
|
reset() {
|
|
|
- let data = this.scoTitList.map(e => {
|
|
|
- return e.value + ":" + e.cog;
|
|
|
+ console.log("this.scoTitList", this.scoTitList);
|
|
|
+ this.scoTitList.forEach(e => {
|
|
|
+ e.cog = 0;
|
|
|
});
|
|
|
- // console.log("data", data);
|
|
|
- const processedData = {};
|
|
|
+ // let data = this.scoTitList.map(e => {
|
|
|
+ // return e.value + ":" + e.cog;
|
|
|
+ // });
|
|
|
+ // // console.log("data", data);
|
|
|
+ // const processedData = {};
|
|
|
|
|
|
- data.forEach(item => {
|
|
|
- const [key, value] = item.split(":");
|
|
|
- processedData[key] = 0;
|
|
|
- });
|
|
|
- processedData.content = "";
|
|
|
- // return console.log(processedData);
|
|
|
- let params = {
|
|
|
- cid: this.id,
|
|
|
- s: this.stage,
|
|
|
- t: this.task,
|
|
|
- rate: JSON.stringify(processedData),
|
|
|
- uid: this.stUid
|
|
|
- };
|
|
|
- // return console.log(params);
|
|
|
- this.ajax
|
|
|
- .get(this.$store.state.api + "updateWorksEva", params)
|
|
|
- .then(res => {
|
|
|
- this.getData();
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- this.$message.error("重置失败");
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
+ // data.forEach(item => {
|
|
|
+ // const [key, value] = item.split(":");
|
|
|
+ // processedData[key] = 0;
|
|
|
+ // });
|
|
|
+ // processedData.content = "";
|
|
|
+ // this.scoTitList = processedData
|
|
|
+ // // return console.log(processedData);
|
|
|
+ // let params = {
|
|
|
+ // cid: this.id,
|
|
|
+ // s: this.stage,
|
|
|
+ // t: this.task,
|
|
|
+ // rate: JSON.stringify(processedData),
|
|
|
+ // uid: this.stUid
|
|
|
+ // };
|
|
|
+ // // return console.log(params);
|
|
|
+ // this.ajax
|
|
|
+ // .get(this.$store.state.api + "updateWorksEva", params)
|
|
|
+ // .then(res => {
|
|
|
+ // this.getData();
|
|
|
+ // })
|
|
|
+ // .catch(err => {
|
|
|
+ // this.$message.error("重置失败");
|
|
|
+ // console.error(err);
|
|
|
+ // });
|
|
|
},
|
|
|
// 老师提交评分
|
|
|
submit() {
|
|
@@ -228,29 +211,25 @@ export default {
|
|
|
}
|
|
|
// console.log(_text);
|
|
|
let msg = `NOTICE
|
|
|
- Role: 你是一个专业的项目式学习导师,你要对学生的评价高度负责。你要根据“五级评价细则”给学生作品评分。
|
|
|
+ Role: 你是一个专业的项目式学习导师,你要对学生的评价高度负责。你要根据“五级评价细则”给学生作品评分,并生成需要的JSON数据。
|
|
|
Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
|
|
|
ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
|
|
|
Instruction: Based on the context, follow "Format example", write content.
|
|
|
|
|
|
#Context
|
|
|
- ## 评价细则
|
|
|
- ${_text}
|
|
|
-
|
|
|
- ## 作业题目
|
|
|
- ${this.toolDetail}
|
|
|
-
|
|
|
- ## 作业内容
|
|
|
- ${con.text}
|
|
|
-
|
|
|
- ## 要求
|
|
|
- 根据评价细则和作业内容与作业题目的相关性评价作业,判断该作业属于五级中的哪个等级。
|
|
|
+ ##要求
|
|
|
+ 根据<评价细则>和<作业内容>与<作业题目>的相关性评价作业,判断该作业属于五级中的哪个等级。
|
|
|
具体的评价标准分为5级——1级,2级,3级,4级,5级。
|
|
|
1 级,没有识别问题和需求;
|
|
|
2 级,问题或需求没有被清晰理解或准确识别;
|
|
|
3 级,问题或需求的一部分被识别;
|
|
|
4 级,问题或需求的大部分被识别;
|
|
|
5 级,问题或需求都被识别。
|
|
|
+
|
|
|
+ ##评分资料
|
|
|
+ 评价细则:${_text}
|
|
|
+ 作业题目:${this.toolDetail}
|
|
|
+ 作业内容:${con.text}
|
|
|
|
|
|
# Format example
|
|
|
[{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'},{'评价名称':'评价等级0-5(数字)'}]
|
|
@@ -260,6 +239,7 @@ export default {
|
|
|
},
|
|
|
// ai打分
|
|
|
aiGet2(messages, callback) {
|
|
|
+ console.log(this.toolIndex,this.wIndex);
|
|
|
let _this = this;
|
|
|
// let parm = {
|
|
|
// assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
|
|
@@ -295,7 +275,7 @@ export default {
|
|
|
.post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
.then(response => {
|
|
|
let data = response.data.FunctionResponse;
|
|
|
- console.log("data", data);
|
|
|
+ // console.log("data", data);
|
|
|
if (data.choices && data.choices.length && data.choices[0].message) {
|
|
|
let dArray = {};
|
|
|
try {
|
|
@@ -308,7 +288,7 @@ export default {
|
|
|
console.log("error_________________" + error);
|
|
|
try {
|
|
|
let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
|
|
|
- console.log("dArray666", data.choices[0].message.content);
|
|
|
+ // console.log("dArray666", data.choices[0].message.content);
|
|
|
|
|
|
let match = data.choices[0].message.content.match(regex);
|
|
|
// console.log("dArray2", match);
|
|
@@ -336,7 +316,7 @@ export default {
|
|
|
console.log("error_________________" + error);
|
|
|
}
|
|
|
}
|
|
|
- console.log("dArray3", dArray);
|
|
|
+ // console.log("dArray3", dArray);
|
|
|
// _this.submit2(dArray);
|
|
|
// 提交评分
|
|
|
// if (!dArray) {
|
|
@@ -350,8 +330,13 @@ export default {
|
|
|
processedData[key] = value;
|
|
|
});
|
|
|
|
|
|
+ for (const key in processedData) {
|
|
|
+ if (!Number.isFinite(processedData[key]*1)) {
|
|
|
+ processedData[key] = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
processedData.content = "";
|
|
|
- console.log("processedData", processedData);
|
|
|
|
|
|
let params = {
|
|
|
cid: _this.id,
|
|
@@ -486,8 +471,18 @@ export default {
|
|
|
let value = item[key];
|
|
|
processedData[key] = value;
|
|
|
});
|
|
|
+
|
|
|
+ for (const key in processedData) {
|
|
|
+ if (!Number.isFinite(processedData[key]*1)) {
|
|
|
+ processedData[key] = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
processedData.content = "";
|
|
|
|
|
|
+
|
|
|
let params = {
|
|
|
cid: _this.id,
|
|
|
s: stage,
|