Skip to content

Commit

Permalink
Version 3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bihor committed Mar 13, 2023
1 parent d8561fc commit de75017
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/QuizController.php
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ public function doAll(\Fixpunkt\FpMasterquiz\Domain\Model\Quiz $quiz, array $use
);
if ($this->settings['debug']) {
$debug .= "\n sending admin-email to: " . $this->settings['email']['adminName']
. ' <' . $email . '> : ' . $this->settings['email']['adminSubject'];
. ' <' . trim($email) . '> : ' . $this->settings['email']['adminSubject'];
}
}
}
Expand Down
38 changes: 38 additions & 0 deletions Classes/Domain/Model/Quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ class Quiz extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
protected $qtype = 0;

/**
* Quiz geschlossen?
*
* @var bool
*/
protected $closed = false;

/**
* media
*
Expand Down Expand Up @@ -144,6 +151,37 @@ public function setTimeperiod($timeperiod)
$this->timeperiod = $timeperiod;
}

/**
* Returns the Closed
*
* @return bool
*/
public function getClosed()
{
return $this->closed;
}

/**
* Sets the Closed
*
* @param bool $closed
* @return void
*/
public function setClosed($closed)
{
$this->closed = $closed;
}

/**
* Returns the boolean state of Closed
*
* @return bool
*/
public function isClosed()
{
return $this->closed;
}

/**
* Returns the qtype
*
Expand Down
13 changes: 12 additions & 1 deletion Configuration/TCA/tx_fpmasterquiz_domain_model_quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'sys_language_uid, l10n_parent, l10n_diffsource, hidden, name, path_segment, about, timeperiod, media, qtype,
--div--;LLL:EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf:tabs.questions, questions,
--div--;LLL:EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf:tabs.evaluations, evaluations,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime'],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime, closed'],
],
'columns' => [
'sys_language_uid' => [
Expand Down Expand Up @@ -257,5 +257,16 @@
],
],
],
'closed' => [
'exclude' => true,
'label' => 'LLL:EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf:tx_fpmasterquiz_domain_model_quiz.closed',
'config' => [
'type' => 'check',
'items' => [
['LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.enabled']
],
'default' => 0
]
],
],
];
4 changes: 2 additions & 2 deletions Documentation/Administrator/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ There are this sections: quiz, question, answer, evaluation, tag. That are varia
And there are this user-related sections: participant and selection (answers of a participant).

A quiz has this variables:
name, about, timeperiod (in seconds), media, questions, questionsSortByTag, categories, evaluations and
maximum2 (maximum points for a quiz) and qtype (for quiz, poll or test).
name, about, timeperiod (in seconds), media, questions, questionsSortByTag, categories, evaluations,
maximum2 (maximum points for a quiz), qtype (for quiz, poll or test) and closed.

A question has this variables:
title, qmode (question-mode), image, bodytext, explanation, sorting, tag, answers, selectOptions, numberOfAnswers,
Expand Down
5 changes: 4 additions & 1 deletion Documentation/ChangeLog/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,7 @@ ChangeLog
Setting closed added: participation is than not possible.
Type added to a quiz-entry.
Bugfix sending emails and adminEmail can now contain more email-addresses and in debug mode the email-content will be prompted.
Bugfix for other languages than 0 and PHP 8 bugfix.
Bugfix for other languages than 0 and PHP 8 bugfix.

3.6.1:
Closed-checkbox added to a quiz too.
4 changes: 4 additions & 0 deletions Documentation/Configuration/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ FAQ

You need to define the mark-symbol by yourself via the TypoScript-setting. E.g. settings.template.optionalMark = *.
- Closed is a checkbox at a quiz-entry (tab Access). Why is it a setting too?

Because with this 2 possibilities you can easy define if one or more quizzes shall be closed.

- The text changes to english when I activate Ajax. Whats wrong?

You need to add some more TypoScript to your page. See chapter "Known problems".
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fp_masterquiz

version 3.6.0
version 3.6.1

TYPO3 extension to create a quiz, poll or test. The participant result will be saved in the DB too and can be deleted automatically via Scheduler.

Expand Down Expand Up @@ -37,4 +37,7 @@ Changes in version 3.6.0:
- Setting closed added: participation is than not possible.
- Type added to a quiz-entry.
- Bugfix sending emails and adminEmail can now contain more email-addresses and in debug mode the email-content will be prompted.
- Bugfix for other languages than 0 and PHP 8 bugfix.
- Bugfix for other languages than 0 and PHP 8 bugfix.

Changes in version 3.6.1:
- Closed-checkbox added to a quiz too.
6 changes: 5 additions & 1 deletion Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" target-language="de" datatype="plaintext" original="EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf" date="2023-02-21T15:39:44Z" product-name="fp_masterquiz">
<file source-language="en" target-language="de" datatype="plaintext" original="EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf" date="2023-03-13T13:15:16Z" product-name="fp_masterquiz">
<header/>
<body>
<trans-unit id="tx_fp_masterquiz_pi1.name" resname="tx_fp_masterquiz_pi1.name">
Expand Down Expand Up @@ -55,6 +55,10 @@
<source>psycho test</source>
<target>Psychotest</target>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.closed" resname="tx_fpmasterquiz_domain_model_quiz.closed">
<source>Is this quiz/poll/test closed?</source>
<target>Ist dieses Quiz/Umfrage/Test beendet/geschlossen (keine Teilnahme mehr möglich)?</target>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.path_segment" resname="tx_fpmasterquiz_domain_model_quiz.path_segment">
<source>Path segment</source>
<target>Slug</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<trans-unit id="qtype.description">
<source>Quiz, poll or psycho test?</source>
</trans-unit>
<trans-unit id="closed.description">
<source>Is this quiz/poll/test closed?</source>
</trans-unit>
</body>
</file>
</xliff>
5 changes: 4 additions & 1 deletion Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf" date="2023-02-21T15:39:44Z" product-name="fp_masterquiz">
<file source-language="en" datatype="plaintext" original="EXT:fp_masterquiz/Resources/Private/Language/locallang_db.xlf" date="2023-03-13T13:15:16Z" product-name="fp_masterquiz">
<header/>
<body>
<trans-unit id="tx_fp_masterquiz_pi1.name" resname="tx_fp_masterquiz_pi1.name">
Expand Down Expand Up @@ -42,6 +42,9 @@
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.qtype.2" resname="tx_fpmasterquiz_domain_model_quiz.qtype.2">
<source>psycho test</source>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.closed" resname="tx_fpmasterquiz_domain_model_quiz.closed">
<source>Is this quiz/poll/test closed (participating is no longer possible)?</source>
</trans-unit>
<trans-unit id="tx_fpmasterquiz_domain_model_quiz.path_segment" resname="tx_fpmasterquiz_domain_model_quiz.path_segment">
<source>Path segment</source>
</trans-unit>
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Templates/Quiz/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

<div id="quiz-ajaxCallResult"></div>

<f:if condition="!{settings.closed}">
<f:if condition="!{settings.closed} && !{quiz.closed}">
<f:if condition="{settings.user.askForData} == 1">
<f:render partial="Participant/Form" arguments="{_all}" />
</f:if>
Expand Down Expand Up @@ -245,7 +245,7 @@

</f:then>
<f:else>
<f:if condition="{settings.closed}">
<f:if condition="{settings.closed} || {quiz.closed}">
<f:then>
<br>
<div class="alert alert-danger" role="alert">
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/Quiz/ShowAjax.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

</f:then>
<f:else>
<f:if condition="{settings.closed}">
<f:if condition="{settings.closed} || {quiz.closed}">
<f:then>
<br>
<div class="alert alert-danger" role="alert">
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/Quiz/ShowByTag.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

</f:then>
<f:else>
<f:if condition="{settings.closed}">
<f:if condition="{settings.closed} || {quiz.closed}">
<f:then>
<br>
<div class="alert alert-danger" role="alert">
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'state' => 'stable',
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '3.6.0',
'version' => '3.6.1',
'constraints' => [
'depends' => [
'typo3' => '10.4.6-11.5.99',
Expand Down
1 change: 1 addition & 0 deletions ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CREATE TABLE tx_fpmasterquiz_domain_model_quiz (
media int(11) unsigned NOT NULL default '0',
questions int(11) unsigned DEFAULT '0' NOT NULL,
evaluations int(11) unsigned DEFAULT '0' NOT NULL,
closed smallint(5) unsigned DEFAULT '0' NOT NULL,
path_segment varchar(2048),
categories int(11) unsigned DEFAULT '0' NOT NULL,

Expand Down

0 comments on commit de75017

Please sign in to comment.