Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| InfoControlRegistry | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| getConfigId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| register | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getInfoControlByName | |
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) 2014 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\taoQtiItem\model; |
| 23 | |
| 24 | use common_exception_Error; |
| 25 | use common_ext_ExtensionsManager; |
| 26 | |
| 27 | /** |
| 28 | * Registry for info controls |
| 29 | * |
| 30 | * @author Sam <sam@taotesting.com> |
| 31 | */ |
| 32 | class InfoControlRegistry extends CustomInteractionRegistry |
| 33 | { |
| 34 | /** |
| 35 | * Key used to store the custom interactions in the config |
| 36 | * |
| 37 | * @var string |
| 38 | */ |
| 39 | public const CONFIG_ID = 'info_control'; |
| 40 | |
| 41 | protected function getConfigId() |
| 42 | { |
| 43 | return self::CONFIG_ID; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Register a new custom interaction |
| 48 | * |
| 49 | * @param string $qtiClass |
| 50 | * @param string $phpClass |
| 51 | * @throws common_exception_Error |
| 52 | * @deprecated use set |
| 53 | */ |
| 54 | public static function register($qtiClass, $phpClass) |
| 55 | { |
| 56 | InfoControlRegistry::getRegistry()->set($qtiClass, $phpClass); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Get the php class that represents an info control from its class attribute |
| 61 | * |
| 62 | * @param string $name |
| 63 | * @deprecated set |
| 64 | * @return string |
| 65 | */ |
| 66 | public static function getInfoControlByName($name) |
| 67 | { |
| 68 | InfoControlRegistry::getRegistry()->get($name); |
| 69 | } |
| 70 | } |