Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96bdb73450 | ||
|
|
eac29077fc |
@@ -30,6 +30,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych.
|
|||||||
|
|
||||||
## Instalacja
|
## Instalacja
|
||||||
|
|
||||||
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.27.0).
|
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.28.1).
|
||||||
|
|
||||||
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.28.0.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.28.1.
|
||||||
@@ -13,6 +13,26 @@ use Joomla\CMS\Session\Session;
|
|||||||
class ResultController extends BaseController
|
class ResultController extends BaseController
|
||||||
{
|
{
|
||||||
public function save(): void
|
public function save(): void
|
||||||
|
{
|
||||||
|
$this->saveAssessment();
|
||||||
|
$id = Factory::getApplication()->getInput()->post->getInt('id');
|
||||||
|
|
||||||
|
$this->setRedirect(
|
||||||
|
Route::_('index.php?option=com_testquestions&view=result&id=' . $id, false),
|
||||||
|
Text::_('COM_TESTQUESTIONS_RESULT_SAVED')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save2close(): void
|
||||||
|
{
|
||||||
|
$this->saveAssessment();
|
||||||
|
$this->setRedirect(
|
||||||
|
Route::_('index.php?option=com_testquestions&view=results', false),
|
||||||
|
Text::_('COM_TESTQUESTIONS_RESULT_SAVED')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function saveAssessment(): void
|
||||||
{
|
{
|
||||||
if (!Session::checkToken()) {
|
if (!Session::checkToken()) {
|
||||||
throw new \RuntimeException(Text::_('JINVALID_TOKEN'), 403);
|
throw new \RuntimeException(Text::_('JINVALID_TOKEN'), 403);
|
||||||
@@ -27,10 +47,5 @@ class ResultController extends BaseController
|
|||||||
if (!$model->saveAssessment($id, $points, $comments)) {
|
if (!$model->saveAssessment($id, $points, $comments)) {
|
||||||
throw new \RuntimeException(Text::_('COM_TESTQUESTIONS_RESULT_NOT_FOUND'));
|
throw new \RuntimeException(Text::_('COM_TESTQUESTIONS_RESULT_NOT_FOUND'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setRedirect(
|
|
||||||
Route::_('index.php?option=com_testquestions&view=result&id=' . $id, false),
|
|
||||||
Text::_('COM_TESTQUESTIONS_RESULT_SAVED')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class HtmlView extends BaseHtmlView
|
|||||||
|
|
||||||
ToolbarHelper::title(Text::_('COM_TESTQUESTIONS_RESULT_PREVIEW'));
|
ToolbarHelper::title(Text::_('COM_TESTQUESTIONS_RESULT_PREVIEW'));
|
||||||
ToolbarHelper::save('result.save', 'JTOOLBAR_SAVE');
|
ToolbarHelper::save('result.save', 'JTOOLBAR_SAVE');
|
||||||
|
ToolbarHelper::custom('result.save2close', 'save', 'save', 'JTOOLBAR_SAVE_AND_CLOSE', false);
|
||||||
ToolbarHelper::link('index.php?option=com_testquestions&view=results', 'COM_TESTQUESTIONS_RESULTS', 'back');
|
ToolbarHelper::link('index.php?option=com_testquestions&view=results', 'COM_TESTQUESTIONS_RESULTS', 'back');
|
||||||
|
|
||||||
return parent::display($tpl);
|
return parent::display($tpl);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<creationDate>2026-10-14</creationDate>
|
<creationDate>2026-10-14</creationDate>
|
||||||
<author>Komponent</author>
|
<author>Komponent</author>
|
||||||
<license>GNU General Public License version 2 or later</license>
|
<license>GNU General Public License version 2 or later</license>
|
||||||
<version>1.27.0</version>
|
<version>1.28.1</version>
|
||||||
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
||||||
<element>com_testquestions</element>
|
<element>com_testquestions</element>
|
||||||
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
||||||
|
|||||||
Reference in New Issue
Block a user