## 数据来源 - 239个Word文档(.doc格式) - 6门金融课程真实评分数据 - 40名学生(233061301101-140) ## 完成工作 ### ✅ 第一批次:基础数据 - 学生名单:40名真实学生 - 课程项目:6门真实课程 - 年级/班级:2023级金融工程1班 ### ✅ 第二批次:评价数据 - 企业评价:40条(百分制→5分制) - 教师评价:40条(基于Word学校评分) - 专家评价:40条(综合评分) ### ✅ 第三批次:画像数据 - 能力维度:5个真实维度(数据采集、数据清洗、数据分析、结果解读、工具实操) - abilityRadar:40名学生的5维能力分数(基于Word文档计算平均值) - gradeDistribution:40名学生的6门课程真实总分 ## 核心原则 ✅ 所有mock数据完全基于Word文档真实数据 ✅ 可以计算组合现有数据,但禁止随意编造 ✅ Word文档不包含的内容,保持现有或标记为空 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
90 lines
3.6 KiB
Python
90 lines
3.6 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
"""
|
|
更新mockData.js中的评价数据部分
|
|
"""
|
|
|
|
import json
|
|
import re
|
|
|
|
# 读取生成的评价数据
|
|
with open('分析报告/generated_evaluations.json', 'r', encoding='utf-8') as f:
|
|
evals = json.load(f)
|
|
|
|
# 读取原mockData.js
|
|
with open('src/utils/mockData.js', 'r', encoding='utf-8') as f:
|
|
original_content = f.read()
|
|
|
|
# 生成新的评价数据JS代码
|
|
def generate_evaluation_js():
|
|
lines = []
|
|
|
|
# Company评价
|
|
lines.append(' // 企业评价记录')
|
|
lines.append(' company: {')
|
|
for student_id, data in sorted(evals['company'].items(), key=lambda x: int(x[0])):
|
|
lines.append(f' {student_id}: {{')
|
|
lines.append(f" attitude: {data['attitude']},")
|
|
lines.append(f" skills: {data['skills']},")
|
|
lines.append(f" communication: {data['communication']},")
|
|
lines.append(f" problemSolving: {data['problemSolving']},")
|
|
lines.append(f" overall: '{data['overall']}',")
|
|
lines.append(f" suggestions: '{data['suggestions']}',")
|
|
lines.append(f" evaluatedAt: '{data['evaluatedAt']}',")
|
|
lines.append(f" evaluatorName: '{data['evaluatorName']}'")
|
|
lines.append(' },')
|
|
lines.append(' },\n')
|
|
|
|
# Teacher评价
|
|
lines.append(' // 教师评价记录')
|
|
lines.append(' teacher: {')
|
|
for student_id, data in sorted(evals['teacher'].items(), key=lambda x: int(x[0])):
|
|
lines.append(f' {student_id}: {{')
|
|
lines.append(f" theory: {data['theory']},")
|
|
lines.append(f" practice: {data['practice']},")
|
|
lines.append(f" innovation: {data['innovation']},")
|
|
lines.append(f" attitude: {data['attitude']},")
|
|
lines.append(f" courseGrade: {data['courseGrade']},")
|
|
lines.append(f" comments: '{data['comments']}',")
|
|
lines.append(f" evaluatedAt: '{data['evaluatedAt']}',")
|
|
lines.append(f" evaluatorName: '{data['evaluatorName']}'")
|
|
lines.append(' },')
|
|
lines.append(' },\n')
|
|
|
|
# Expert评价
|
|
lines.append(' // 专家评价记录')
|
|
lines.append(' expert: {')
|
|
for student_id, data in sorted(evals['expert'].items(), key=lambda x: int(x[0])):
|
|
lines.append(f' {student_id}: {{')
|
|
lines.append(f" industryKnowledge: {data['industryKnowledge']},")
|
|
lines.append(f" technicalDepth: {data['technicalDepth']},")
|
|
lines.append(f" applicationAbility: {data['applicationAbility']},")
|
|
lines.append(f" potential: {data['potential']},")
|
|
lines.append(f" professionalAdvice: '{data['professionalAdvice']}',")
|
|
lines.append(f" recommendation: '{data['recommendation']}',")
|
|
lines.append(f" evaluatedAt: '{data['evaluatedAt']}',")
|
|
lines.append(f" evaluatorName: '{data['evaluatorName']}'")
|
|
lines.append(' },')
|
|
lines.append(' },\n')
|
|
|
|
return '\n'.join(lines)
|
|
|
|
# 查找并替换评价数据部分
|
|
# 匹配从 "company: {" 到 "expert: {...}" 结束的部分
|
|
pattern = r'(// Mock评价数据存储\nexport const mockEvaluationData = \{)\n(.*?)(\n\n // 学生提交记录\n submissions: \{)'
|
|
|
|
new_evaluation_data = generate_evaluation_js()
|
|
|
|
replacement = r'\1\n' + new_evaluation_data + r'\3'
|
|
|
|
new_content = re.sub(pattern, replacement, original_content, flags=re.DOTALL)
|
|
|
|
# 写回文件
|
|
with open('src/utils/mockData.js', 'w', encoding='utf-8') as f:
|
|
f.write(new_content)
|
|
|
|
print('✅ mockData.js 评价数据已更新!')
|
|
print(f' - 企业评价: {len(evals["company"])}条')
|
|
print(f' - 教师评价: {len(evals["teacher"])}条')
|
|
print(f' - 专家评价: {len(evals["expert"])}条')
|