diff --git a/rwth_nb/misc/feedback.py b/rwth_nb/misc/feedback.py index d1c1c4beae699528b16e1c955bc83471d1c4f2d1..baf69cc770bb44dab0a5b9e4eed0779b0a28f25c 100644 --- a/rwth_nb/misc/feedback.py +++ b/rwth_nb/misc/feedback.py @@ -84,10 +84,10 @@ class RWTHFeedbackBase: # Default arguments for toggle_button and textarea self.toggle_args = {"options": self.feedback_scale_options, - "index": 2, "description": "", "disabled": False, - "style": {'button_color': rwth_colors['rwth:green-50']}, "tooltips": []} + "index": 2, "description": "", "disabled": False, + "style": {'button_color': rwth_colors['rwth:green-50']}, "tooltips": []} self.textarea_args = {"value": "", "placeholder": self.feedback_text['your-feedback'], - "description": "", "disabled": False} + "description": "", "disabled": False} # self.widgets_container: # dict containing to each id key as defined in q a widget @@ -278,6 +278,7 @@ class RWTHFeedbackJupyter(RWTHFeedbackBase): realm: str, optional jupyter submission realm in which the feedback should be stored, is set automatically if None """ + def __init__(self, feedback_name, questions, lang='en', realm=None): self.realm = realm @@ -290,7 +291,8 @@ class RWTHFeedbackJupyter(RWTHFeedbackBase): self.submission_type = 'jupyter' def load_entries(self): - self.entries = [submission['data'] for submission in self.sub.get() if type(submission['data']) is dict] + self.entries = [submission['data'] for submission in self.sub.get() + if type(submission['data']) is dict and submission['data'].get('name') is not None] def submit(self): # submit to jupyter submission service @@ -321,6 +323,7 @@ class RWTHFeedbackMail(RWTHFeedbackBase): mail_smtp_host: str, optional smtp host """ + def __init__(self, feedback_name, questions, lang='en', feedback_path='feedback.json', mail_to=None, mail_from='feedback@jupyter.rwth-aachen.de', mail_subject=None, mail_smtp_host='smarthost.rwth-aachen.de'): @@ -510,7 +513,6 @@ class RWTHFeedbackCollector: assert len(self.json_files) > 0, 'No json file found.' for file in self.json_files: - with open(os.path.join(folder_path, file), mode='r', encoding='utf-8') as f: entries = json.load(f)