fix: MC options display, question selection, timeout handling, and grading prompts

This commit is contained in:
Developer
2026-06-03 20:58:19 +08:00
parent a71bde3452
commit 6d9acd7252
12 changed files with 408 additions and 157 deletions
@@ -231,7 +231,7 @@ export class AssessmentController {
@ApiOperation({ summary: 'Batch delete assessment sessions (admin only)' })
async batchDelete(@Request() req: any, @Body() body: { ids: string[] }) {
const user = req.user;
const isAdmin = user.role === 'super_admin' || user.role === 'admin';
const isAdmin = user.role?.toLowerCase() === 'super_admin' || user.role?.toLowerCase() === 'admin';
if (!isAdmin) {
throw new ForbiddenException('Only admin can batch delete');
}
@@ -286,7 +286,7 @@ export class AssessmentController {
@Request() req: any,
) {
const { id: userId, tenantId, role } = req.user;
const isAdmin = role === 'super_admin' || role === 'admin';
const isAdmin = role?.toLowerCase() === 'super_admin' || role?.toLowerCase() === 'admin';
if (!isAdmin) {
throw new ForbiddenException('Only admin can force end assessment');
}