|
@@ -154,7 +154,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="s_b_atBox" v-if="openAtBox">
|
|
|
+ <div class="s_b_atBox" v-if="openAtBox" v-loading="loading">
|
|
|
<div class="s_b_at_tag">
|
|
|
<span
|
|
|
:class="[atTagIndex == 0 ? 's_b_at_tag_active' : '']"
|
|
@@ -259,32 +259,147 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template v-if="atTagIndex == 1">
|
|
|
+ <template v-if="atTagIndex == 1 && workSum!=0">
|
|
|
+ <div v-if="userList.length == 0">暂无成员...</div>
|
|
|
<div
|
|
|
class="s_b_ab_user"
|
|
|
v-for="(item, index) in userList"
|
|
|
:key="item.id"
|
|
|
+ v-else
|
|
|
>
|
|
|
<div class="s_b_ab_u_name">
|
|
|
<el-tooltip
|
|
|
class="item"
|
|
|
effect="light:"
|
|
|
- :content="item.userName"
|
|
|
+ :content="item.username"
|
|
|
placement="top"
|
|
|
>
|
|
|
- <span>{{ item.userName }}</span>
|
|
|
+ <span>{{ item.username }}</span>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
<div class="s_b_ab_u_message">
|
|
|
<span>作业提交情况</span>
|
|
|
<div>
|
|
|
- <span>已提交:{{ item.isSubmit }}</span>
|
|
|
- <span>未提交:{{ item.noSubmit }}</span>
|
|
|
+ <span>已提交:{{ item.count }}</span>
|
|
|
+ <span>未提交:{{ (workSum-item.count) }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="s_b_ab_u_btnArea">
|
|
|
- <span>总结分析</span>
|
|
|
- <span>作业详细</span>
|
|
|
+ <span @click="sumUpStudent(item)">总结分析</span>
|
|
|
+ <span @click.stop="lookStudentDetail(item)">作业详细</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="atTagIndex == 2">
|
|
|
+ <div class="s_b_at_studentDetail">
|
|
|
+ <img
|
|
|
+ :src="require('../../../assets/icon/course/back.svg')"
|
|
|
+ @click.stop="atTagIndex = 1"
|
|
|
+ />
|
|
|
+ <span>学生:{{ lookStudentData.userName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="s_b_at_studentList">
|
|
|
+ <div
|
|
|
+ class="s_b_at_sl_item"
|
|
|
+ v-if="[3, 2, 8].includes(item.type)"
|
|
|
+ v-for="(item, index) in lookStudentData.list"
|
|
|
+ @click.stop="sumUpStudent2(item)"
|
|
|
+ >
|
|
|
+ <div class="s_b_at_sl_phase">
|
|
|
+ {{
|
|
|
+ `阶段${item.stage + 1}/任务${item.task +
|
|
|
+ 1}/工具${item.tool + 1}`
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div class="s_b_at_sl_message" v-if="item.type === 3">
|
|
|
+ <div>
|
|
|
+ 题目:
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="light:"
|
|
|
+ :content="item.content.answerTitle"
|
|
|
+ placement="top"
|
|
|
+ ><span>{{ item.content.answerTitle }}</span></el-tooltip
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 答题:
|
|
|
+ <span>{{ item.content.answer }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="s_b_at_sl_message"
|
|
|
+ v-if="item.type === 8"
|
|
|
+ v-for="(item1, index1) in item.content.testJson
|
|
|
+ ? item.content.testJson.testJson
|
|
|
+ : []"
|
|
|
+ :key="index1"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ 题目:
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="light:"
|
|
|
+ :content="item1.teststitle"
|
|
|
+ placement="top"
|
|
|
+ ><span>{{ item1.teststitle }}</span></el-tooltip
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ 选项:
|
|
|
+ <span>
|
|
|
+ <div v-for="(item2, index2) in item1.checkList">
|
|
|
+ {{ index2 + 1 }}、{{ item2.src ? item2.src : item2 }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 答案:{{ answerData(item1.checkList, item1.answer) }}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 答题:
|
|
|
+ <span>{{
|
|
|
+ answerData(item1.checkList, item.content.anwer[index1])
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="s_b_at_sl_message"
|
|
|
+ v-if="item.type === 2"
|
|
|
+ v-for="(item1, index1) in item.content.askJson
|
|
|
+ ? item.content.askJson.askJson
|
|
|
+ : []"
|
|
|
+ :key="index1"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ 题目:
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ effect="light:"
|
|
|
+ :content="item1.askstitle"
|
|
|
+ placement="top"
|
|
|
+ ><span>{{ item1.askstitle }}</span></el-tooltip
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ 选项:
|
|
|
+ <span>
|
|
|
+ <div v-for="(item2, index2) in item1.checkList">
|
|
|
+ {{ index2 + 1 }}、{{ item2.src ? item2.src : item2 }}
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 答题:
|
|
|
+ <span>{{
|
|
|
+ answerData(item1.checkList, item.content.anwer[index1])
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -328,6 +443,10 @@ export default {
|
|
|
navList: {
|
|
|
type: Array,
|
|
|
default: () => []
|
|
|
+ },
|
|
|
+ tcid: {
|
|
|
+ type: String,
|
|
|
+ default: ""
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -387,31 +506,12 @@ export default {
|
|
|
},
|
|
|
lookStudentData: {},
|
|
|
taskList: [],
|
|
|
- userList: [
|
|
|
- {
|
|
|
- id: 0,
|
|
|
- userName: "wufantest1",
|
|
|
- isSubmit: 2,
|
|
|
- noSubmit: 2
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- userName: "Chen",
|
|
|
- isSubmit: 4,
|
|
|
- noSubmit: 0
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- userName: "student04",
|
|
|
- isSubmit: 1,
|
|
|
- noSubmit: 3
|
|
|
- }
|
|
|
- ]
|
|
|
+ userList: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
openAtBox() {
|
|
|
- return false;
|
|
|
+ // return false;
|
|
|
if (this.text.length == 0) return false;
|
|
|
if (this.text.lastIndexOf("@") == this.text.length - 1) {
|
|
|
return true;
|
|
@@ -425,6 +525,7 @@ export default {
|
|
|
if (item1.dyName) {
|
|
|
_result.push({
|
|
|
name: `阶段${index1 + 1} ${item1.dyName}`,
|
|
|
+ tool:null,
|
|
|
type: 0
|
|
|
});
|
|
|
}
|
|
@@ -432,6 +533,7 @@ export default {
|
|
|
if (item2.taskName) {
|
|
|
_result.push({
|
|
|
name: `任务${index2 + 1}:${item2.taskName}`,
|
|
|
+ tool:null,
|
|
|
type: 1,
|
|
|
superiors: {
|
|
|
name: `阶段${index1 + 1} ${item1.dyName}`,
|
|
@@ -443,6 +545,7 @@ export default {
|
|
|
if (item3.tool != undefined) {
|
|
|
_result.push({
|
|
|
name: `工具${index3 + 1}:${this.toolsList[item3.tool]}`,
|
|
|
+ tool:item3.tool,
|
|
|
type: 2,
|
|
|
superiors: {
|
|
|
name: `任务${index2 + 1}:${item2.taskName}`,
|
|
@@ -473,7 +576,33 @@ export default {
|
|
|
return _md => {
|
|
|
return md.render(_md);
|
|
|
};
|
|
|
- }
|
|
|
+ },
|
|
|
+ answerData() {
|
|
|
+ return (checkList, answer) => {
|
|
|
+ if (typeof answer == "number") {
|
|
|
+ return answer + 1;
|
|
|
+ } else {
|
|
|
+ let _result = ``;
|
|
|
+ answer.forEach((item, index) => {
|
|
|
+ _result += `${item + 1}`;
|
|
|
+ if (index != answer.length - 1) {
|
|
|
+ _result += `、`;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return _result;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ workSum(){
|
|
|
+ let sum = 0;
|
|
|
+ this.atTaskList.forEach(i=>{
|
|
|
+ if(i.type!=2)return;
|
|
|
+ if([4,15,45].includes(i.tool)){
|
|
|
+ return sum+=1;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return sum;
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
navList() {
|
|
@@ -482,20 +611,6 @@ export default {
|
|
|
atTagIndex(newValue) {
|
|
|
if (newValue != 2) {
|
|
|
this.lookStudentData = {};
|
|
|
- } else {
|
|
|
- this.lookStudentData = {
|
|
|
- userName: "qgt",
|
|
|
- list: [
|
|
|
- {
|
|
|
- title: "题目题目题目题目题目题目题目题目题目",
|
|
|
- phase: "阶段一/任务一/工具1"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "题目题目题目题目题目题目题目题目题目",
|
|
|
- phase: "阶段一/任务一/工具2"
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -894,7 +1009,7 @@ ${_atList
|
|
|
// uid: _uuid,
|
|
|
// mind_map_question: noAtText
|
|
|
// };
|
|
|
- let params = {
|
|
|
+ let params = {
|
|
|
message: {
|
|
|
anthropic_version: "bedrock-2023-05-31",
|
|
|
max_tokens: 4096,
|
|
@@ -909,7 +1024,7 @@ ${_atList
|
|
|
|
|
|
this.ajax
|
|
|
// .post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
- .post("https://claude3.cocorobo.cn/chat", params)
|
|
|
+ .post("https://claude3.cocorobo.cn/chat", params)
|
|
|
.then(res => {
|
|
|
if (res.data.FunctionResponse.result == "发送成功") {
|
|
|
} else {
|
|
@@ -962,7 +1077,9 @@ ${_atList
|
|
|
},
|
|
|
// 获取ai对话
|
|
|
getAiContent(_uid) {
|
|
|
- this.source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`);
|
|
|
+ this.source = new EventSource(
|
|
|
+ `https://claude3.cocorobo.cn/streamChat/${_uid}`
|
|
|
+ );
|
|
|
// this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
@@ -1006,7 +1123,9 @@ ${_atList
|
|
|
};
|
|
|
},
|
|
|
getWAntSearchContent(_uid) {
|
|
|
- this.source = new EventSource(`https://claude3.cocorobo.cn/streamChat/${_uid}`);
|
|
|
+ this.source = new EventSource(
|
|
|
+ `https://claude3.cocorobo.cn/streamChat/${_uid}`
|
|
|
+ );
|
|
|
// this.source = new EventSource(`https://gpt4.cocorobo.cn/stream/${_uid}`); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
let _allText = "";
|
|
|
let _mdText = "";
|
|
@@ -1204,7 +1323,7 @@ ${_atList
|
|
|
// uid: _uuid,
|
|
|
// mind_map_question: ""
|
|
|
// };
|
|
|
- let params = {
|
|
|
+ let params = {
|
|
|
message: {
|
|
|
anthropic_version: "bedrock-2023-05-31",
|
|
|
max_tokens: 4096,
|
|
@@ -1219,7 +1338,7 @@ ${_atList
|
|
|
|
|
|
this.ajax
|
|
|
// .post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
- .post("https://claude3.cocorobo.cn/chat", params)
|
|
|
+ .post("https://claude3.cocorobo.cn/chat", params)
|
|
|
.then(res => {
|
|
|
if (res.data.FunctionResponse.result == "发送成功") {
|
|
|
} else {
|
|
@@ -1250,15 +1369,406 @@ ${_atList
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
+ },
|
|
|
+ getWorkData() {
|
|
|
+ if(this.workSum==0)return;
|
|
|
+ let params = {
|
|
|
+ cid: this.courseId,
|
|
|
+ classid: this.tcid
|
|
|
+ };
|
|
|
+ this.userList = [];
|
|
|
+
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectWorkBycidAi", params)
|
|
|
+ .then(res => {
|
|
|
+ let _data = res.data[0];
|
|
|
+ console.log(_data);
|
|
|
+ if (_data.length > 0) {
|
|
|
+ this.userList = _data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ // this.$message.error()
|
|
|
+ this.userList = [];
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ lookStudentDetail(_data) {
|
|
|
+ this.loading = true;
|
|
|
+ let params = {
|
|
|
+ cid: this.courseId,
|
|
|
+ uid: _data.userid
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectWorkBycidAiByUid", params)
|
|
|
+ .then(res => {
|
|
|
+ let _result = res.data[0];
|
|
|
+ this.atTagIndex = 2;
|
|
|
+ this.loading = false;
|
|
|
+ _result.forEach(i => {
|
|
|
+ i.content = JSON.parse(i.content)[0];
|
|
|
+ });
|
|
|
+ this.lookStudentData = {
|
|
|
+ userName: _data.username,
|
|
|
+ list: _result ? _result : []
|
|
|
+ };
|
|
|
+ console.log(this.lookStudentData);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ sumUpStudent(_data) {
|
|
|
+ let params = {
|
|
|
+ cid: this.courseId,
|
|
|
+ uid: _data.userid
|
|
|
+ };
|
|
|
+ this.loading = true;
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectWorkBycidAiByUid", params)
|
|
|
+ .then(res => {
|
|
|
+ let _result = res.data[0];
|
|
|
+ console.log(_result);
|
|
|
+ console.log("👆");
|
|
|
+ this.text += `${_data.username} 总结分析`;
|
|
|
+ let _msg = ``;
|
|
|
+ this.chatLoading = true;
|
|
|
+ let _uuid = uuidv4();
|
|
|
+ this.chatList.push({
|
|
|
+ role: "user",
|
|
|
+ content: `${this.text}`,
|
|
|
+ uid: _uuid,
|
|
|
+ AI: "AI",
|
|
|
+ aiContent: "",
|
|
|
+ oldContent: "",
|
|
|
+ isShowSynchronization: false,
|
|
|
+ filename: "",
|
|
|
+ index: this.chatList.length,
|
|
|
+ is_mind_map: false,
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ this.text = "";
|
|
|
+ let _wordData = "";
|
|
|
+ _result.forEach(i => {
|
|
|
+ if (i.type == 3) {
|
|
|
+ let content = JSON.parse(i.content)[0];
|
|
|
+ return (_wordData += `问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n\n`);
|
|
|
+ } else if (i.type == 8) {
|
|
|
+ let content = JSON.parse(i.content)[0];
|
|
|
+ _wordData += `选择题:\n`;
|
|
|
+ let _json = content.testJson ? content.testJson.testJson : [];
|
|
|
+ _json.forEach((i2, index2) => {
|
|
|
+ _wordData += `题目:${i2.teststitle}\n选项:\n`;
|
|
|
+ i2.checkList.forEach((item, index) => {
|
|
|
+ _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
|
|
|
+ });
|
|
|
+ if (typeof i2.answer != "number") {
|
|
|
+ i2.answer.forEach(a => {
|
|
|
+ a += 1;
|
|
|
+ });
|
|
|
+ content.anwer[index2].forEach(b => {
|
|
|
+ b += 1;
|
|
|
+ });
|
|
|
+ _wordData += `答案:${i2.answer.join("、")}`;
|
|
|
+ _wordData += `学生选择:${content.anwer[index2].join(
|
|
|
+ "、"
|
|
|
+ )}\n\n`;
|
|
|
+ } else {
|
|
|
+ _wordData += `答案:${i2.answer + 1}`;
|
|
|
+ _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return _wordData;
|
|
|
+ } else if (i.type == 2) {
|
|
|
+ let content = JSON.parse(i.content)[0];
|
|
|
+ _wordData += `问卷:${content.askJson.askTitle}\n`;
|
|
|
+ let _json = content.askJson ? content.askJson.askJson : [];
|
|
|
+ _json.forEach((i2, index2) => {
|
|
|
+ _wordData += `题目:${i2.askstitle}\n选项:\n`;
|
|
|
+ i2.checkList.forEach((item, index) => {
|
|
|
+ _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
|
|
|
+ });
|
|
|
+ if (typeof content.anwer[index2] != "number") {
|
|
|
+ _wordData += `学生选择:${content.anwer[index2].join(
|
|
|
+ "、"
|
|
|
+ )}\n\n`;
|
|
|
+ } else {
|
|
|
+ _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // console.log(_wordData)
|
|
|
+ // this.loading = false;
|
|
|
+ // return this.chatLoading = false;
|
|
|
+ _msg = `
|
|
|
+NOTICE
|
|
|
+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.
|
|
|
+
|
|
|
+## 目的
|
|
|
+你是教师用户的课堂助手,你需要基于提供给你的课程相关信息以及学生的作业数据,就某些具体作业对全班学生进行总结分析。
|
|
|
+---
|
|
|
+## 定义
|
|
|
+给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
|
|
|
+【课程】:课程通常是一个完整的项目,有一个或多个阶段。
|
|
|
+【阶段】:阶段表示课程的某一单独部分,包含一个或多个任务。
|
|
|
+【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
|
|
|
+【工具】:工具通常是指学生的作业(在课上要具体做的事情)。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。工具中通常会包含学生的作业数据。
|
|
|
+---
|
|
|
+## 工作流程与规则
|
|
|
+ 1. 了解信息。读取【工具总览表格】以及【工具详情:总体数据】中的内容,了解学生作业详情。
|
|
|
+ 2. 确保信息的完整性和可解读性。当面对不确定信息时,你应当积极提问。这一点适用于以下两种情况:
|
|
|
+ 2.1 当用户的提问需要你对课程、任务或工具拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
|
|
|
+ 2.2 当你不理解某个工具的设置时(比如当你发现题目、选项的表述不完整或者有不符合中文表达规则的符号;又比如你发现缺乏必要的统计信息),你应当积极向用户询问。
|
|
|
+ 2.3 **例外情况**:在告知用户并征得同意的情况下,你可以忽视上述问题并执行后续流程。
|
|
|
+ 3. 进行总结。
|
|
|
+ 3.1 对表格信息进行简单总结。包括任务、阶段、工具及其内容。
|
|
|
+ 3.2 进行结果分析。对于每一个工具,都从全班的角度出发进行简单总结。
|
|
|
+ 3.3 进行错因分析。仅仅针对于某些错误率较高的题目,从全班的角度出发,进行错因分析。
|
|
|
+ 4. 提供扩展题目。针对错误的题目,向用户提供同等水平的题目以起到举一反三的练习效果。
|
|
|
+ 5. 回答问题。当用户询问你某个【工具】的具体信息,这部分信息通常将就是学生的作业。你需要简单总结该部分信息,并就用户的问题进行回答。
|
|
|
+---
|
|
|
+## 做题信息
|
|
|
+学生名称:${_data.username}
|
|
|
+${_wordData}
|
|
|
+
|
|
|
+ `;
|
|
|
+
|
|
|
+ console.log(_msg);
|
|
|
+ // this.chatLoading = false;
|
|
|
+ // return;
|
|
|
+ let history = [];
|
|
|
+ this.nowChatList.forEach(i => {
|
|
|
+ if (i.content == "wanSearch") {
|
|
|
+ return;
|
|
|
+ } else if (i.content == "getImage") {
|
|
|
+ return history.push({
|
|
|
+ role: "assistant",
|
|
|
+ content: i.aiContent
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (i.content) {
|
|
|
+ history.push({
|
|
|
+ role: "user",
|
|
|
+ content: i.content
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (i.aiContent) {
|
|
|
+ history.push({
|
|
|
+ role: "assistant",
|
|
|
+ content: i.aiContent
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // if (_msg) {
|
|
|
+ history.push({ role: "user", content: _msg });
|
|
|
+ let params = {
|
|
|
+ message: {
|
|
|
+ anthropic_version: "bedrock-2023-05-31",
|
|
|
+ max_tokens: 4096,
|
|
|
+ temperature: 0,
|
|
|
+ top_p: 1,
|
|
|
+ messages: history
|
|
|
+ },
|
|
|
+ uid: _uuid,
|
|
|
+ model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ // .post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
+ .post("https://claude3.cocorobo.cn/chat", params)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.FunctionResponse.result == "发送成功") {
|
|
|
+ this.loading = false;
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.data.FunctionResponse.result);
|
|
|
+ this.chatLoading = false;
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.chatLoading = false;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ this.saveUid = _uuid;
|
|
|
+ this.getAiContent(_uuid);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ sumUpStudent2(_data) {
|
|
|
+ this.text += `${_data.username} 作业分析`;
|
|
|
+ let _msg = ``;
|
|
|
+ this.chatLoading = true;
|
|
|
+ let _uuid = uuidv4();
|
|
|
+ this.chatList.push({
|
|
|
+ role: "user",
|
|
|
+ content: `${this.text}`,
|
|
|
+ uid: _uuid,
|
|
|
+ AI: "AI",
|
|
|
+ aiContent: "",
|
|
|
+ oldContent: "",
|
|
|
+ isShowSynchronization: false,
|
|
|
+ filename: "",
|
|
|
+ index: this.chatList.length,
|
|
|
+ is_mind_map: false,
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ this.text = "";
|
|
|
+ let _wordData = "";
|
|
|
+
|
|
|
+ let content = _data.content;
|
|
|
+ if (_data.type == 3) {
|
|
|
+ _wordData += `问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n\n`;
|
|
|
+ } else if (_data.type == 8) {
|
|
|
+ _wordData += `选择题:\n`;
|
|
|
+ let _json = content.testJson ? content.testJson.testJson : [];
|
|
|
+ _json.forEach((i2, index2) => {
|
|
|
+ _wordData += `题目:${i2.teststitle}\n选项:\n`;
|
|
|
+ i2.checkList.forEach((item, index) => {
|
|
|
+ _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
|
|
|
+ });
|
|
|
+ if (typeof i2.answer != "number") {
|
|
|
+ i2.answer.forEach(a => {
|
|
|
+ a += 1;
|
|
|
+ });
|
|
|
+ content.anwer[index2].forEach(b => {
|
|
|
+ b += 1;
|
|
|
+ });
|
|
|
+ _wordData += `答案:${i2.answer.join("、")}`;
|
|
|
+ _wordData += `学生选择:${content.anwer[index2].join("、")}\n\n`;
|
|
|
+ } else {
|
|
|
+ _wordData += `答案:${i2.answer + 1}`;
|
|
|
+ _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ _wordData;
|
|
|
+ } else if (_data.type == 2) {
|
|
|
+ _wordData += `问卷:${content.askJson.askTitle}\n`;
|
|
|
+ let _json = content.askJson ? content.askJson.askJson : [];
|
|
|
+ _json.forEach((i2, index2) => {
|
|
|
+ _wordData += `题目:${i2.askstitle}\n选项:\n`;
|
|
|
+ i2.checkList.forEach((item, index) => {
|
|
|
+ _wordData += `${index + 1}:${item.src ? item.src : item}\n`;
|
|
|
+ });
|
|
|
+ if (typeof content.anwer[index2] != "number") {
|
|
|
+ _wordData += `学生选择:${content.anwer[index2].join("、")}\n\n`;
|
|
|
+ } else {
|
|
|
+ _wordData += `学生选择:${content.anwer[index2] + 1}\n\n`;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // if(_data.type==3){
|
|
|
+ // _wordData+=`问答题:\n题目:${content.answerTitle}\n学生回答:${content.answer}\n`
|
|
|
+ // }else if(_data.type==8){
|
|
|
+ // _wordData+=`选择题:\n`
|
|
|
+ // content.testJson.testJson.forEach((i2,index2)=>{
|
|
|
+ // _wordData += `题目:${i2.teststitle}\n选项:\n`
|
|
|
+ // i2.checkList.forEach((item,index)=>{
|
|
|
+ // _wordData+=`${index+1}:${item}\n`
|
|
|
+ // })
|
|
|
+ // _wordData +=`答案:${i2.answer}`
|
|
|
+ // _wordData +=`学生选择:${(content.anwer[index2])+1}\n`
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // console.log("👇👇👇")
|
|
|
+ // console.log(_wordData)
|
|
|
+ // this.chatLoading = false;
|
|
|
+ // this.loading = false;
|
|
|
+ // return
|
|
|
+
|
|
|
+ _msg = `
|
|
|
+NOTICE
|
|
|
+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.
|
|
|
+
|
|
|
+## 目的
|
|
|
+你是教师用户的课堂助手,你需要基于提供给你的课程相关信息以及学生的作业数据,就某些具体作业对全班学生进行总结分析。
|
|
|
+---
|
|
|
+## 定义
|
|
|
+给你提供的课程发生在一个网络教学平台上,各元素存在以下的关系:课程⊇阶段⊇任务⊇工具。
|
|
|
+【课程】:课程通常是一个完整的项目,有一个或多个阶段。
|
|
|
+【阶段】:阶段表示课程的某一单独部分,包含一个或多个任务。
|
|
|
+【任务】:任务是课程的基本单元,包含一个或多个工具,通常写明了学生要具体完成的事项。
|
|
|
+【工具】:工具通常是指学生的作业(在课上要具体做的事情)。比如“提交作业”表示学生需要提交一份文件;又比如“问答”,表示学生需要输入一个回答;再比如“选择题”,表示学生需要根据题目要求选择正确的答案。工具中通常会包含学生的作业数据。
|
|
|
+---
|
|
|
+## 工作流程与规则
|
|
|
+ 1. 了解信息。读取【工具总览表格】以及【工具详情:总体数据】中的内容,了解学生作业详情。
|
|
|
+ 2. 确保信息的完整性和可解读性。当面对不确定信息时,你应当积极提问。这一点适用于以下两种情况:
|
|
|
+ 2.1 当用户的提问需要你对课程、任务或工具拥有完整的信息、而你又缺乏部分信息时,你应当向客户询问你缺少的信息,再回答用户的提问。
|
|
|
+ 2.2 当你不理解某个工具的设置时(比如当你发现题目、选项的表述不完整或者有不符合中文表达规则的符号;又比如你发现缺乏必要的统计信息),你应当积极向用户询问。
|
|
|
+ 2.3 **例外情况**:在告知用户并征得同意的情况下,你可以忽视上述问题并执行后续流程。
|
|
|
+ 3. 进行总结。
|
|
|
+ 3.1 对表格信息进行简单总结。包括任务、阶段、工具及其内容。
|
|
|
+ 3.2 进行结果分析。对于每一个工具,都从全班的角度出发进行简单总结。
|
|
|
+ 3.3 进行错因分析。仅仅针对于某些错误率较高的题目,从全班的角度出发,进行错因分析。
|
|
|
+ 4. 提供扩展题目。针对错误的题目,向用户提供同等水平的题目以起到举一反三的练习效果。
|
|
|
+ 5. 回答问题。当用户询问你某个【工具】的具体信息,这部分信息通常将就是学生的作业。你需要简单总结该部分信息,并就用户的问题进行回答。
|
|
|
+---
|
|
|
+## 做题信息
|
|
|
+学生名称:${_data.username}
|
|
|
+${_wordData}
|
|
|
+
|
|
|
+ `;
|
|
|
+ console.log(_msg);
|
|
|
+ let history = [];
|
|
|
+ this.nowChatList.forEach(i => {
|
|
|
+ if (i.content == "wanSearch") {
|
|
|
+ return;
|
|
|
+ } else if (i.content == "getImage") {
|
|
|
+ return history.push({
|
|
|
+ role: "assistant",
|
|
|
+ content: i.aiContent
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (i.content) {
|
|
|
+ history.push({
|
|
|
+ role: "user",
|
|
|
+ content: i.content
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (i.aiContent) {
|
|
|
+ history.push({
|
|
|
+ role: "assistant",
|
|
|
+ content: i.aiContent
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // if (_msg) {
|
|
|
+ history.push({ role: "user", content: _msg });
|
|
|
+ let params = {
|
|
|
+ message: {
|
|
|
+ anthropic_version: "bedrock-2023-05-31",
|
|
|
+ max_tokens: 4096,
|
|
|
+ temperature: 0,
|
|
|
+ top_p: 1,
|
|
|
+ messages: history
|
|
|
+ },
|
|
|
+ uid: _uuid,
|
|
|
+ model: "Claude 3 Sonnet" // Claude 3 Sonnet或者Claude 3 Haiku
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ // .post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
+ .post("https://claude3.cocorobo.cn/chat", params)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.FunctionResponse.result == "发送成功") {
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.data.FunctionResponse.result);
|
|
|
+ this.chatLoading = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.chatLoading = false;
|
|
|
+ });
|
|
|
+ this.saveUid = _uuid;
|
|
|
+ this.getAiContent(_uuid);
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getChatList().then(_ => {
|
|
|
this.scrollBottom();
|
|
|
- this.getWantSearch();
|
|
|
+ // this.getWantSearch();
|
|
|
});
|
|
|
this.nowChatList = [];
|
|
|
this.initTaskList();
|
|
|
+ this.getWorkData();
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -1685,6 +2195,14 @@ ${_atList
|
|
|
border-bottom: solid 1px #e2f5fc;
|
|
|
}
|
|
|
|
|
|
+.s_b_at_l_top > span:nth-child(1) {
|
|
|
+ display: block;
|
|
|
+ width: calc(100% - 30px);
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+
|
|
|
.s_b_at_l_i_header {
|
|
|
width: 100%;
|
|
|
box-sizing: border-box;
|
|
@@ -1698,6 +2216,14 @@ ${_atList
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
|
|
|
+.s_b_at_l_i_header > span:nth-child(2) {
|
|
|
+ display: block;
|
|
|
+ width: calc(100% - 30px);
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+
|
|
|
.s_b_at_l_top > hover {
|
|
|
background-color: #3781fc;
|
|
|
color: #fff;
|
|
@@ -1845,4 +2371,76 @@ ${_atList
|
|
|
border: solid 1px #fff;
|
|
|
background-color: #3681fc;
|
|
|
}
|
|
|
+
|
|
|
+.s_b_at_studentDetail {
|
|
|
+ width: 100%;
|
|
|
+ height: 25px;
|
|
|
+ margin: 0 0 10px 0;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_studentDetail > img {
|
|
|
+ width: 20px;
|
|
|
+ height: 15px;
|
|
|
+ margin-right: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_studentDetail > span {
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_studentList {
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 25px);
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_sl_item {
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border: solid 1px #36a9fc;
|
|
|
+ padding: 10px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_sl_item > .s_b_at_sl_message:nth-child(n + 1) {
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_sl_phase {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ margin-right: 10px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_sl_message {
|
|
|
+ font-weight: bold;
|
|
|
+ margin: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_sl_message > div {
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ margin: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.s_b_at_sl_message > div > span {
|
|
|
+ width: calc(100% - 50px);
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.s_b_at_sl_message > div > span > div {
|
|
|
+ margin: 5px 0;
|
|
|
+ white-space: wrap;
|
|
|
+}
|
|
|
</style>
|