Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| QtiTestImporter | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| import | |
0.00% |
0 / 12 |
|
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) 2017-2024 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\taoQtiTest\models\import; |
| 23 | |
| 24 | use common_report_Report; |
| 25 | use core_kernel_classes_Class; |
| 26 | use oat\oatbox\filesystem\File; |
| 27 | use oat\taoTests\models\import\AbstractTestImporter; |
| 28 | use taoQtiTest_models_classes_CrudQtiTestsService; |
| 29 | |
| 30 | /** |
| 31 | * Class QtiTestImport |
| 32 | * @package oat\taoQtiTest\models\metadata |
| 33 | * @author Aleh Hutnikau, <hutnikau@1pt.com> |
| 34 | */ |
| 35 | class QtiTestImporter extends AbstractTestImporter |
| 36 | { |
| 37 | public const IMPORTER_ID = 'taoQtiTest'; |
| 38 | |
| 39 | /** |
| 40 | * @param File $file |
| 41 | * @param core_kernel_classes_Class|null $class |
| 42 | * @param bool $enableMetadataGuardians |
| 43 | * @param bool $enableValidators |
| 44 | * @param bool $itemMustExist |
| 45 | * @param bool $itemMustBeOverwritten |
| 46 | * @param bool $overwriteTest |
| 47 | * @param string|null $itemClassUri |
| 48 | * @param string|null $overwriteTestUri |
| 49 | * @param string|null $packageLabel |
| 50 | * @return common_report_Report |
| 51 | */ |
| 52 | public function import( |
| 53 | File $file, |
| 54 | core_kernel_classes_Class $class = null, |
| 55 | $enableMetadataGuardians = true, |
| 56 | $enableValidators = true, |
| 57 | $itemMustExist = false, |
| 58 | $itemMustBeOverwritten = false, |
| 59 | bool $overwriteTest = false, |
| 60 | ?string $itemClassUri = null, |
| 61 | ?string $overwriteTestUri = null, |
| 62 | ?string $packageLabel = null |
| 63 | ) { |
| 64 | return taoQtiTest_models_classes_CrudQtiTestsService::singleton()->importQtiTest( |
| 65 | $file, |
| 66 | $class, |
| 67 | $enableMetadataGuardians, |
| 68 | $enableValidators, |
| 69 | $itemMustExist, |
| 70 | $itemMustBeOverwritten, |
| 71 | $overwriteTest, |
| 72 | $itemClassUri, |
| 73 | $overwriteTestUri, |
| 74 | $packageLabel |
| 75 | ); |
| 76 | } |
| 77 | } |