Files
teach_sys_Demo/verify_homework_structure.cjs
KQL 1b964b3886 chore: 更新数据文件和组件优化
主要更新内容:
- 优化UI组件(视频播放器、HR访问模态框、岗位信息展示等)
- 更新数据文件(简历、岗位、项目案例等)
- 添加新的图片资源(面试状态图标等)
- 新增AgentPage等页面组件
- 清理旧的备份文件,提升代码库整洁度
- 优化岗位等级和面试状态的数据结构

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 15:55:25 +08:00

46 lines
2.0 KiB
JavaScript

const fs = require('fs');
const path = require('path');
// 读取 mockData.js 并提取 homework 数据
const mockDataPath = path.join(__dirname, 'src/data/mockData.js');
const mockDataContent = fs.readFileSync(mockDataPath, 'utf-8');
// 简单验证关键结构
const checks = {
'复合能力课存在': /name: "复合能力课"/.test(mockDataContent),
'垂直能力课存在': /name: "垂直能力课"/.test(mockDataContent),
'复合能力课有list字段': /name: "复合能力课"[^]*?list: \[/.test(mockDataContent),
'垂直能力课有list字段': /name: "垂直能力课"[^]*?list: \[/.test(mockDataContent),
'复合能力课有units字段': /name: "复合能力课"[^]*?units: \[/.test(mockDataContent),
'垂直能力课有units字段': /name: "垂直能力课"[^]*?units: \[/.test(mockDataContent),
'展会主题与品牌定位有isShowCase标记': /name: "展会主题与品牌定位".*isShowCase: true/.test(mockDataContent)
};
console.log('===== homework 数据结构验证 =====\n');
let allPassed = true;
Object.entries(checks).forEach(([checkName, result]) => {
const status = result ? '✅' : '❌';
console.log(`${status} ${checkName}`);
if (!result) allPassed = false;
});
console.log('\n===== 课程数量统计 =====\n');
// 统计 list 中的课程数量
const compoundListMatch = mockDataContent.match(/name: "复合能力课"[\s\S]*?list: \[([\s\S]*?)\]\s*\}/);
const verticalListMatch = mockDataContent.match(/name: "垂直能力课"[\s\S]*?list: \[([\s\S]*?)\]\s*\}/);
if (compoundListMatch) {
const compoundCourses = (compoundListMatch[1].match(/\{ id:/g) || []).length;
console.log(`复合能力课 list 中的课程数: ${compoundCourses}`);
}
if (verticalListMatch) {
const verticalCourses = (verticalListMatch[1].match(/\{ id:/g) || []).length;
console.log(`垂直能力课 list 中的课程数: ${verticalCourses}`);
}
console.log('\n===== 总结 =====\n');
console.log(allPassed ? '✅ 所有检查通过!' : '❌ 存在问题,请检查上述失败项');