diff options
| author | Rasmus Fuhse <fuhse@data-quest.de> | 2022-12-16 13:13:32 +0000 |
|---|---|---|
| committer | Rasmus Fuhse <fuhse@data-quest.de> | 2022-12-16 13:13:32 +0000 |
| commit | 653fcaba5a06b8098f9bdb98c051c35a567a4513 (patch) | |
| tree | 4c0cb47566019bbab09401b7287ef188322239b5 /lib/models/QuestionnaireInfo.php | |
| parent | f127f0fb49c0f687f80588e0e1008e95be37d6ce (diff) | |
Resolve "Evaluationen mit Fragebögen"
Closes #703
Merge request studip/studip!363
Diffstat (limited to 'lib/models/QuestionnaireInfo.php')
| -rw-r--r-- | lib/models/QuestionnaireInfo.php | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/lib/models/QuestionnaireInfo.php b/lib/models/QuestionnaireInfo.php new file mode 100644 index 0000000..7596586 --- /dev/null +++ b/lib/models/QuestionnaireInfo.php @@ -0,0 +1,68 @@ +<?php +require_once 'lib/classes/QuestionType.interface.php'; + +class QuestionnaireInfo extends QuestionnaireQuestion implements QuestionType +{ + public static function getIcon(bool $active = false) : Icon + { + return Icon::create(static::getIconShape(), $active ? 'clickable' : 'info'); + } + + /** + * Returns the shape of the icon of this QuestionType + * @return string + */ + public static function getIconShape() + { + return 'info-circle'; + } + + public static function getName() + { + return _('Information'); + } + + static public function getEditingComponent() + { + return ['questionnaire-info-edit', '']; + } + + public function beforeStoringQuestiondata($questiondata) + { + $questiondata['description'] = \Studip\Markup::markAsHtml( + \Studip\Markup::purifyHtml($questiondata['description']) + ); + return $questiondata; + } + + public function getDisplayTemplate() + { + $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $template = $factory->open('questionnaire/question_types/info/info'); + $template->set_attribute('vote', $this); + return $template; + } + + public function createAnswer() + { + + } + + public function getUserIdsOfFilteredAnswer($answer_option) + { + return []; + } + + public function getResultTemplate($only_user_ids = null) + { + $factory = new Flexi_TemplateFactory(realpath(__DIR__.'/../../app/views')); + $template = $factory->open('questionnaire/question_types/info/info'); + $template->set_attribute('vote', $this); + return $template; + } + + public function getResultArray() + { + return []; + } +} |
