From 5a09602a06ac78d47366699953c537c612bb14a5 Mon Sep 17 00:00:00 2001 From: Someone Date: Wed, 2 Feb 2022 20:10:02 +0100 Subject: [PATCH] modules/DialogManagedCourseFeedback.py --- modules/DialogManagedCourseFeedback.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/DialogManagedCourseFeedback.py b/modules/DialogManagedCourseFeedback.py index 4252ac4..69c1008 100644 --- a/modules/DialogManagedCourseFeedback.py +++ b/modules/DialogManagedCourseFeedback.py @@ -45,23 +45,27 @@ class DialogManagedCourseFeedback(AbstractCommand): c = self.bot.api.get_channel(data["channel_id"]) - #if c["type"] != 'O' or c["name"] in ["town-square", "off-topic"] or c["display_name"][0] == "=": - # request.respond_cmd_err("``/"+self.TRIGGER+"`` must be run in a course-channel.") - # return + if c["type"] != 'O' or c["name"] in ["town-square", "off-topic"] or c["display_name"][0] == "=": + request.respond_cmd_err("``/"+self.TRIGGER+"`` must be run in a course-channel.") + return self._open_dialog(request, data) request.respond_cmd_temp("## :white_check_mark: Success! :)\n#### Opened dialog.") def on_POST_interactive(self, request, data): +# import pprint +# print("on_POST_interactive") +# pprint.pprint(data) + self._open_dialog(request, data) request.respond() def on_POST_dialog(self, request, data): - import pprint - print("on_POST_dialog") - pprint.pprint(data) +# import pprint +# print("on_POST_dialog") +# pprint.pprint(data) if data["submission"]["feedback_hours"] and int(data["submission"]["feedback_hours"]) < 0: request.respond(200, {"errors": {"feedback_hours": "Hours must be positive."}}) @@ -85,10 +89,6 @@ class DialogManagedCourseFeedback(AbstractCommand): def _open_dialog(self, request, data): - #import pprint - #print("on_POST_interactive") - #pprint.pprint(data) - callback_id = "res-"+data["team_id"]+"-"+data["channel_id"]+"-"+data["user_id"] feedback_distance = self._response_load(self.datadir+callback_id, "-feedback_distance.txt") @@ -140,7 +140,7 @@ class DialogManagedCourseFeedback(AbstractCommand): "optional": True, "default": feedback_modus_like },{ - "display_name": "Your Comment/Feedback about the course (Max. 3000 characters)", + "display_name": "Other comment/feedback about the course (Max. 3000 characters)", "placeholder": "Type here. Max. 3000 characters.\n+ What should be changed?\n+ What was unfair?\n+ What was really good?", "name": "feedback_course", "type": "textarea", -- 2.43.0