修改測驗時間、新增測驗提醒、新增截止測驗功能
This commit is contained in:
@@ -6,10 +6,11 @@ import { getAllLogicQuestions } from '@/lib/database/models/logic_question'
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const body = await request.json()
|
||||
const {
|
||||
const {
|
||||
userId,
|
||||
answers,
|
||||
completedAt
|
||||
completedAt,
|
||||
isTimeout = false
|
||||
} = body
|
||||
|
||||
// 驗證必要欄位
|
||||
@@ -75,7 +76,8 @@ export async function POST(request: NextRequest) {
|
||||
score: score,
|
||||
total_questions: questions.length,
|
||||
correct_answers: correctAnswers,
|
||||
completed_at: mysqlCompletedAt
|
||||
completed_at: mysqlCompletedAt,
|
||||
is_timeout: isTimeout
|
||||
})
|
||||
|
||||
console.log('測試結果建立結果:', testResult)
|
||||
|
Reference in New Issue
Block a user