Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import './commands'

// Ignore WebGL errors in headless CI environments
Cypress.on('uncaught:exception', (err) => {
// Ignore WebGL context creation errors (Three.js in RobotModel)
if (err.message.includes('Error creating WebGL context')) {
return false;
}
// Allow other errors to fail the tests
return true;
});
53 changes: 35 additions & 18 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from "eslint-plugin-storybook";
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { globalIgnores } from 'eslint/config'

export default tseslint.config([
globalIgnores(['dist']),
export default tseslint.config(
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
ignores: [
'dist',
'node_modules',
'storybook-static',
'**/*.stories.ts',
'**/*.stories.tsx',
'scripts/**/*',
'cypress/**/*',
'*.config.js',
'*.config.ts',
'vitest.shims.d.ts',
'src/stories/**/*',
'test/**/*',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
},
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
], storybook.configs["flat/recommended"]);
);
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "vite",
"build": "tsc -b && vite build",
"prebuild": "node scripts/generate-sitemap.js",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --max-warnings 0",
"preview": "vite preview",
"tailwind:init": "tailwindcss init -p",
"type-check": "tsc --noEmit",
Expand All @@ -30,7 +30,7 @@
"@hookform/resolvers": "^5.2.1",
"@tanstack/react-query": "^5.85.6",
"@tanstack/react-query-devtools": "^5.85.6",
"axios": "^1.12.0",
"axios": "^1.13.5",
"clsx": "^2.1.1",
"lucide-react": "^0.534.0",
"react": "^19.1.0",
Expand Down Expand Up @@ -68,7 +68,7 @@
"eslint": "^9.33.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"eslint-plugin-storybook": "^10.1.10",
"eslint-plugin-storybook": "^0.11.1",
"globals": "^16.3.0",
"jsdom": "^27.2.0",
"knip": "^5.73.1",
Expand All @@ -86,8 +86,11 @@
"overrides": {
"glob": "^10.5.0",
"systeminformation": ">=5.27.14",
"qs": ">=6.14.1"
"qs": "^6.14.3",
"lodash": "^4.17.23",
"markdown-it": "^14.1.1",
"ajv": "^6.12.6"
}
},
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
}
}
71 changes: 44 additions & 27 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion src/api/services/assessment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,20 @@ const startAttempt = async (
): Promise<StartAttemptResponse> => {
const response = await apiClient.post<ApiResponse<StartAttemptResponse>>(
`/assessments/${assessmentId}/attempts`,
{ studentId } // <-- Lo envía en el body
{ studentId }
);
return response.data.data;
};

/**
* Endpoint: Obtener intento activo (si existe)
* GET /api/assessments/:assessmentId/active-attempt
*/
const getActiveAttempt = async (
assessmentId: string
): Promise<StartAttemptResponse | null> => {
const response = await apiClient.get<ApiResponse<StartAttemptResponse | null>>(
`/assessments/${assessmentId}/active-attempt`
);
return response.data.data;
};
Expand Down Expand Up @@ -192,6 +205,7 @@ const assessmentService = {
getAssessmentsByCourse,
getById,
startAttempt,
getActiveAttempt,
saveAnswers,
submitAttempt,
getAttemptById,
Expand Down
Loading