Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
8 / 8 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| ParsedChoice | |
100.00% |
8 / 8 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| isCorrect | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getChoiceScore | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getChoice | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 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) 2021 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | */ |
| 20 | |
| 21 | declare(strict_types=1); |
| 22 | |
| 23 | namespace oat\taoQtiItem\model\import; |
| 24 | |
| 25 | class ParsedChoice |
| 26 | { |
| 27 | /** @var string */ |
| 28 | private $choice; |
| 29 | |
| 30 | /** @var float|null */ |
| 31 | private $choiceScore; |
| 32 | |
| 33 | /** @var string */ |
| 34 | private $id; |
| 35 | |
| 36 | /** @var bool */ |
| 37 | private $isCorrect; |
| 38 | |
| 39 | public function __construct(string $id, string $choice, float $choiceScore, bool $isCorrect) |
| 40 | { |
| 41 | $this->choice = $choice; |
| 42 | $this->choiceScore = $choiceScore; |
| 43 | $this->id = $id; |
| 44 | $this->isCorrect = $isCorrect; |
| 45 | } |
| 46 | |
| 47 | public function isCorrect(): bool |
| 48 | { |
| 49 | return $this->isCorrect; |
| 50 | } |
| 51 | |
| 52 | public function getChoiceScore(): ?float |
| 53 | { |
| 54 | return $this->choiceScore; |
| 55 | } |
| 56 | |
| 57 | public function getChoice(): string |
| 58 | { |
| 59 | return $this->choice; |
| 60 | } |
| 61 | |
| 62 | public function getId(): string |
| 63 | { |
| 64 | return $this->id; |
| 65 | } |
| 66 | } |