-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add surveyreport questions #940
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to refactor this as a new filter that other plugins can also build on top of
tutor/templates/config/base.yml
Outdated
@@ -8,6 +8,8 @@ OPENEDX_SECRET_KEY: "{{ 24|random_string }}" | |||
PLUGINS: | |||
# The MFE plugin is required | |||
- mfe | |||
# SurveyReport plugin is required | |||
- surveyreport |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can not allow the survey report to become a requirement for every tutor install. We have a proposal to make it part of tutor full, but first we need to finish up the plugin and make it completely optiona. Only then we can create a separate request to include it in https://github.com/overhangio/tutor/blob/master/requirements/plugins.txt
@regisb we sat with @Alec4r in a call giving this PR a big refactor and we'd like you input about the ergonomics of the new Filter. This is probably the first filter that is being contributed so we could not find an example to draw from, so please forgive our lack of understanding. We are looking at adding the filter at the end of the Option 1would be to add something that lets passes the context to the filter and we expect the plugins to run the code that asks the questions. Something like: at tutor core: utils = [ask, ask_bool, ask_choice]
config = ASK_INTERACTIVE_QUESTIONS.apply(config, defaults, utils) at the plugin: @hooks.Filter.ASK_INTERACTIVE_QUESTIONS.add()
def cool_question_function(config, defaults, utils):
utils.ask("do you want to automatically send a survey report to Axim every six months? pretty please :)", "AUTO_SEND_SURVEY_REPORT", config, defaults)
return config Option 2would be to a control loop at the core that asks the question that are mostly string configured at the plugin. at tutor core: for item in hooks.Filter.ASK_INTERACTIVE_QUESTIONS.get_items():
ask(item[2], item[3], config, defaults) at the plugin: hooks.Filters.ASK_INTERACTIVE_QUESTIONS.add_items(
[
(
"surveyreport-namespace",
"do you want to automatically send a survey report to Axim every six months? pretty please :)",
"AUTO_SEND_SURVEY_REPORT",
),
(
"surveyreport-namespace",
"Are you sure?",
"AUTO_SEND_SURVEY_REPORT_CONFIRMATION",
),
]
) Any and all guidance is very appreciated. |
I think I may have put you on the wrong lead. Instead of a filter, maybe create a
|
86c353a
to
a257753
Compare
@regisb @felipemontoya I have added the actions to tutor core and also I openned a PR in surveyreport plugin eduNEXT/tutor-contrib-surveyreport#1 adding the questions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @Alec4r. This is now very much in line with what I was expecting we needed to do in the core of tutor.
The intervention seems lightweight and has an explanation at the definition of the new Action. Would you please go ahead and review this @regisb?
@Alec4r I think we need to update the PR description to make clear that this is no longer surveyreport specific but it is only opening up a space for plugins to ask question during the interactive questionnaire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who doesn't love simplicity? Thanks @Alec4r! Can you please just add a changelog entry?
Sorry about the delay guys, I was busy with the Quince release. |
new hook Action that allows tutor plugins to interact with the configuration at the time of the interactive questionnaire that happens during tutor local launch
9a2ab41
to
7660ead
Compare
I think is done, let me know if you have another comment. |
DESCRIPTION
This PR creates a new hook Action that allows tutor plugins to interact with the configuration at the time of the interactive questionnaire that happens during
tutor local launch
.REQUIRED PLUGINS
None. The creation of the Action does not require anything from new or existing plugins. Current plugins that do not use this action will see absolutely no changes to the functionality of
tutor local launch
.MORE INFO
This Action was first needed when trying to create a plugin to send automatic and anonymized reports of usage.
For more context on that see:
EXAMPLE:
A plugin using this Action to add a new question can be seen at:
eduNEXT/tutor-contrib-surveyreport#1