smithev95 / NEFP-Capstone

0 stars 0 forks source link

Add AddQuestionPage and update add_question logics to support translations #61

Closed ployniti closed 1 week ago

ployniti commented 1 week ago

Describe your changes

Add a AddQuestionPage.js in frontend to replace add_question_form.html in backend. The AddQuestionPage supports getting translations for questions, answer choices, and the word "other" when user tries to add a new question. The changes also update the logic to store the new question and its translations into the database.

There is no button on the LandingPage.js to access this page yet since we're updating the UI for that but the changes can be tested by going to http://localhost:3000/addQuestion.

Issue ticket number and link

https://github.com/users/smithev95/projects/1/views/1?pane=issue&itemId=69712224

Testing done

Local UI testing.

Checklist before requesting a review

[x] I have performed a self-review of my code [ ] If it is a core feature, I have added thorough tests.

ployniti commented 1 week ago

Could you please add "Translators" to requirements.txt. After that I will approve the pull request.

Translations can be a bit finicky. Sometimes I get the error below.

translate_question_error

Added translators to requirements.txt. I also updated my get request and the url to get translations a bit to help with the above issue.

ployniti commented 1 week ago

I pulled the latest changes from main into this branch so I can add addQuestionPage to the navbar that was just merged from Sean's tk-58 branch. Hopefully this didn't make things too difficult for others.