const { Question, Category } = require('./models'); async function checkQuestions() { try { const questions = await Question.findAll({ where: { isActive: true }, include: [{ model: Category, as: 'category', attributes: ['name'] }], attributes: ['id', 'questionText', 'categoryId', 'difficulty'], limit: 10 }); console.log(`\nTotal active questions: ${questions.length}\n`); if (questions.length === 0) { console.log('❌ No questions found in database!'); console.log('\nYou need to run the questions seeder:'); console.log(' npm run seed'); console.log('\nOr specifically:'); console.log(' npx sequelize-cli db:seed --seed 20241109215000-demo-questions.js'); } else { questions.forEach((q, idx) => { console.log(`${idx + 1}. ${q.questionText.substring(0, 60)}...`); console.log(` Category: ${q.category?.name || 'N/A'} | Difficulty: ${q.difficulty}`); }); } process.exit(0); } catch (error) { console.error('Error:', error); process.exit(1); } } checkQuestions();