You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some history first: In the past, pythonwhat featured the test_function("my_fun") function, that would look for a call of my_fun() in the solution, look at which arguments were specified in the solution code and what their values were. Next, this function would look at the student, and demand the exact same function call, with the same arguments and same values to be present in the student's submission as well. Even though this allowed for very succinct SCTs, there were some problems with this approach. First, the function was a magic box, that did a bunch of stuff for you behind the scenes. If it broke, you had no clue where or why. Second, the amount of arguments passed to test_function() started to explode to allow for all kinds of ways to customize how the function worked, e.g. to not test some arguments, to not evaluate some arguments but check their values instead, to adapt the automatically generated messages in different error cases, etc. After some time, it was decided to go with more granular checks: instead of test_function(), there is now check_function() to look for the function call, check_args() to see if an argument was specified, and has_equal_value() to see if the arguments correspond:
# call to verifyround(1.1234, ndigits=2)
# old SCTtest_function("round")
# new SCTEx().check_function('round').multi(
check_args(0).has_equal_value(),
check_args('ndigits').has_equal_value()
)
Even though much more verbose, functions are more atomic, it is now crystal clear what is being tested, and it is easy to customize how things are tested (e.g. drop a check_args() if you don't want to verify an argument).
Looking at sheetwhat with this history in mind, we can see functions like has_equal_pivot() and has_equal_chart() that are basically test_function()-like one-stop-shops that just verify almost everything there is to verify about a pivot table or chart. It is impossible to customize what it's doing, to specify different custom feedback messages, etc.
The proposal, therefore, is to come up with a set of building block functions that make it easy for SCT authors to zoom in on parts of the student data and solution data, verify parts, verify the length of parts, etc. For example (but feel free to propose something else):
Some history first: In the past,
pythonwhat
featured thetest_function("my_fun")
function, that would look for a call ofmy_fun()
in the solution, look at which arguments were specified in the solution code and what their values were. Next, this function would look at the student, and demand the exact same function call, with the same arguments and same values to be present in the student's submission as well. Even though this allowed for very succinct SCTs, there were some problems with this approach. First, the function was a magic box, that did a bunch of stuff for you behind the scenes. If it broke, you had no clue where or why. Second, the amount of arguments passed totest_function()
started to explode to allow for all kinds of ways to customize how the function worked, e.g. to not test some arguments, to not evaluate some arguments but check their values instead, to adapt the automatically generated messages in different error cases, etc. After some time, it was decided to go with more granular checks: instead oftest_function()
, there is nowcheck_function()
to look for the function call,check_args()
to see if an argument was specified, andhas_equal_value()
to see if the arguments correspond:Even though much more verbose, functions are more atomic, it is now crystal clear what is being tested, and it is easy to customize how things are tested (e.g. drop a
check_args()
if you don't want to verify an argument).Looking at
sheetwhat
with this history in mind, we can see functions likehas_equal_pivot()
andhas_equal_chart()
that are basicallytest_function()
-like one-stop-shops that just verify almost everything there is to verify about a pivot table or chart. It is impossible to customize what it's doing, to specify different custom feedback messages, etc.The proposal, therefore, is to come up with a set of building block functions that make it easy for SCT authors to zoom in on parts of the student data and solution data, verify parts, verify the length of parts, etc. For example (but feel free to propose something else):
The text was updated successfully, but these errors were encountered: