Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| ResultsViewerService | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
| setDefaultItemType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getDefaultItemType | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| getDeliveryItemType | |
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) 2018 (original work) Open Assessment Technologies SA ; |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | /** |
| 23 | * @author Jean-Sébastien Conan <jean-sebastien@taotesting.com> |
| 24 | * @deprecated Use oat\taoQtiTest\models\DeliveryItemTypeService instead |
| 25 | */ |
| 26 | |
| 27 | namespace oat\taoOutcomeUi\model; |
| 28 | |
| 29 | use oat\oatbox\service\ConfigurableService; |
| 30 | |
| 31 | class ResultsViewerService extends ConfigurableService |
| 32 | { |
| 33 | public const SERVICE_ID = 'taoOutcomeUi/resultsViewer'; |
| 34 | |
| 35 | public const OPTION_DEFAULT_ITEM_TYPE = 'defaultItemType'; |
| 36 | |
| 37 | /** |
| 38 | * Sets the default item type the viewer should manage |
| 39 | * @param string $type |
| 40 | */ |
| 41 | public function setDefaultItemType($type) |
| 42 | { |
| 43 | $this->setOption(self::OPTION_DEFAULT_ITEM_TYPE, $type); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Gets the default item type the viewer should manage |
| 48 | * @return string |
| 49 | */ |
| 50 | public function getDefaultItemType() |
| 51 | { |
| 52 | if ($this->hasOption(self::OPTION_DEFAULT_ITEM_TYPE)) { |
| 53 | return $this->getOption(self::OPTION_DEFAULT_ITEM_TYPE); |
| 54 | } |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Gets the type of item the viewer should manage |
| 60 | * @todo determine the item type from the $resultIdentifier |
| 61 | * @param string $resultIdentifier |
| 62 | * @return string |
| 63 | */ |
| 64 | public function getDeliveryItemType($resultIdentifier) |
| 65 | { |
| 66 | return $this->getDefaultItemType(); |
| 67 | } |
| 68 | } |