Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
987373b565 | ||
|
|
96bdb73450 | ||
|
|
eac29077fc | ||
|
|
8446e4a84a | ||
|
|
1d0b6d7798 |
@@ -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.25.0).
|
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.28.2).
|
||||||
|
|
||||||
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ COM_TESTQUESTIONS_RESULT_EXECUTION_TIME="Czas wykonania"
|
|||||||
COM_TESTQUESTIONS_RESULT_AWARDED_POINTS="Uznane punkty (maksymalnie %s)"
|
COM_TESTQUESTIONS_RESULT_AWARDED_POINTS="Uznane punkty (maksymalnie %s)"
|
||||||
COM_TESTQUESTIONS_RESULT_COMMENT="Komentarz"
|
COM_TESTQUESTIONS_RESULT_COMMENT="Komentarz"
|
||||||
COM_TESTQUESTIONS_RESULT_SAVED="Dane wyniku zostały zapisane."
|
COM_TESTQUESTIONS_RESULT_SAVED="Dane wyniku zostały zapisane."
|
||||||
|
COM_TESTQUESTIONS_RESULT_SAVE="Zapisz"
|
||||||
|
COM_TESTQUESTIONS_RESULT_SAVE_AND_CLOSE="Zapisz i zamknij"
|
||||||
COM_TESTQUESTIONS_RESULTS_SEARCH="Szukaj po użytkowniku lub zestawie..."
|
COM_TESTQUESTIONS_RESULTS_SEARCH="Szukaj po użytkowniku lub zestawie..."
|
||||||
COM_TESTQUESTIONS_YOUR_ANSWER="Twoja odpowiedź"
|
COM_TESTQUESTIONS_YOUR_ANSWER="Twoja odpowiedź"
|
||||||
COM_TESTQUESTIONS_SELECTED_ANSWER="Zaznaczona odpowiedź"
|
COM_TESTQUESTIONS_SELECTED_ANSWER="Zaznaczona odpowiedź"
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.26.0.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.27.0.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.28.0.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.28.1.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.28.2.
|
||||||
@@ -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')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ class HtmlView extends BaseHtmlView
|
|||||||
}
|
}
|
||||||
|
|
||||||
ToolbarHelper::title(Text::_('COM_TESTQUESTIONS_RESULT_PREVIEW'));
|
ToolbarHelper::title(Text::_('COM_TESTQUESTIONS_RESULT_PREVIEW'));
|
||||||
|
ToolbarHelper::save('result.save', 'COM_TESTQUESTIONS_RESULT_SAVE');
|
||||||
|
ToolbarHelper::custom('result.save2close', 'save', 'save', 'COM_TESTQUESTIONS_RESULT_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);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<dt class="col-sm-3"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_EXECUTION_TIME'); ?></dt>
|
<dt class="col-sm-3"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_EXECUTION_TIME'); ?></dt>
|
||||||
<dd class="col-sm-9"><?php echo floor((int) $this->item->execution_time / 60); ?>:<?php echo str_pad((string) ((int) $this->item->execution_time % 60), 2, '0', STR_PAD_LEFT); ?></dd>
|
<dd class="col-sm-9"><?php echo floor((int) $this->item->execution_time / 60); ?>:<?php echo str_pad((string) ((int) $this->item->execution_time % 60), 2, '0', STR_PAD_LEFT); ?></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<form action="<?php echo Route::_('index.php?option=com_testquestions&view=result&id=' . (int) $this->item->id); ?>" method="post" name="resultForm" id="result-form">
|
<form action="<?php echo Route::_('index.php?option=com_testquestions&view=result&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<h2><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_ANSWERS'); ?></h2>
|
<h2><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_ANSWERS'); ?></h2>
|
||||||
<?php foreach ($this->item->answers as $questionId => $answer) : ?>
|
<?php foreach ($this->item->answers as $questionId => $answer) : ?>
|
||||||
<?php $question = $this->item->questions[(int) $questionId] ?? null; if (!$question) continue; ?>
|
<?php $question = $this->item->questions[(int) $questionId] ?? null; if (!$question) continue; ?>
|
||||||
@@ -43,7 +43,6 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</article>
|
</article>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<button type="submit" class="btn btn-primary"><?php echo \Joomla\CMS\Language\Text::_('JSAVE'); ?></button>
|
|
||||||
<input type="hidden" name="task" value="result.save">
|
<input type="hidden" name="task" value="result.save">
|
||||||
<input type="hidden" name="id" value="<?php echo (int) $this->item->id; ?>">
|
<input type="hidden" name="id" value="<?php echo (int) $this->item->id; ?>">
|
||||||
<?php echo HTMLHelper::_('form.token'); ?>
|
<?php echo HTMLHelper::_('form.token'); ?>
|
||||||
|
|||||||
@@ -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.25.0</version>
|
<version>1.28.2</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