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

Reimplemented edit advice method #9

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Conversation

AdrYne01
Copy link
Owner

No description provided.

@AdrYne01 AdrYne01 self-assigned this Apr 14, 2024
Copy link
Collaborator

@bdevine2 bdevine2 left a comment

Choose a reason for hiding this comment

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

I suggested one small change but the rest looks good


# Function to calculate number of advices for the current question attribute based on max and min question score.
# Method name is consistent with the functionality
def calculate_num_advices(question)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you could simplify this into more modern grammar. Something like question.is_a?(ScoreQuestion) ? :

Copy link
Owner Author

Choose a reason for hiding this comment

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

if question.is_a?(ScoredQuestion) This line checks if the current question attribute is scored or not by checking if it is of the type 'ScoredQuestion'. Don't you think 'ScoredQuestion' makes more sense in that case?

Copy link
Collaborator

@bdevine2 bdevine2 Apr 15, 2024

Choose a reason for hiding this comment

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

What I meant exactly was changing it to this

question.is_a?(ScoredQuestion) ? @questionnaire.max_question_score - @questionnaire.min_question_score + 1 : 0

It feels much more modern and elegant.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Oh okay, I understand now. My bad. I will make the necessary changes.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I have updated the file.

@bdevine2 bdevine2 merged commit 91ac933 into main Apr 15, 2024
Copy link
Collaborator

@aebartl3 aebartl3 left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants