datacamp / sqlwhat

https://sqlwhat.readthedocs.io
GNU Affero General Public License v3.0
3 stars 8 forks source link

test_student_did_not_type functionality #97

Closed colinricardo closed 6 years ago

colinricardo commented 7 years ago

Summary of Issue

At present we can check if a student typed something in the submission. It would be useful to be able to check that they did not type something.

Example

Currently for the TransactSQL course, the triple underscore (___ ) sometimes causes a parsing error in sqlwhat.

screen shot 2017-05-22 at 2 05 57 pm

Additionally, for exercises using ISQL, at present we can only check the AST.

Enhancement Idea

So, it might be useful to check that there is no ___ present in the submission using test_student_did_not_type(), rather than failing when trying to parse the submission. Thus in the SCT, test_student_did_not_type() would only pass and allow the AST checking to occur if there were no blanks present.

Related to #96

machow commented 7 years ago

That's a really good point about the ___ basically being a not of something testable. In pythonwhat there is test_not, so we could add it here. The difficulty is that currently things like test_not wouldn't work with check_node and check_field. However, it'd would work reasonably well with things like test_student_typed.