aboutsummaryrefslogtreecommitdiff
path: root/lib/plugins/core/QuestionnaireAssignmentPlugin.php
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
committerPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
commit4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch)
tree5c07151ae61276d334e88f6309c30d439a85c12e /lib/plugins/core/QuestionnaireAssignmentPlugin.php
parentda0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff)
parent97a188592c679890a25c37ab78463add76a52ff7 (diff)
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/plugins/core/QuestionnaireAssignmentPlugin.php')
-rw-r--r--lib/plugins/core/QuestionnaireAssignmentPlugin.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/lib/plugins/core/QuestionnaireAssignmentPlugin.php b/lib/plugins/core/QuestionnaireAssignmentPlugin.php
new file mode 100644
index 0000000..cadaf52
--- /dev/null
+++ b/lib/plugins/core/QuestionnaireAssignmentPlugin.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * Interface QuestionnaireAssignmentPlugin
+ * Implement this interface if you want to relate Stud.IP-questionnaires to your plugin-contents.
+ * By storing an assignment you should set the range_type to something unique that is
+ * related to your plugin like "mytaskplugin". In all methods you should first check if the
+ * assignment is related to your plugin, because other QuestionnaireAssignmentPlugins might
+ * be installed as well.
+ */
+interface QuestionnaireAssignmentPlugin
+{
+ /**
+ * Returns if the questionnaire is viewable dependend on the assignment. Check for the range_type
+ * and range_id to see if the the assignment has to do with your plugin (and not with
+ * somebody else's plugin) and if type and id fit.
+ * @param QuestionnaireAssignment $questionnaire
+ * @return boolean
+ */
+ public function isQuestionnaireViewable(QuestionnaireAssignment $questionnaire);
+
+ /**
+ * Returns if the questionnaire is editable dependend on the assignment. Check for the range_type
+ * and range_id to see if the the assignment has to do with your plugin (and not with
+ * somebody else's plugin) and if type and id fit.
+ * @param QuestionnaireAssignment $questionnaire
+ * @return boolean
+ */
+ public function isQuestionnaireEditable(QuestionnaireAssignment $questionnaire);
+
+ /**
+ * The display name of the assignment.
+ * @param QuestionnaireAssignment $questionnaire
+ * @return string
+ */
+ public function getQuestionnaireAssignmentName(QuestionnaireAssignment $questionnaire);
+
+ /**
+ * This template will get displayed when someone at tools -> questionnaires
+ * wants to edit the contexts of the questionnaire. Maybe you don't want to provide a
+ * template here, so return null or just a readonly html-snippet.
+ *
+ * @param Questionnaire $questionnaire
+ *
+ * @return null|Flexi\Template
+ */
+ public function getQuestionnaireAssignmentEditTemplate(Questionnaire $questionnaire);
+
+ /**
+ * When the context of the questionnaire is stored at tools -> questionnaires (where
+ * the template from getQuestionnaireAssignmentEditTemplate was displayed) you should
+ * use this method to store your assignments as well.
+ * @param Questionnaire $questionnaire
+ * @return null
+ */
+ public function storeQuestionnaireAssignments(Questionnaire $questionnaire);
+}