-
Notifications
You must be signed in to change notification settings - Fork 1
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
Make message more informative #69
Conversation
cdf6c27
to
17945b0
Compare
It feels like we could be doing a little more here and showing both values if there are 2 or fewer mistakes. # Lengths differ <= 2 and <= 2 value differences
.result <- 1:3
.solution <- 1:5
vec_grade_length()
#> <gradethis_graded: [Incorrect]
#> Your result should contain 5 values, but it has 3 values. I expected
#> your result to include the values `4` and `5`.
#> > I'm sure we could get into complicated territory around giving better descriptors, e.g.
or showing up to n values when they are contiguous. But that's also a lot more complicated and we can wait on that. In general, I think we should try hard to make clear the total number of problematic values, even if we only show 1-3 of them explicitly. In the following example, only showing the first 3 values without any more information makes it seem like there the result is off by three when it's in fact off by 6 values. # Missing values after first three
.result <- c(1:3, rep(4L, 7))
.solution <- 1:10
vec_grade_values()
#> <gradethis_graded: [Incorrect]
#> I expected your result to include the values `5`, `6`, and `7`.
#> > We could instead add a little more context
But more broadly, I think we might need to think about an overall different approach for some length/values problems that handles both at the same time to try to give more helpful feedback. |
length
problem message now includes the first missing or unexpected value if two conditions are met:values
problem messages now inform the user of problems after the firstmax_diffs
values:Created on 2021-10-21 by the reprex package (v2.0.1)
Created on 2021-10-13 by the reprex package (v2.0.1)
Miscellaneous
vec_*_length()
as alias forvec_*_dimensions()
For #65.