aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/QuestionType.interface.php
diff options
context:
space:
mode:
authorRasmus Fuhse <fuhse@data-quest.de>2022-12-16 13:13:32 +0000
committerRasmus Fuhse <fuhse@data-quest.de>2022-12-16 13:13:32 +0000
commit653fcaba5a06b8098f9bdb98c051c35a567a4513 (patch)
tree4c0cb47566019bbab09401b7287ef188322239b5 /lib/classes/QuestionType.interface.php
parentf127f0fb49c0f687f80588e0e1008e95be37d6ce (diff)
Resolve "Evaluationen mit Fragebögen"
Closes #703 Merge request studip/studip!363
Diffstat (limited to 'lib/classes/QuestionType.interface.php')
-rw-r--r--lib/classes/QuestionType.interface.php39
1 files changed, 28 insertions, 11 deletions
diff --git a/lib/classes/QuestionType.interface.php b/lib/classes/QuestionType.interface.php
index 342a0bb..ada6005 100644
--- a/lib/classes/QuestionType.interface.php
+++ b/lib/classes/QuestionType.interface.php
@@ -14,7 +14,14 @@ interface QuestionType {
* object but called staticly.
* @return Icon the specific icon for this type of question
*/
- static public function getIcon($active = false, $add = false);
+ static public function getIcon(bool $active = false) : Icon;
+
+
+ /**
+ * Returns the shape of the icon that is used in vue.
+ * @return string
+ */
+ static public function getIconShape();
/**
* Returns the name of the type of question like "Frage" or "Test" or "Dateiablage"
@@ -26,19 +33,20 @@ interface QuestionType {
static public function getName();
/**
- * Returns a template that is used to edit or create the question. Note that
- * $this['data'] might already be filled with data, when the user is editing an
- * existing question.
- * @return Flexi_Template
+ * Returns an array with two parts: First one is the name of the component for editing the question. Second
+ * one is the import path of the component. Plugins can use this to get their component imported.
+ * @return Array
*/
- public function getEditingTemplate();
+ static public function getEditingComponent();
/**
- * Called right before the questionnaire and the question is stored or when the user
- * needs to refresh the editing-window, This method is called to store the
- * request-values into $this['data']. You get them from the Request-class as usual.
+ * Usually the $questiondata is already in the correct format. But for some question types
+ * some data have to be manipulated by for example the HTML-purifier. So this takes
+ * the questiondata and changed them before they get stored.
+ * @param $questiondata
+ * @return mixed
*/
- public function createDataFromRequest();
+ public function beforeStoringQuestiondata($questiondata);
/**
* Display the question to the user. This template will be embedded into a
@@ -64,6 +72,15 @@ interface QuestionType {
public function createAnswer();
/**
+ * In the evaluation of the questionnaire you can click on a certain answer and get the evaluation filtered
+ * by the the people that have given that answer. This method asks from the question, what user_ids have
+ * given the answer_option. Answer option could be anything that this question understands as an answer.
+ * @param $answer_option
+ * @return mixed
+ */
+ public function getUserIdsOfFilteredAnswer($answer_option);
+
+ /**
* Returns a template with the results of this question.
* @param $only_user_ids : array\null array of user_ids that the results should be restricted to.
* this is used to show only a subset of results to the user for
@@ -95,4 +112,4 @@ interface QuestionType {
* @return void
*/
public function onEnding();
-} \ No newline at end of file
+}