Match set frontend to exam view
This commit is contained in:
@@ -56,4 +56,18 @@ class SetModel extends BaseDatabaseModel
|
||||
->order('sq.ordering ASC, q.id ASC')
|
||||
)->loadObjectList();
|
||||
}
|
||||
|
||||
public function getSets()
|
||||
{
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
|
||||
return $db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->select(['s.id', 's.title', 'sub.title AS subject_title'])
|
||||
->from($db->quoteName('#__testquestions_sets', 's'))
|
||||
->leftJoin($db->quoteName('#__testquestions_subjects', 'sub') . ' ON sub.id = s.subject_id')
|
||||
->where('s.published = 1')
|
||||
->order('sub.title ASC, s.title ASC')
|
||||
)->loadObjectList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,18 @@ class HtmlView extends BaseHtmlView
|
||||
{
|
||||
protected $set;
|
||||
protected $items;
|
||||
protected $sets;
|
||||
protected $results;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$this->getDocument()->getWebAssetManager()->registerAndUseStyle(
|
||||
'com_testquestions.exam',
|
||||
'media/com_testquestions/egzamin.css'
|
||||
);
|
||||
$this->set = $this->get('Set');
|
||||
$this->items = $this->get('Items');
|
||||
$this->sets = $this->get('Sets');
|
||||
$this->results = $this->buildResults($this->items);
|
||||
|
||||
return parent::display($tpl);
|
||||
|
||||
Reference in New Issue
Block a user