getClassService()->deleteTest(new core_kernel_classes_Resource($uri)); } /** * @author Rashid Mumtaz & Absar - PCG Team - {absar.gilani6@gmail.com & rashid.mumtaz372@gmail.com} * @param string $uploadedFile * @param \core_kernel_classes_Class $class * @param bool $enableMetadataGuardians * @param bool $enableMetadataValidators * @param bool $itemMustExist * @param bool $itemMustBeOverwritten * @return common_report_Report */ public function importQtiTest($uploadedFile, $class = null, $enableMetadataGuardians = true, $enableMetadataValidators = true, $itemMustExist = false, $itemMustBeOverwritten = false) { try { //The zip extraction is a long process that can exceed the 30s timeout helpers_TimeOutHelper::setTimeOutLimit(helpers_TimeOutHelper::LONG); $class = is_null($class) ? new core_kernel_classes_Class(TaoOntology::TEST_CLASS_URI) : $class; $importer = taoQtiTest_models_classes_QtiTestService::singleton(); if ($enableMetadataGuardians === false) { $importer->disableMetadataGuardians(); } if ($enableMetadataValidators === false) { $importer->disableMetadataValidators(); } if ($itemMustExist === true) { $importer->enableItemMustExist(); } if ($itemMustBeOverwritten === true) { $importer->enableItemMustBeOverwritten(); } $report = $importer->importMultipleTests($class, $uploadedFile); helpers_TimeOutHelper::reset(); return $report; } catch (common_exception_UserReadableException $e) { return new common_report_Report(common_report_Report::TYPE_ERROR, __($e->getUserMessage())); } } }