diff --git a/backend/src/controllers/questionController.js b/backend/src/controllers/questionController.js index 02575cb..54b8521 100644 --- a/backend/src/controllers/questionController.js +++ b/backend/src/controllers/questionController.js @@ -44,7 +44,7 @@ function list(req, res) { const sql = ` SELECT q.id, q.text, q.type, q.correct_text, q.difficulty, q.explanation, q.image, - q.year, q.source_type, + q.year, q.source_type, q.allow_html, t.name AS topic, t.id AS topic_id, s.name AS subject_name, s.slug AS subject_slug, (SELECT json_group_array(json_object( diff --git a/frontend/js/admin/sections/questions.js b/frontend/js/admin/sections/questions.js index 57bbe26..4e2e44e 100644 --- a/frontend/js/admin/sections/questions.js +++ b/frontend/js/admin/sections/questions.js @@ -71,15 +71,15 @@ const diffCls = `diff-${q.difficulty}`; const optsHtml = (q.options || []).map(o => `
- ${o.is_correct ? '' : ''}${esc(o.text)} + ${o.is_correct ? '' : ''}${q.allow_html ? o.text : esc(o.text)}
`).join(''); const explHtml = q.explanation - ? `
Пояснение: ${esc(q.explanation)}
` : ''; + ? `
Пояснение: ${q.allow_html ? q.explanation : esc(q.explanation)}
` : ''; return `
#${q.id}
-
${esc(q.text)}
+
${q.allow_html ? q.text : esc(q.text)}
${q.subject_name ? `${esc(q.subject_name)}` : ''} ${q.topic ? `${esc(q.topic)}` : ''}