Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions classes/class.ilObjInteractiveVideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ class ilObjInteractiveVideo extends ilObjectPlugin implements ilLPStatusPluginIn
* @var boolean
*/
protected $fixed_modal = 0;

/**
* @var string
*/
protected $csv_export_delimiter = ";";

/**
* @var int
*/
Expand Down Expand Up @@ -119,6 +125,7 @@ protected function doRead(): void
[$this->getId()]
);
$row = $this->db->fetchAssoc($res);

if($row !== null) {
$this->setIsAnonymized($row['is_anonymized'] ?: 0);
$this->setIsRepeat($row['is_repeat'] ?: 0);
Expand All @@ -132,6 +139,7 @@ protected function doRead(): void
$this->setEnableToolbar($row['show_toolbar'] ?: 0);
$this->setAutoResumeAfterQuestion($row['auto_resume'] ?: 0);
$this->setFixedModal($row['fixed_modal'] ?: 0);
$this->setCSVExportDelimiter($row['csv_export_delimiter'] ?: 0);
$this->setShowTocFirst($row['show_toc_first'] ?: 0);
$this->setEnableCommentStream($row['disable_comment_stream'] ?: 0);
$this->setNoCommentStream($row['no_comment_stream'] ?: 0);
Expand Down Expand Up @@ -340,6 +348,7 @@ protected function doCreate(bool $clone_mode = false): void
'is_task' => ['integer', $is_task],
'auto_resume' => ['integer', $auto_resume],
'fixed_modal' => ['integer', $fixed_modal],
'csv_export_delimiter' => ['text', ";"],
'task' => ['text', $task],
'enable_comment' => ['integer', 1],
'show_toolbar' => ['integer', $show_toolbar],
Expand Down Expand Up @@ -400,6 +409,7 @@ protected function updateObject() {
'task' => ['text', $this->getTask()],
'auto_resume' => ['integer', $this->isAutoResumeAfterQuestion()],
'fixed_modal' => ['integer', $this->isFixedModal()],
'csv_export_delimiter' => ['text', $this->getCSVExportDelimiter()],
'show_toc_first' => ['integer', $this->getShowTocFirst()],
'disable_comment_stream' => ['integer', $this->getEnableCommentStream()],
'lp_mode' => ['integer', $this->getLearningProgressMode()],
Expand Down Expand Up @@ -495,6 +505,7 @@ protected function doCloneObject(ilObject2 $new_obj, int $a_target_id, ?int $a_c
'task' => ['text', $this->getTask()],
'auto_resume' => ['integer', $this->isAutoResumeAfterQuestion()],
'fixed_modal' => ['integer', $this->isFixedModal()],
'csv_export_delimiter' => ['text', $this->getCSVExportDelimiter()],
'show_toc_first' => ['integer', $this->getShowTocFirst()],
'disable_comment_stream' => ['integer', $this->getEnableCommentStream()],
'lp_mode' => ['integer', $this->getLearningProgressMode()],
Expand Down Expand Up @@ -1291,6 +1302,16 @@ public function setFixedModal(bool $fixed_modal): void
$this->fixed_modal = $fixed_modal;
}

public function getCSVExportDelimiter(): string
{
return $this->csv_export_delimiter;
}

public function setCSVExportDelimiter(string $csv_export_delimiter): void
{
$this->csv_export_delimiter = $csv_export_delimiter;
}

public function getShowTocFirst(): int
{
return $this->show_toc_first;
Expand Down
20 changes: 17 additions & 3 deletions classes/class.ilObjInteractiveVideoGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,9 @@ protected function updateCustom(ilPropertyFormGUI $form): void
$fixed_modal = $form->getInput('fixed_modal');
$this->object->setFixedModal((int)$fixed_modal);

$csv_export_delimiter = $form->getInput('csv_export_delimiter');
$this->object->setCSVExportDelimiter(ilInteractiveVideoPlugin::stripSlashesWrapping($csv_export_delimiter));

$marker_for_students = $form->getInput('marker_for_students');
$this->object->setMarkerForStudents((int)$marker_for_students);

Expand Down Expand Up @@ -1166,6 +1169,15 @@ protected function appendDefaultFormOptions(ilPropertyFormGUI $a_form): void
$fixed_modal->setInfo($plugin->txt('fixed_modal_info'));
$fixed_modal->setValue(1);
$a_form->addItem($fixed_modal);

$section = new ilFormSectionHeaderGUI();
$section->setTitle($plugin->txt('export_section'));
$a_form->addItem($section);

$csv_export_delimiter = new ilTextInputGUI($plugin->txt('csv_export_delimiter'), 'csv_export_delimiter');
$csv_export_delimiter->setInfo($plugin->txt('csv_export_delimiter_info'));
$csv_export_delimiter->setValue(";");
$a_form->addItem($csv_export_delimiter);
}

/**
Expand Down Expand Up @@ -1208,6 +1220,7 @@ protected function getEditFormCustomValues(array &$a_values): void
$a_values['task'] = $this->object->getTask();
$a_values['auto_resume'] = $this->object->isAutoResumeAfterQuestion();
$a_values['fixed_modal'] = $this->object->isFixedModal();
$a_values['csv_export_delimiter'] = $this->object->getCSVExportDelimiter();
$a_values["marker_for_students"]= $this->object->getMarkerForStudents();
$a_values["layout_width"] = $this->object->getLayoutWidth();
}
Expand Down Expand Up @@ -3733,7 +3746,7 @@ public function completeCsvExport(): void
$data = $simple->getScoreForAllQuestionsAndAllUser($this->obj_id);

$csv = [];
$separator = ";";
$separator = $this->object->getCSVExportDelimiter();

$head_row = [];
array_push($head_row, $lng->txt('name'));
Expand Down Expand Up @@ -3782,7 +3795,7 @@ public function exportMyComments(): void
$data = $this->object->getCommentsTableDataByUserId();

$csv = [];
$separator = ";";
$separator = $this->object->getCSVExportDelimiter();

$head_row = [];
array_push($head_row, $lng->txt('id'));
Expand All @@ -3791,6 +3804,7 @@ public function exportMyComments(): void
array_push($head_row, $plugin->txt('comment_title'));
array_push($head_row, $plugin->txt('comment'));
array_push($head_row, $plugin->txt('visibility'));
array_push($head_row, $plugin->txt('is_private'));
array_push($head_row, $plugin->txt('reply_to'));

array_push($csv, ilCSVUtil::processCSVRow($head_row, TRUE, $separator) );
Expand Down Expand Up @@ -3822,7 +3836,7 @@ public function exportAllComments(): void
$data = $this->object->getCommentsTableData(true, false, false, true);

$csv = [];
$separator = ";";
$separator = $this->object->getCSVExportDelimiter();

$head_row = [];

Expand Down
3 changes: 3 additions & 0 deletions lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,6 @@ back#:#Zurück
date_txt#:#Datum:
presenter_txt#:#Referent/in:
serie_txt#:#Serie:
export_section#:#Export
csv_export_delimiter#:#CSV-Exporttrennzeichen
csv_export_delimiter_info#:#Ändern Sie das Standardtrennzeichen für CSV-Exporte.
3 changes: 3 additions & 0 deletions lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,6 @@ back#:#Back
date_txt#:#Date:
presenter_txt#:#Presenter:
serie_txt#:#Series:
export_section#:#Export
csv_export_delimiter#:#CSV export delimiter
csv_export_delimiter_info#:#Change the default delimiter for CSV exports.
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$id = 'xvid';

// code version; must be changed for all code changes
$version = "3.5.4";
$version = "3.5.5";

// ilias min and max version; must always reflect the versions that should
// run with the plugin
Expand Down
23 changes: 18 additions & 5 deletions sql/dbupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
'length' => '4',
'notnull' => true
)
);
);
$ilDB->createTable('rep_robj_xvid_question', $fields);
$ilDB->addPrimaryKey('rep_robj_xvid_question', array('question_id'));
$ilDB->createSequence('rep_robj_xvid_question');
Expand Down Expand Up @@ -414,15 +414,15 @@
)
);
}

$res = $ilDB->queryF('SELECT comment_id FROM rep_robj_xvid_comments WHERE repeat_question = %s',
array('integer'), array(1));

while($row = $ilDB->fetchAssoc($res))
{
$comment_ids[] = $row['comment_id'];
}

$ilDB->manipulateF('
UPDATE rep_robj_xvid_question
SET rep_robj_xvid_question.repeat_question = %s
Expand Down Expand Up @@ -523,7 +523,7 @@
'notnull' => true,
'default' => 0));
}
}
}
?>
<#25>
<?php
Expand Down Expand Up @@ -1229,3 +1229,16 @@
'default' => 1));
}
?>
<#84>
<?php
if(!$ilDB->tableColumnExists('rep_robj_xvid_objects', 'csv_export_delimiter'))
{
$ilDB->addTableColumn('rep_robj_xvid_objects', 'csv_export_delimiter',
array(
'type' => 'text',
'length' => 1,
'notnull' => true,
'default' => ";")
);
}
?>