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

[#8607] Student: edit submission: show evaluees in alphabetical order #11482

Conversation

NicolasCwy
Copy link
Contributor

@NicolasCwy NicolasCwy commented Dec 1, 2021

Fixes #8607

Sort the list of FeedbackResponseRecipient according to their name, using the recipientList - which is sorted within the component - as a reference. This will fix ensure that names of evaluees for number scale questions will not be shown according to their email address.

Example

image

Current implementation (sort by email)

Screen.Recording.2022-01-15.at.8.07.52.PM.mov

New implementation from PR (sort by name)

Screen.Recording.2022-01-15.at.8.02.00.PM.mov

@NicolasCwy
Copy link
Contributor Author

NicolasCwy commented Dec 1, 2021

  1. Should I be creating a test for this feature? If so would it be found in question-submission-form.component.spec.ts

@NicolasCwy NicolasCwy force-pushed the 8607-edit-submission-students-alphabetical-order branch from 1563038 to e9572a5 Compare December 2, 2021 01:59
@NicolasCwy NicolasCwy marked this pull request as draft December 2, 2021 02:02
@NicolasCwy NicolasCwy marked this pull request as ready for review December 2, 2021 12:03
@ypinhsuan
Copy link
Contributor

  1. Should I be creating a test for this feature? If so would it be found in question-submission-form.component.spec.ts

It would be good if you can add tests for it, and yes it should be in question-submission-form.component.spec.ts

@NicolasCwy
Copy link
Contributor Author

NicolasCwy commented Dec 4, 2021

Hi @ypinhsuan, my comment was hidden in the review page but

Should the sort go into a method? Was thinking of putting it as a component class method but felt that it should be private as it is merely a class helper function, although javascript does not seem to have such a concept, so I'm not sure how to abstract it out.

I'm also trying to implement this idea, as I would be able to just test this method instead of creating the whole component which I think would require a stub for QuestionSubmissionFormModel to instantiate the component and it seems complicated as the model is quite big. Any advice is appreciated.

I'll be working on E2E tests in the meantime as I think I know how it should be done.
Edit: Are the emails used in E2E testing real valid emails? E.g ISList.charlie.tmms@gmail.tmt. Trying to test the sort, but the student emails are coincidentally in the same alphabetical order as their name, and it wouldn't be possible to test the sort with the current students used in FeedbackNumScaleQuestionE2ETest.java

@ypinhsuan
Copy link
Contributor

Hi! Sorry for missing your previous comment, I've replied in that thread.

require a stub for QuestionSubmissionFormModel to instantiate the component

For front-end component tests, you can create a QuestionSubmissionModel object for testing. Perhaps looking at how instructor-course-edit-page.component.spec.ts create test course and test instructors can help.

Are the emails used in E2E testing real valid emails?

Nope. Emails for E2E testing are fake emails.

@madanalogy madanalogy added the s.Ongoing The PR is being worked on by the author(s) label Dec 8, 2021
@NicolasCwy
Copy link
Contributor Author

NicolasCwy commented Dec 8, 2021

@ypinhsuan Thanks for pointing me to the right places! I'm currently working on the E2E tests in src/e2e/java/teammates/e2e/cases/FeedbackNumScaleQuestionE2ETest.java.

I've got a few questions on my approach.

  1. I am going to test the evaluee sorting order in testSubmitPage(), since the setup has to be done in the instructor page, should I add it as a ___TS test case in the testEditPage, since I don't see a setup function prior to the tests

  2. How should I debug the E2E test, I have an assertion failure from parts of the test I have not changed, and am not sure how to check the difference. I tried searching stuff on TestNG but it seems that the projects setup doesn't allow you to run the test directly and instead goes through gradle

  3. The tests in the E2E tests seems to have a single option therefore the method submitNumScaleResponse() in src/e2e/java/teammates/e2e/pageobjects/FeedbackSubmitPage.java seems to be sufficient. I was not able to find anything for num scale questions with multiple responses. Should I be creating a function similar to submitMsqResponse() to let me select multiple options in a numScale question which has multiple evaluees?

Copy link
Contributor

@ypinhsuan ypinhsuan left a comment

Choose a reason for hiding this comment

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

The frontend component tests look great!

@ypinhsuan
Copy link
Contributor

It seems like adding E2E test requires quite a bit of work (adding a new numscale question with multiple response and creating methods in pageobjects/FeedbackSubmitPage.java for it). Personally I think the frontend component tests should be sufficient for this issue. E2E tests are mainly for making sure the interaction between different parts of the application is correct.

For debugging E2E tests:

teammates.e2e.pageobjects.InstructorFeedbackEditPage.verifyNumScaleQuestionDetails(InstructorFeedbackEditPage.java:608)
        at teammates.e2e.cases.FeedbackNumScaleQuestionE2ETest.testEditPage(FeedbackNumScaleQuestionE2ETest.java:54)
        at teammates.e2e.cases.FeedbackNumScaleQuestionE2ETest.testAll(FeedbackNumScaleQuestionE2ETest.java:33)

This part points you to the part which causes test failure. And the assertion error shows the actual vs expected output. In this case expected:<[1]> but was:<[0]> suggests that the expected MinNumscaleInput should be 1 but you are getting 0

Copy link
Contributor

@ypinhsuan ypinhsuan left a comment

Choose a reason for hiding this comment

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

Looks good!

@jianhandev jianhandev added s.FinalReview The PR is ready for final review and removed s.Ongoing The PR is being worked on by the author(s) labels Dec 13, 2021
Copy link
Contributor

@ypinhsuan ypinhsuan left a comment

Choose a reason for hiding this comment

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

LGTM. For your review @jianhandev @daongochieu2810

@nusoss-bot
Copy link

Guys, This PR seems to be stalling (no activities for the past 8 days). 🐌 😢
Hope someone can get it to move forward again soon...

@hhdqirui
Copy link
Member

hhdqirui commented Jan 1, 2022

For your kind review @jianhandev @daongochieu2810

Copy link
Contributor

@jianhandev jianhandev left a comment

Choose a reason for hiding this comment

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

Looking good, just some minor issues I've picked up:

@nusoss-bot
Copy link

Guys, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢
Hope someone can get it to move forward again soon...

@jianhandev jianhandev added s.FinalReview The PR is ready for final review and removed s.Ongoing The PR is being worked on by the author(s) labels Jan 11, 2022
@madanalogy madanalogy added s.Ongoing The PR is being worked on by the author(s) and removed s.FinalReview The PR is ready for final review labels Jan 14, 2022
@madanalogy madanalogy added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging c.Feature User-facing feature; can be new feature or enhancement to existing feature and removed s.Ongoing The PR is being worked on by the author(s) labels Jan 15, 2022
@madanalogy madanalogy added this to the V8.6.0 milestone Jan 15, 2022
@madanalogy madanalogy merged commit 9f6c8ed into TEAMMATES:master Jan 16, 2022
@NicolasCwy NicolasCwy deleted the 8607-edit-submission-students-alphabetical-order branch January 22, 2024 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Feature User-facing feature; can be new feature or enhancement to existing feature s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Student: edit submission: show evaluees in alphabetical order
8 participants