-
Notifications
You must be signed in to change notification settings - Fork 716
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
Move handleReplacement logic from ReplaceQuestions.vue to useQuizCreation.js #12099
Conversation
Build Artifacts
|
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.
Thank you @KshitijThareja - I have one blocking and relatively minor question. I'll spin this up later on for a test locally as well
function submitReplacement() { | ||
handleReplacement(); |
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.
Is there any particular reason to call this from within a function rather than returning handleReplacement
from the setup function?
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.
I believe we needed the router logic to be placed inside the ReplaceQuestions
file itself. Returning handleReplacement
from the setup function and directly calling it from @submit
handler would require the routing logic to be placed in the handleReplacement function
that is now moved to useQuizCreation
.
That was the main reason for me to call it from within a function as that provides separation of concerns.
Though I'd like to know if I'm missing something here and if there's a better workaround for this.
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.
Ahh thanks for that - I misread the diff 😅 - I thought the only thing happening in submitReplacement
was calling handleReplacement
.
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.
Oh 😅. No problem :)
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 for this!
function submitReplacement() { | ||
handleReplacement(); |
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.
Ahh thanks for that - I misread the diff 😅 - I thought the only thing happening in submitReplacement
was calling handleReplacement
.
Summary
This PR aims to move the handleReplacements logic from the file
ReplaceQuestions.vue
touseQuizCreation.js
as it was identified as a tech-debt and is better placed inuseQuizCreation
. The changes are introduced keeping in mind the requirements of the issue and the discussion in PR #11937.References
Closes #12012
Reviewer guidance
To verify the working of the changes introduced:
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)