Skip to content
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

[UI] Dynamic Survey View - Ask teacher for class info #4612 #4711

Merged
merged 43 commits into from
Nov 22, 2023

Conversation

Annelein
Copy link
Collaborator

@Annelein Annelein commented Nov 3, 2023

Fixes #4612

Survey view:

  • Takes a survey_id, a description and questions
  • 'Remind me later' sets 'skip' in survey to todays date, so you could modify the survey to pop up tomorrow/next week
  • 'Don't ask again' sets 'skip' in survey to True, so you could choose to never show the survey again
  • Option to only show unanswered questions

Survey table:

  • Survey_id is: survey_name + '_' + response_id (for ex for the class survey: 'class_class_id')
  • Responses
  • Skip option

Screenshot 2023-11-16 at 15 50 06

@ghost
Copy link

ghost commented Nov 3, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@jpelay
Copy link
Member

jpelay commented Nov 7, 2023

Hi, @Annelein! I reckon I helped you out a bit on Discord about the HTMX issue, is there anything else you need help?

@Annelein
Copy link
Collaborator Author

Annelein commented Nov 8, 2023

Hi, @Annelein! I reckon I helped you out a bit on Discord about the HTMX issue, is there anything else you need help?

Yes you definitely helped! But working on some Hour of Code issues right now, after that I will get back at it and will get in touch with you if I need any help, thanks!!

@jpelay
Copy link
Member

jpelay commented Nov 10, 2023

Hi, @Annelein! I reckon I helped you out a bit on Discord about the HTMX issue, is there anything else you need help?

Yes you definitely helped! But working on some Hour of Code issues right now, after that I will get back at it and will get in touch with you if I need any help, thanks!!

Great! Since this is a PR still in progress I'll set it as a draft 😄 when this is done you can set it as ready for review.

@jpelay jpelay marked this pull request as draft November 10, 2023 14:42
@Annelein
Copy link
Collaborator Author

Can someone help me out on how to make the view grow with the screen size?

Screenshot 2023-11-16 at 15 25 10

@Annelein Annelein marked this pull request as ready for review November 16, 2023 15:01
"You tried to use the variable {name} on line {access_line_number}, but "
"you set it on line {definition_line_number}. Set a variable before using "
"it."
msgstr "You tried to use the variable {name} on line {access_line_number}, but you set it on line {definition_line_number}. Set a variable before using it."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why all these weird changes happen, I think @hasan-sh had a similar issue, do you remember that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep by omitting the --no-wrap flag.

pybabel extract -F babel.cfg -o messages.pot . --no-location --sort-output --omit-header
pybabel update -i messages.pot -d translations -N --omit-header

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the deletion of this file is what is causing the validation problems in the Unit test job, can you add it again and see if it solves the issue?

@Felienne
Copy link
Member

Woooohooo, the unit tests are passing now! Leaving the final approval to @hasan-sh since he still has a "request changes" review pending.

@Annelein
Copy link
Collaborator Author

@Felienne @jpelay only the English and Arabic translations are there, all the other ones are gone, also the Dutch ones..?

@Felienne
Copy link
Member

@Felienne @jpelay only the English and Arabic translations are there, all the other ones are gone, also the Dutch ones..?

Ah yes that happened when I was fixing merge conflicts, sorry. Feel free to add them again, but if we run into conflicts we can also add them later in a next PR.

@@ -297,6 +310,29 @@ def get_class_customization_page(self, user, class_id):
class_id=class_id
))

def class_survey(self, class_id):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great now:)

@@ -359,3 +359,23 @@ def can_edit_class(user, Class):
return Class["teacher"] == user["username"] or \
any(second_teacher["username"] == user["username"] and second_teacher["role"] == "teacher"
for second_teacher in Class.get("second_teachers", []))


def get_unanswered_questions(survey, new_questions):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing job!

msgid "class_survey_later"
msgstr "Remind me tomorrow"

msgid "class_survey_question1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok different questions are fine for now

questions.append(gettext("class_survey_question2"))
questions.append(gettext("class_survey_question3"))
questions.append(gettext("class_survey_question4"))
unanswered_questions, translate_db = utils.get_unanswered_questions(survey, questions)
Copy link
Collaborator

@hasan-sh hasan-sh Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes more sense from the utils of survey;)

Copy link
Collaborator

@hasan-sh hasan-sh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it with the latest changes. I removed the style property since we center the parent with flex, check it out @Annelein ! Will approve there after!

@Felienne
Copy link
Member

Wow that was a lot of hassle @Annelein!! Thanks for being so patient!!

@Annelein
Copy link
Collaborator Author

Wow that was a lot of hassle @Annelein!! Thanks for being so patient!!

Ofcourse! Always on the first pull request, getting used to the whole environment :))

Copy link
Contributor

mergify bot commented Nov 22, 2023

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit b0c6bdf into main Nov 22, 2023
11 checks passed
@mergify mergify bot deleted the survey-class-info branch November 22, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready to gather content
Development

Successfully merging this pull request may close these issues.

[UI idea] Ask teacher for class info
4 participants