feat: erweitere VocabLessonView mit Glossar-Optionen und verbessere die Lückentextformatierung
All checks were successful
Deploy to production / deploy (push) Successful in 2m8s
All checks were successful
Deploy to production / deploy (push) Successful in 2m8s
feat: füge Skript hinzu, um doppelte Muster in Lektionen zu identifizieren feat: implementiere Skript zur Suche nach Übungen anhand von Text feat: erstelle Skript zur Reparatur von Multiple-Choice-Antworten feat: implementiere Skript zum Drucken von Lehrmusterinformationen
This commit is contained in:
31
backend/scripts/find-exercise-by-text.cjs
Normal file
31
backend/scripts/find-exercise-by-text.cjs
Normal file
@@ -0,0 +1,31 @@
|
||||
const { Op } = require('sequelize');
|
||||
const { sequelize } = require('../utils/sequelize.js');
|
||||
const VocabGrammarExercise = require('../models/community/vocab_grammar_exercise.js');
|
||||
|
||||
async function main() {
|
||||
await sequelize.authenticate();
|
||||
const where = {
|
||||
[Op.or]: [
|
||||
{ questionData: { [Op.iLike]: '%Hals%' } },
|
||||
{ questionData: { [Op.iLike]: '%Kehle%' } },
|
||||
{ questionData: { [Op.iLike]: '%tutunlan%' } },
|
||||
{ answerData: { [Op.iLike]: '%tutunlan%' } },
|
||||
{ answerData: { [Op.iLike]: '%Sakit akong tutunlan%' } }
|
||||
]
|
||||
};
|
||||
|
||||
const rows = await VocabGrammarExercise.findAll({ where, limit: 50 });
|
||||
if (!rows.length) {
|
||||
console.log('No matching exercises found');
|
||||
process.exit(0);
|
||||
}
|
||||
for (const r of rows) {
|
||||
console.log('---');
|
||||
console.log('id:', r.id, 'lessonId:', r.lessonId, 'exerciseTypeId:', r.exerciseTypeId, 'title:', r.title);
|
||||
console.log('questionData:', r.questionData);
|
||||
console.log('answerData:', r.answerData);
|
||||
}
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
main().catch((err) => { console.error(err); process.exit(2); });
|
||||
Reference in New Issue
Block a user