feat(migrations): add migration to replace tautological vocabulary prompts in Cebu travel lesson
All checks were successful
Deploy to production / deploy (push) Successful in 2m58s
All checks were successful
Deploy to production / deploy (push) Successful in 2m58s
This commit is contained in:
@@ -0,0 +1,48 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
/** Replaces tautological vocabulary prompts in the Cebu travel lesson. */
|
||||||
|
module.exports = {
|
||||||
|
async up(queryInterface) {
|
||||||
|
await queryInterface.sequelize.transaction(async (transaction) => {
|
||||||
|
const baseWhere = `
|
||||||
|
exercise.lesson_id = lesson.id
|
||||||
|
AND (lesson.id = 1532 OR (lesson.course_id = 1 AND lesson.lesson_number = 55))
|
||||||
|
AND lesson.title = 'Wege & Verkehr'
|
||||||
|
`;
|
||||||
|
await queryInterface.sequelize.query(`
|
||||||
|
UPDATE community.vocab_grammar_exercise AS exercise
|
||||||
|
SET title = 'Wege & Verkehr: Fahrzeug finden',
|
||||||
|
instruction = 'Wähle das passende Wort für die Situation.',
|
||||||
|
question_data = '{"type":"multiple_choice","question":"Du suchst ein Fahrzeug für die Fahrt. Welches Wort passt?","options":["hunong","sakyanan","jeepney","dalan"]}'::jsonb,
|
||||||
|
answer_data = '{"type":"multiple_choice","correctAnswer":1}'::jsonb,
|
||||||
|
explanation = 'Sakyanan bedeutet Fahrzeug oder Auto.'
|
||||||
|
FROM community.vocab_course_lesson AS lesson
|
||||||
|
WHERE ${baseWhere} AND exercise.exercise_number = 1;
|
||||||
|
`, { transaction });
|
||||||
|
await queryInterface.sequelize.query(`
|
||||||
|
UPDATE community.vocab_grammar_exercise AS exercise
|
||||||
|
SET title = 'Wege & Verkehr: Mit dem Jeepney fahren',
|
||||||
|
instruction = 'Wähle das passende Wort für die Reisesituation.',
|
||||||
|
question_data = '{"type":"multiple_choice","question":"Du möchtest auf Cebu mit dem typischen Sammeltaxi fahren. Welches Wort passt?","options":["hunong","sakyanan","jeepney","dalan"]}'::jsonb,
|
||||||
|
answer_data = '{"type":"multiple_choice","correctAnswer":2}'::jsonb,
|
||||||
|
explanation = 'Ein Jeepney ist ein typisches öffentliches Sammeltaxi auf den Philippinen.'
|
||||||
|
FROM community.vocab_course_lesson AS lesson
|
||||||
|
WHERE ${baseWhere} AND exercise.exercise_number = 2;
|
||||||
|
`, { transaction });
|
||||||
|
await queryInterface.sequelize.query(`
|
||||||
|
UPDATE community.vocab_grammar_exercise AS exercise
|
||||||
|
SET title = 'Wege & Verkehr: Weg zum Hafen ergänzen',
|
||||||
|
instruction = 'Jemand erklärt dir den Weg zum Hafen. Welche Richtungsangabe fehlt?',
|
||||||
|
question_data = '{"type":"gap_fill","text":"{gap}. Tuo. Wala. Duol ra.","gaps":1}'::jsonb,
|
||||||
|
answer_data = '{"type":"gap_fill","answers":["Diretso"]}'::jsonb,
|
||||||
|
explanation = 'Diretso = geradeaus, tuo = rechts, wala = links und duol ra = es ist nur nah.'
|
||||||
|
FROM community.vocab_course_lesson AS lesson
|
||||||
|
WHERE ${baseWhere} AND exercise.exercise_number = 3;
|
||||||
|
`, { transaction });
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async down() {
|
||||||
|
// The former questions were tautological or context-free.
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user