fix(tests): скрыть экзаменационные варианты (exam9) из админ-вкладки «Тесты»
This commit is contained in:
@@ -8,6 +8,9 @@ function list(req, res) {
|
|||||||
let where = '1=1';
|
let where = '1=1';
|
||||||
if (subject) { where += ' AND t.subject_slug = ?'; args.push(subject); }
|
if (subject) { where += ' AND t.subject_slug = ?'; args.push(subject); }
|
||||||
if (role !== 'admin') { where += ' AND t.created_by = ?'; args.push(uid); }
|
if (role !== 'admin') { where += ' AND t.created_by = ?'; args.push(uid); }
|
||||||
|
// Экзаменационные варианты — это служебные строки в tests (см. import-exam9.js),
|
||||||
|
// не показываем их во вкладке «Тесты (шаблоны)» админки.
|
||||||
|
where += ' AND t.id NOT IN (SELECT test_id FROM exam9_variant_tests)';
|
||||||
|
|
||||||
const rows = db.prepare(`
|
const rows = db.prepare(`
|
||||||
SELECT t.id, t.title, t.subject_slug, t.description, t.created_at,
|
SELECT t.id, t.title, t.subject_slug, t.description, t.created_at,
|
||||||
|
|||||||
Reference in New Issue
Block a user