get(taoQtiTest_models_classes_QtiTestService::class); $testClass = $testService->getRootClass(); $samplesDirectory = new DirectoryIterator(__DIR__); try { foreach ($samplesDirectory as $file) { if ($file->isReadable() && $file->isFile() && 'zip' === $file->getExtension()) { $report = $testService->importMultipleTests($testClass, $file->getRealPath()); } } } catch (Throwable $e) { common_Logger::e( 'An error occurred while importing QTI Test Example. The system reported the following error: ' . $e->getMessage( ) ); throw $e; }