@ooopenlab/quiz-shared
Version:
Shared utilities and components for SuperQuiz modules
48 lines (42 loc) • 1.22 kB
text/typescript
/**
* Constants used across the quiz system
*/
export const QUIZ_CONSTANTS = {
// Screen types
SCREEN_TYPES: {
COVER: 'cover',
QUESTION: 'question',
RESULT: 'result'
} as const,
// Quiz routing patterns
ROUTES: {
QUIZ_BASE: '/quiz/[quizId]',
QUIZ_QUESTION: '/quiz/[quizId]/question/[questionIndex]',
QUIZ_RESULT: '/quiz/[quizId]/result'
} as const,
// Module feature flags
FEATURES: {
MULTI_QUESTIONS: 'multiQuestions',
IS_FACTOR: 'isFactor',
SCORED_RESULT: 'scoredResult',
HAS_GEN_AI: 'hasGenAI'
} as const,
// Default values
DEFAULTS: {
MODULE_VERSION: '1.0.0',
FORM_FIELD_REQUIRED: false,
TEXTAREA_ROWS: 4,
MAX_FILE_SIZE: 5 * 1024 * 1024, // 5MB
DEBOUNCE_DELAY: 300,
THROTTLE_LIMIT: 100
} as const,
// Validation rules
VALIDATION: {
MIN_PASSWORD_LENGTH: 8,
MAX_TEXT_LENGTH: 1000,
MAX_TEXTAREA_LENGTH: 5000,
MAX_FILE_COUNT: 10
} as const
} as const;
export type ScreenType = typeof QUIZ_CONSTANTS.SCREEN_TYPES[keyof typeof QUIZ_CONSTANTS.SCREEN_TYPES];
export type FeatureFlag = typeof QUIZ_CONSTANTS.FEATURES[keyof typeof QUIZ_CONSTANTS.FEATURES];