From 84a118b5eaf4596f512a841732a186710f113ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A0=82=E5=90=89=E8=AF=83=E5=BE=B7=E6=8B=89=E6=9B=BC?= =?UTF-8?q?=E6=9F=A5=E7=9A=84=E8=8B=B1=E8=B1=AA?= Date: Fri, 7 Aug 2026 17:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=A8=E8=80=83=E8=AF=95=E7=AD=94?= =?UTF-8?q?=E9=A2=98=E9=94=99=E9=A2=98=E8=81=9A=E5=90=88=E5=A5=91=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExamService/ExamService.php | 42 ++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/ExamService/ExamService.php b/src/ExamService/ExamService.php index 2dca330..543091b 100644 --- a/src/ExamService/ExamService.php +++ b/src/ExamService/ExamService.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace Dhd\Micro\Interface\ExamService; /** - * 试题中心聚合契约(管理后台使用范围) + * 试题中心聚合契约 */ interface ExamService extends CustomQuestionInterface, @@ -50,27 +50,57 @@ interface ExamService extends public function submitPractice(int $userId, int $paperId, array $answers): array; /** - * 开始考试(V1 兼容接口). + * 开始考试. */ public function startExam(array $params): array; /** - * 提交考试(V1 兼容接口). + * 提交考试. */ public function submitExam(array $params): array; /** - * 获取用户考试记录列表(V1 兼容接口). + * 获取用户考试记录列表. */ public function getUserExamRecords(array $params): array; /** - * 获取考试记录详情(V1 兼容接口). + * 获取考试记录详情. */ public function getExamRecordDetail(int $recordId, int $userId): array; /** - * 获取考试记录题目列表(V1 兼容接口). + * 获取考试记录题目列表. */ public function getByRecordId(int $userId, int $recordId): array; + + /** + * 保存用户答题记录. + */ + public function saveAnswer(array $params): bool; + + /** + * 获取用户错题列表. + */ + public function getUserWrongQuestions(array $params): array; + + /** + * 标记错题为已掌握. + */ + public function markAsMastered(int $userId, int $wrongId): bool; + + /** + * 添加错题笔记(避免与题目笔记 addNote 重名). + */ + public function addWrongQuestionNote(array $params): bool; + + /** + * 获取题目错误统计. + */ + public function getErrorStats(int $userId, int $questionId): array; + + /** + * 批量更新题目得分. + */ + public function batchUpdateScores(array $params): bool; }