93 if (!is_string($format_id)) {
94 throw new ilException(
'The format must be of type string.');
97 if (!strlen($format_id)) {
101 if (strtolower($format_id) != $format_id) {
102 throw new ilException(
'Please use a lowercase format.');
105 if (in_array($format_id, self::$reserved_formats)) {
106 throw new ilException(
'The format must not be one of: ' . implode(
', ', self::$reserved_formats));
115 final public function export()
120 $ilCtrl = $DIC[
'ilCtrl'];
121 $main_tpl = $DIC[
'tpl'];
124 throw new ilException(
'Incomplete object configuration. Please pass an instance of ilObjTest before calling the export!');
130 if ($this->
txt($e->getMessage()) ==
'-' . $e->getMessage() .
'-') {
131 $main_tpl->setOnScreenMessage(
'failure', $e->getMessage(),
true);
133 $main_tpl->setOnScreenMessage(
'failure', $this->
txt($e->getMessage()),
true);
135 $ilCtrl->redirectByClass(
'iltestexportgui');
138 $main_tpl->setOnScreenMessage(
'success',
$lng->txt(
'exp_file_created'),
true);
139 $ilCtrl->redirectByClass(
'iltestexportgui');
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Writeable part of repository interface to ilComponentDataDB.
getFormatLabel()
This method should return a human readable label for your export.
__construct(\ilDBInterface $db, \ilComponentRepositoryWrite $component_repository, string $id)
getFormatIdentifier()
A unique identifier which describes your export type, e.g.
ilComponentRepositoryWrite $component_repository
txt(string $a_var)
Get Language Variable (prefix will be prepended automatically)
buildExportFile(ilTestExportFilename $export_path)
This method is called if the user wants to export a test of YOUR export type If you throw an exceptio...
__construct(Container $dic, ilPlugin $plugin)