diff --git a/src/config/index.js b/src/config/index.js index 4c0e555..881a35a 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -47,6 +47,40 @@ export const PROBLEM_API_URL = "https://ark.cn-beijing.volces.com/api/v3/chat/co export const PROBLEM_MODEL = "doubao-seed-2-0-lite-260215"; export const PROBLEM_API_KEY = "2d46f767-6476-4858-8041-540fcae99808"; // 使用 DOUBAO_KEY +// ── 试题生成接口(使用 Gemini-3.1-pro)── +export const QUESTION_API_URL = "https://grsaiapi.com/v1/chat/completions"; +export const QUESTION_MODEL = "gemini-3.1-pro"; +export const QUESTION_TEMPERATURE = 0.8; +export const QUESTION_MAX_TOKENS = 4096; + +// 试题生成 System Prompt +export const QUESTION_GENERATOR_PROMPT = `你是一位专业的英语试题出题专家。请根据用户指定的参数生成高质量的英语试题。 + +输出格式要求: +## 题目 [序号] +**题目类型**:[类型] +**难度等级**:[难度] +**题目内容**: +[题目文本] +**选项**: +A. [选项A内容] +B. [选项B内容] +C. [选项C内容] +D. [选项D内容] +**正确答案**:[答案,如:A] +**解析**:[详细解析] +**知识点**:[相关知识点] + +重要规则: +1. 所有题型都必须提供4个选项(A、B、C、D),即使是填空题、翻译题或阅读理解题 +2. 对于填空题:选项为不同的填空答案选项 +3. 对于翻译题:选项为不同的翻译版本 +4. 对于阅读理解题:选项为对问题的不同回答选项 +5. 题目质量要高,符合英语教学标准 +6. 答案准确无误 +7. 解析清晰易懂,有助于学生理解 +8. 知识点标注准确,便于分类学习`; + // ── 文件上传限制 ── export const IMAGE_MAX_SIZE_MB = 10; export const IMAGE_ALLOWED_TYPES_ESSAY = ["image/jpeg", "image/jpg", "image/png"]; diff --git a/src/router/index.js b/src/router/index.js index 4691e4b..523add5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,6 +6,7 @@ import EssayCorrection from '../views/EssayCorrection.vue' import ExamAnalysis from '../views/ExamAnalysis.vue' import SpellPractice from '../views/SpellPractice.vue' import ProblemSolving from '../views/ProblemSolving.vue' +import QuestionGenerator from '../views/QuestionGenerator.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -45,6 +46,11 @@ const router = createRouter({ name: 'problem-solving', component: ProblemSolving }, + { + path: '/question-generator', + name: 'question-generator', + component: QuestionGenerator + }, ] }) diff --git a/src/views/HomePage.vue b/src/views/HomePage.vue index 2800594..a45bdb7 100644 --- a/src/views/HomePage.vue +++ b/src/views/HomePage.vue @@ -61,6 +61,14 @@ const features = ref([ icon: "puzzle", route: "/problem-solving", }, + { + id: 8, + title: "AI试题生成", + desc: "智能生成英语试题,支持选择题、填空题、翻译题和阅读理解,可自定义难度、数量和知识点,快速创建高质量题库。", + class: "card-8", + icon: "document", + route: "/question-generator", + }, ]); // Hover effect for glassmorphism glare @@ -242,6 +250,22 @@ onUnmounted(() => { d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /> + + + + +

{{ feature.title }}

@@ -419,6 +443,11 @@ h1 { box-shadow: 0 8px 20px -6px rgba(139, 92, 246, 0.5); } +.card-8 .icon-wrapper { + background: linear-gradient(135deg, #10b981, #059669); + box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.5); +} + .card-title { font-size: 1.5rem; font-weight: 600; diff --git a/src/views/QuestionGenerator.vue b/src/views/QuestionGenerator.vue new file mode 100644 index 0000000..b8c72ff --- /dev/null +++ b/src/views/QuestionGenerator.vue @@ -0,0 +1,1285 @@ + + + + +