Format exam sheet labels

This commit is contained in:
Wojtek
2026-10-15 09:16:08 +02:00
parent 1f5c773477
commit e7c40292b7
6 changed files with 39 additions and 10 deletions
@@ -45,14 +45,16 @@ class QuestionsModel extends ListModel
return $db->setQuery(
$db->getQuery(true)
->select([
$db->quoteName('test_symbol', 'value'),
$db->quoteName('test_symbol', 'text'),
'q.' . $db->quoteName('test_symbol'),
'q.' . $db->quoteName('exam_year'),
'c.' . $db->quoteName('title', 'category_title'),
])
->from($db->quoteName('#__testquestions_questions'))
->where($db->quoteName('published') . ' = 1')
->where($db->quoteName('test_symbol') . ' <> ' . $db->quote(''))
->group($db->quoteName('test_symbol'))
->order($db->quoteName('test_symbol') . ' ASC')
->from($db->quoteName('#__testquestions_questions', 'q'))
->leftJoin($db->quoteName('#__testquestions_categories', 'c') . ' ON c.id = q.category_id')
->where('q.' . $db->quoteName('published') . ' = 1')
->where('q.' . $db->quoteName('test_symbol') . ' <> ' . $db->quote(''))
->group(['q.' . $db->quoteName('test_symbol'), 'q.' . $db->quoteName('exam_year'), 'c.' . $db->quoteName('title')])
->order('q.' . $db->quoteName('exam_year') . ' DESC, q.' . $db->quoteName('test_symbol') . ' ASC')
)->loadObjectList();
}
}