Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
| taoQtiTest_helpers_Utils | |
0.00% |
0 / 5 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
| storeQtiResource | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| emptyImsManifest | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| buildAssessmentItemRefsTestMap | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getTestDefinition | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getService | |
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 | use qtism\data\storage\xml\XmlDocument; |
| 23 | use oat\oatbox\service\ServiceManager; |
| 24 | use oat\oatbox\filesystem\Directory; |
| 25 | use oat\oatbox\service\ConfigurableService; |
| 26 | use oat\taoQtiTest\models\QtiTestUtils; |
| 27 | |
| 28 | /** |
| 29 | * Miscellaneous utility methods for the QtiTest extension. |
| 30 | * @author Jérôme Bogaerts <jerome@taotesting.com> |
| 31 | */ |
| 32 | class taoQtiTest_helpers_Utils extends ConfigurableService |
| 33 | { |
| 34 | public const SERVICE_ID = 'taoQtiTest/taoQtiTestHelpersUtils'; |
| 35 | |
| 36 | /** |
| 37 | * @deprecated use QtiTestUtils::storeQtiResource |
| 38 | */ |
| 39 | public static function storeQtiResource(Directory $testContent, $qtiResource, $origin, $copy = true, $rename = '') |
| 40 | { |
| 41 | return static::getService()->storeQtiResource($testContent, $qtiResource, $origin, $copy, $rename); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @deprecated use QtiTestUtils::emptyImsManifest |
| 46 | */ |
| 47 | public static function emptyImsManifest($version = '2.1') |
| 48 | { |
| 49 | return static::getService()->emptyImsManifest($version); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * @deprecated use QtiTestUtils::buildAssessmentItemRefsTestMap |
| 54 | */ |
| 55 | public static function buildAssessmentItemRefsTestMap( |
| 56 | XmlDocument $test, |
| 57 | taoQtiTest_models_classes_ManifestParser $manifestParser, |
| 58 | $basePath |
| 59 | ) { |
| 60 | return static::getService()->buildAssessmentItemRefsTestMap($test, $manifestParser, $basePath); |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * @deprecated use QtiTestUtils::getTestDefinition |
| 65 | */ |
| 66 | public static function getTestDefinition($qtiTestCompilation) |
| 67 | { |
| 68 | return static::getService()->getTestDefinition($qtiTestCompilation); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * @return QtiTestUtils |
| 73 | */ |
| 74 | private static function getService() |
| 75 | { |
| 76 | return ServiceManager::getServiceManager()->get(QtiTestUtils::SERVICE_ID); |
| 77 | } |
| 78 | } |