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

Skip the code feedback intro if it's too long #214

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Feb 19, 2021

Fixes #202

If it's more than 80 characters, it's too long for the markdown text to be actually helpful. 80 characters is probably high but anything larger is definitely too much context.

Before

ex <- mock_this_exercise(
  'ggplot(data = penguins, mapping = aes(x = flipper_length_mm, fill = species)) +
    geom_density(alpha = 0.4) + 
    labs(title = "Gentoos have the longest flippers", x = "Flipper length (mm)", y = "Density") + 
    scale_color_brewer(palette = "Set1")',
  'ggplot(data = penguins, mapping = aes(x = flipper_length_mm, fill = species)) +
    geom_density(alpha = 0.4) + 
    labs(title = "Gentoos have the longest flippers", x = "Flipper length (mm)", y = "Density") + 
    scale_fill_brewer(palette = "Set1")'
)

code_feedback(ex$.user_code, ex$.solution_code)

In ggplot(data = penguins, mapping = aes(x = flipper_length_mm, fill = species)) + geom_density(alpha = 0.4) + labs(title = "Gentoos have the longest flippers", x = "Flipper length (mm)", y = "Density") + scale_color_brewer(palette = "Set1"), I expected you to call scale_fill_brewer() where you called scale_color_brewer().

After

code_feedback(ex$.user_code, ex$.solution_code)

I expected you to call scale_fill_brewer() where you called scale_color_brewer().

If it's more than 80 characters, it's too long for the markdown text to be actually helpful. 80 characters is probably high but anything larger is definitely too much context.
@gadenbuie gadenbuie merged commit 5486a2b into rstudio:master Feb 23, 2021
@gadenbuie gadenbuie deleted the fix-202 branch February 23, 2021 19:43
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.

Condense context in grade_this_code()
2 participants