Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| TestTimeoutEvent | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| isBeforeTimeout | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2015 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\taoQtiTest\models\event; |
| 23 | |
| 24 | use qtism\runtime\tests\AssessmentTestSession; |
| 25 | |
| 26 | /** |
| 27 | * Event represents timeout during test session |
| 28 | * Triggered before all types of timeouts (item, section, test part, test) |
| 29 | * |
| 30 | * @see \oat\taoQtiTest\models\runner\QtiRunnerService::onTimeout() |
| 31 | * @author Aleh Hutnikau <hutnikau@1pt.com> |
| 32 | */ |
| 33 | class TestTimeoutEvent extends AbstractTestEvent |
| 34 | { |
| 35 | /** |
| 36 | * @var integer |
| 37 | * @see \qtism\runtime\tests\AssessmentTestSessionException |
| 38 | */ |
| 39 | protected $timeoutCode; |
| 40 | |
| 41 | /** |
| 42 | * @var boolean |
| 43 | */ |
| 44 | protected $beforeTimeout; |
| 45 | |
| 46 | /** |
| 47 | * TestTimeoutEvent constructor. |
| 48 | * @param AssessmentTestSession $session |
| 49 | * @see \qtism\runtime\tests\AssessmentTestSessionException |
| 50 | * @param $timeoutCode |
| 51 | * @param boolean $beforeTimeout whether event triggered before of after timeout |
| 52 | */ |
| 53 | public function __construct(AssessmentTestSession $session, $timeoutCode, $beforeTimeout = true) |
| 54 | { |
| 55 | parent::__construct($session); |
| 56 | $this->timeoutCode = $timeoutCode; |
| 57 | $this->beforeTimeout = $beforeTimeout; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * @return bool |
| 62 | */ |
| 63 | public function isBeforeTimeout() |
| 64 | { |
| 65 | return $this->beforeTimeout === true; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @return string |
| 70 | */ |
| 71 | public function getName() |
| 72 | { |
| 73 | return __CLASS__; |
| 74 | } |
| 75 | } |