|
|
@@ -17,10 +17,11 @@
|
|
|
}}</div>
|
|
|
<div class="c_t45_msg">
|
|
|
<div>{{ lang.ssAnswerCount }} {{ props.showData.workArray.length }}<span
|
|
|
- v-if="props.showData.unsubmittedStudents.length > 0">/{{ props.showData.unsubmittedStudents.length
|
|
|
+ v-if="props.showData.unsubmittedStudents.length > 0">/{{ props.showData.workArray.length +
|
|
|
+ props.showData.unsubmittedStudents.length
|
|
|
}}</span></div>
|
|
|
<span v-if="props.showData.unsubmittedStudents.length > 0" @click="viewUnsubmittedStudents()">{{
|
|
|
- lang.ssViewUnsubmittedStudents }}</span>
|
|
|
+ lang.ssViewSubmitStatus2 }}</span>
|
|
|
</div>
|
|
|
<!--<span class="c_t45_t_btn" :class="{'c_t45_t_btn_noActive': props.showData.workIndex <= 0}" @click="changeWorkIndex(0)">{{ lang.ssPrevQ }}</span>-->
|
|
|
<!--<span class="c_t45_t_btn" :class="{'c_t45_t_btn_noActive': props.showData.workIndex >= props.showData.choiceQuestionListData.length - 1}" @click="changeWorkIndex(1)">{{ lang.ssNextQ }}</span>-->
|
|
|
@@ -75,7 +76,8 @@
|
|
|
<div class="ai_echartsData" v-if="currentAnalysis && currentAnalysis.json.keyword">
|
|
|
{{ currentAnalysis.json.keyword }}
|
|
|
</div>
|
|
|
- <div class="generatingContent" v-if="currentAnalysis && currentAnalysis.loading">{{lang.ssGeneratingContent}}...</div>
|
|
|
+ <div class="generatingContent" v-if="currentAnalysis && currentAnalysis.loading">
|
|
|
+ {{ lang.ssGeneratingContent }}...</div>
|
|
|
<div class="ai_updateTime" v-if="currentAnalysis">{{ lang.ssUpdateTime }}:{{ currentAnalysis.update_at }}
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -144,10 +146,11 @@
|
|
|
</div>
|
|
|
<div class="ai_echartsData" v-if="currentAnalysis && currentAnalysis.json.keyword">
|
|
|
<div class="title">{{ lang.ssKeyword }}:</div>
|
|
|
- <span v-for="(item,index) in currentAnalysis.json.keyword" :key="index">{{ item }}</span>
|
|
|
+ <span v-for="(item, index) in currentAnalysis.json.keyword" :key="index">{{ item }}</span>
|
|
|
<div class="btn" @click="openEchatsDialog()">{{ lang.ssViewKeywordCloud }}</div>
|
|
|
</div>
|
|
|
- <div class="generatingContent" v-if="currentAnalysis && currentAnalysis.generatingContent">{{ lang.ssGeneratingContent }}...</div>
|
|
|
+ <div class="generatingContent" v-if="currentAnalysis && currentAnalysis.generatingContent">{{
|
|
|
+ lang.ssGeneratingContent }}...</div>
|
|
|
<div class="ai_updateTime" v-if="currentAnalysis">{{ lang.ssUpdateTime }}:{{ currentAnalysis.update_at }}
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -316,6 +319,7 @@ const props = defineProps<{
|
|
|
courseDetail: any;
|
|
|
userId: string;
|
|
|
workId: string;
|
|
|
+ cid: string;
|
|
|
}>()
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
@@ -731,7 +735,7 @@ const getAnalysis = () => {
|
|
|
}
|
|
|
console.log('props.workId', props.workId)
|
|
|
const params = {
|
|
|
- pid: props.workId,
|
|
|
+ pid: props.workId + (props.cid ? ',' + props.cid : ''),
|
|
|
}
|
|
|
axios.get('https://pbl.cocorobo.cn/api/pbl/select_pptAnalysisByPid?pid=' + params.pid).then(res => {
|
|
|
const data = res[0]
|
|
|
@@ -868,7 +872,7 @@ watch(
|
|
|
|
|
|
// 查看未提交学生
|
|
|
const viewUnsubmittedStudents = () => {
|
|
|
- selectUserDialogRef.value.open(lang.ssUnsubmittedStudents, { user: props.showData.unsubmittedStudents.map((item: any) => item.name) })
|
|
|
+ selectUserDialogRef.value.open(lang.ssSubmitStatus, { user: props.showData.unsubmittedStudents.map((item: any) => item.name), notFiledUser: props.showData.unsubmittedStudents.map((item: any) => item.name), isSubmitUser: props.workArray.map((item: any) => item.name) })
|
|
|
// if (props.unsubmittedStudents.length > 0) {
|
|
|
// unsubmittedStudentsDialogRef.value.open(props.unsubmittedStudents)
|
|
|
// }
|
|
|
@@ -909,7 +913,7 @@ const aiAnalysisRefresh45 = () => {
|
|
|
|
|
|
if (!currentAnalysis.value) {
|
|
|
aiAnalysisData.value.push({
|
|
|
- pid: props.workId,
|
|
|
+ pid: props.workId + (props.cid ? ',' + props.cid : ''),
|
|
|
index: props.showData.workIndex,
|
|
|
loading: true,
|
|
|
generatingContent: true,
|
|
|
@@ -921,32 +925,32 @@ const aiAnalysisRefresh45 = () => {
|
|
|
}
|
|
|
else {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).loading = true
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json = { text: '', echartsData: '' }
|
|
|
}
|
|
|
|
|
|
chat_stream(msg, 'a7741704-ba56-40b7-a6b8-62a423ef9376', props.userId, lang.lang, (event) => {
|
|
|
if (event.type === 'message') {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json.text = event.data
|
|
|
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).loading = false
|
|
|
}
|
|
|
else if (event.type === 'messageEnd') {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json.text = event.data
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).noEnd = false
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).update_at = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }).replace(/\//g, '-')
|
|
|
saveAnalysis()
|
|
|
}
|
|
|
@@ -988,7 +992,7 @@ const aiAnalysisRefresh15 = () => {
|
|
|
30人中15人提交问答题(参与率50%),核心概念“同理心地图”掌握薄弱。发现学生13在智能体对话中6次答“不知道”,需单独辅导设计思维基础概念。建议课程增加POV框架实例演练,强化痛点识别能力训练。`
|
|
|
if (!currentAnalysis.value) {
|
|
|
aiAnalysisData.value.push({
|
|
|
- pid: props.workId,
|
|
|
+ pid: props.workId + (props.cid ? ',' + props.cid : ''),
|
|
|
index: props.showData.workIndex,
|
|
|
loading: true,
|
|
|
generatingContent: true,
|
|
|
@@ -1000,19 +1004,19 @@ const aiAnalysisRefresh15 = () => {
|
|
|
}
|
|
|
else {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).loading = true
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json = { text: '', echartsData: '' }
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).generatingContent = true
|
|
|
}
|
|
|
getWordCloud15().then((res) => {
|
|
|
flag += 1
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).generatingContent = false
|
|
|
if (flag == 2) {
|
|
|
saveAnalysis()
|
|
|
@@ -1022,22 +1026,22 @@ const aiAnalysisRefresh15 = () => {
|
|
|
console.log(event)
|
|
|
if (event.type === 'message') {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json.text = event.data
|
|
|
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).loading = false
|
|
|
}
|
|
|
else if (event.type === 'messageEnd') {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json.text = event.data
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).noEnd = false
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).update_at = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }).replace(/\//g, '-')
|
|
|
flag += 1
|
|
|
if (flag == 2) {
|
|
|
@@ -1053,7 +1057,7 @@ const aiAnalysisRefresh15 = () => {
|
|
|
// 打开词云图弹窗
|
|
|
const openEchatsDialog = () => {
|
|
|
if (echartsDialogRef.value && currentAnalysis.value.json.echartsData) {
|
|
|
- echartsDialogRef.value.open(lang.ssKeywordCloud,currentAnalysis.value.json.echartsData)
|
|
|
+ echartsDialogRef.value.open(lang.ssKeywordCloud, currentAnalysis.value.json.echartsData)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1063,12 +1067,17 @@ const openEchatsDialog = () => {
|
|
|
const getWordCloud15 = () => {
|
|
|
|
|
|
return new Promise((resolve,) => {
|
|
|
- const msg = `## 任务 请基于以下文本,提炼出10 - 30个关键词,用于绘制词云图。请给出相应的关键词,以及关键词出现的频次。请确保输出的关键字准确反映该段文本的主要内容和主题。
|
|
|
-## 要求
|
|
|
-1. ** 提取关键词 **:从提供的文本中提取出10 - 30个最具代表性的关键字。关键词应该涵盖该文本的主要概念、重要术语和核心主题。尽量选择多样化的关键词,避免过于集中在某一个主题或概念上。
|
|
|
- 2. ** 词频统计 **:计算每个关键字在文本中出现的频率。
|
|
|
- 3. ** 词汇大小 **:根据词频数量,确定每个关键字在词云图中的大小。词频越高,词汇大小数值越大,数值范围1 - 100。
|
|
|
- 4. ** 输出格式 **:输出结果应包含输出相应的关键词或元话语、对应的词频数量以及词汇大小数值,请以json格式输出,严格按照输出示例输出。
|
|
|
+ const msg = `## 任务
|
|
|
+请针对文本中学生提交的问答题回答内容进行深度分析,提炼出 10 - 30 个核心关键词,用于绘制词云图。
|
|
|
+## 提取准则
|
|
|
+1. 聚焦内容主体:仅从学生的具体回答文本中提取关键词。
|
|
|
+2. 严格排除杂质:禁止提取任何属于系统元数据或固定格式的词汇,包括但不限于:“课程数据”、“学生姓名”、“回答结果”、“课程标题”、“提交时间”、“作业名称”、“分数”等。
|
|
|
+3. 语义去重:将意思相近的词进行合并(例如“高效”与“效率高”),保留最具代表性的词条。
|
|
|
+4. 涵盖核心:关键词应准确反映学生回答中的核心观点、关键知识点、高频论据或情感倾向。
|
|
|
+## 任务要求
|
|
|
+1. 词频统计:计算每个有效关键字在回答内容中出现的频率。
|
|
|
+2. 词汇大小:根据词频,确定每个关键字在词云中的权重。词频越高,数值越大,范围 1 - 100。
|
|
|
+3. 输出格式:请严格按照 JSON 格式输出,包含关键词、词频及对应的词汇大小。
|
|
|
|
|
|
## 文本
|
|
|
课程数据:
|
|
|
@@ -1076,7 +1085,7 @@ const getWordCloud15 = () => {
|
|
|
- 课程学科:${props.courseDetail.name}
|
|
|
当前页面答题数据(问答题):【分析重点】
|
|
|
- 问答题题目:${props.showData.workDetail.json.answerQ}
|
|
|
-- 回答数据:${JSON.stringify(processedWorkArray.value.map((i) => ({ user: i.name, answer: i.content.answer })))}
|
|
|
+- 回答数据:${JSON.stringify(processedWorkArray.value.map((i) => ({ answer: i.content.answer })))}
|
|
|
|
|
|
## 输出示例
|
|
|
{"tooltip":{"show":false},"series":[{"type":"wordCloud","sizeRange":[14,38],"rotationRange":[0,0],"keepAspect":false,"shape":"circle","left":"center","top":"center","right":null,"bottom":null,"width":"100%","height":"100%","rotationStep":20,"data":[{"value":"词汇大小,数值范围1-100","name":"词汇","textStyle":{"color":"词汇颜色(16进制)"}},{"value":"词汇大小,数值范围1-100","name":"词汇","textStyle":{"color":"(16进制)"}}]}]}`
|
|
|
@@ -1084,7 +1093,7 @@ const getWordCloud15 = () => {
|
|
|
|
|
|
chat_no_stream(msg, 'a7741704-ba56-40b7-a6b8-62a423ef9376', props.userId, lang.lang).promise.then((res) => {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json.echartsData = JSON.parse(res)
|
|
|
resolve(1)
|
|
|
}).catch(err => {
|
|
|
@@ -1103,10 +1112,18 @@ const aiAnalysisRefresh72 = async () => {
|
|
|
|
|
|
processedWorkArray.value.forEach((i) => {
|
|
|
i.content.forEach(j => {
|
|
|
- j.messages.forEach((a) => {
|
|
|
- chatMsg += `\n${a.sender}:
|
|
|
+ if (j.messages) {
|
|
|
+ j.messages.forEach((a) => {
|
|
|
+ chatMsg += `\n${a.sender}:
|
|
|
${a.content}\n`
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(j.imageUrls){
|
|
|
+ j.imageUrls.forEach((a) => {
|
|
|
+ chatMsg += `\n${a}\n`
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
|
|
|
})
|
|
|
@@ -1145,7 +1162,7 @@ ${a.content}\n`
|
|
|
console.log("cs", msg)
|
|
|
if (!currentAnalysis.value) {
|
|
|
aiAnalysisData.value.push({
|
|
|
- pid: props.workId,
|
|
|
+ pid: props.workId + (props.cid ? ',' + props.cid : ''),
|
|
|
index: props.showData.workIndex,
|
|
|
loading: true,
|
|
|
json: { text: '', echartsData: '' },
|
|
|
@@ -1156,32 +1173,32 @@ ${a.content}\n`
|
|
|
}
|
|
|
else {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).loading = true
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json = { text: '', echartsData: '' }
|
|
|
}
|
|
|
|
|
|
chat_stream(msg, 'a7741704-ba56-40b7-a6b8-62a423ef9376', props.userId, lang.lang, (event) => {
|
|
|
if (event.type === 'message') {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json.text = event.data
|
|
|
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).loading = false
|
|
|
}
|
|
|
else if (event.type === 'messageEnd') {
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).json.text = event.data
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).noEnd = false
|
|
|
aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
}).update_at = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }).replace(/\//g, '-')
|
|
|
saveAnalysis()
|
|
|
}
|
|
|
@@ -1194,7 +1211,7 @@ ${a.content}\n`
|
|
|
// 当前分析
|
|
|
const currentAnalysis = computed(() => {
|
|
|
let _result = aiAnalysisData.value.find((item: any) => {
|
|
|
- return item.pid === props.workId && item.index === props.showData.workIndex
|
|
|
+ return item.pid === props.workId + (props.cid ? ',' + props.cid : '') && item.index === props.showData.workIndex
|
|
|
})
|
|
|
|
|
|
if (_result?.json?.echartsData) {
|
|
|
@@ -1216,7 +1233,7 @@ const saveAnalysis = () => {
|
|
|
return
|
|
|
}
|
|
|
const params = [{
|
|
|
- pid: props.workId,
|
|
|
+ pid: props.workId + (props.cid ? ',' + props.cid : ''),
|
|
|
idx: props.showData.workIndex,
|
|
|
json: JSON.stringify(currentAnalysis.value.json),
|
|
|
}]
|
|
|
@@ -2021,11 +2038,13 @@ onUnmounted(() => {
|
|
|
font-size: 1rem;
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
- &>.ai_echartsData{
|
|
|
+
|
|
|
+ &>.ai_echartsData {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
gap: .5rem;
|
|
|
- &>span{
|
|
|
+
|
|
|
+ &>span {
|
|
|
padding: .2rem .5rem;
|
|
|
border-radius: .25rem;
|
|
|
background: #E6F4FF;
|
|
|
@@ -2035,10 +2054,12 @@ onUnmounted(() => {
|
|
|
color: #141517;
|
|
|
font-size: .75rem;
|
|
|
}
|
|
|
- &>.title{
|
|
|
+
|
|
|
+ &>.title {
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
- &>.btn{
|
|
|
+
|
|
|
+ &>.btn {
|
|
|
font-size: .9rem;
|
|
|
text-decoration: underline;
|
|
|
color: #F6C82B;
|