-
Notifications
You must be signed in to change notification settings - Fork 57
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
hints based on check.call #32
Comments
That is possible in principle, but I am not sure whether it is a good idea to develop such sophisticated custom hints. Over time I tended to make simpler exercises using #< fill_in
#Write your solution here.
t.test( ___ , ____, var.equal=___)
#>
t.test(column1, column1, var.equal=TRUE) And then don't add a customized hint. Or I would add in the hint just a general note that if var.equal = FALSE, we have the wrong test, not checking the students solution. But of course if you really want to polish your problem sets such customized hints can be done. Here is an example: #< task_notest
# Create a sequence from 1 to 10 with step size 2
#>
seq(1,10,by=2)
#< hint
restore.point("in_my_hint")
val = try(eval(parse(text = .stud.code)), silent = TRUE)
if (true(identical(val,seq(1,10,by=1)))) {
cat("You need to add the argument 'by=2'")
}
#> The code in the hint will be evaluated in an environment that contains all the variables created in previous chunks and that have been generated when the students code in that chunk has been run. In addition there is a special variable Note that you can use restore points to debug your custom hint. |
Thank you very much for your fast answer! Yes, this works. |
Sounds actually like a good idea that I can also use for my courses. I am working on a more convenient function to show such conditional hints and an integration with RTutorSAGI to generate some automatic templates for such conditional hints based on student's common mistakes. |
Oh yes, I think that would be an amazing addition to the package! |
Ok, the RTutor part is now implemented with this commit that introduces the function Take a look here for documentation and examples. If at some point you test it out, please let me know whether it works nicely. I will now (or later) check in how far one can create some nice hint skeleton code with RTutorSAGI. |
Thank you very much! Even this works:
which is not obvious based on the vignette and might be useful to know to new users. Is there a specific reason why you opted for having to call auto.hint.else()? The auto hints are generally extremely useful and so I am pretty hard pressed to think of reasons why one might want to have them off. I expect that I will put the auto.hint.else() after each hint. Of course I could otherwise use add_to_hint but this shows a different behavior if the expected erronous call is executed as now both the auto hint and my text are displayed. Design-wise I would suggest to leave auto-hint always on, and have a function suppress.auto.hint() (or something like that) if one explicitly only wants the hints which one has generated oneself. |
I just made another update that also adds the function Taking this and other aspects into account (like flexible positioning), I like the explicit |
Ok, all features I thought about so far, are now included in RTutor and RTutorSAGI:
|
Thank you very much! I have incorporated them in my fork an will test them. If I find anything, I come back to you! For the RTutorSAGI Tests I will probably need a month however, as this will be relevant for us, when we get the results of this month. |
Could you give me a pointer regarding the usage of hints when working with check.call instead of check.assign and check.function?
Say I want the student to use a two-sample t-test (but expressively not a Welch-test!). The following workaround does the trick:
The automatic hint directs the student to the missing option, but I think it is helpful to give context information.
It would be nice however if I could write something like
This way the student would not have to do the artifical step to first save and then display the variable, as we are only interested in interpreting the output.
Is this possible/did I miss this in the manual?
The text was updated successfully, but these errors were encountered: