public function index() { if ($this->hasRequestParameter('exportChooser_sent') && $this->getRequestParameter('exportChooser_sent') == 1 && $this->hasRequestParameter('id')) { $this->getEventManager()->trigger(new TestTakerExportedEvent($this->getRequestParameter('id'))); } parent::index(); }
/** * (non-PHPdoc) * @see tao_actions_Import::getAvailableImportHandlers() */ protected function getAvailableExportHandlers() { $returnValue = parent::getAvailableExportHandlers(); // disabled due to possible security exploit that allows execution of php data in qti test driver // $returnValue[] = new taoDelivery_models_classes_export_AssemblyExporter(); return $returnValue; }
/** * Function returns items to export. * Items that has no content (<b>QTI items</b> without <i>qti.xml</i> file or empty <b>Open Web Items</b>) will be filtered * @return core_kernel_classes_Resource[] An array of items. */ protected function getResourcesToExport() { $resources = parent::getResourcesToExport(); $service = taoItems_models_classes_ItemsService::singleton(); $resources = array_filter($resources, function ($val) use($service) { return $service->hasItemContent($val); }); return $resources; }
protected function getAvailableExportHandlers() { $returnValue = parent::getAvailableExportHandlers(); $resources = $this->getResourcesToExport(); $testModels = array(); foreach ($resources as $resource) { $model = taoTests_models_classes_TestsService::singleton()->getTestModel($resource); if (!is_null($model)) { $testModels[$model->getUri()] = $model; } } foreach ($testModels as $model) { $impl = taoTests_models_classes_TestsService::singleton()->getTestModelImplementation($model); if (in_array('tao_models_classes_export_ExportProvider', class_implements($impl))) { foreach ($impl->getExportHandlers() as $handler) { array_unshift($returnValue, $handler); } } } return $returnValue; }
protected function sendFileToClient($file, $test) { $this->getEventManager()->trigger(new TestExportEvent($test->getUri())); parent::sendFileToClient($file, $test); }
public function __construct() { parent::__construct(); $this->service = MediaService::singleton(); }