datacamp / sqlwhat

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

Give feedback if blanks are left, even if they cause syntax error #96

Closed filipsch closed 6 years ago

filipsch commented 7 years ago

Raised by @colinricardo in https://github.com/datacamp/courses-msft-transact-sql/issues/49#issuecomment-302792248

See screencast: https://v.usetapes.com/WayrkiARsE

Basically, adding blanks can have the exercise pass the SCT.

machow commented 7 years ago

this may be more of a sqlbackend issue--we can catch if there are blanks as in rbackend

machow commented 7 years ago

Just a note--sqlwhat's fallback strategy is that if an AST can't be parsed, then it can only check the result or use test_student_typed.

colinricardo commented 7 years ago

Hmm, the AST does seem to be parsing okay, for example this exercise shown on sqlwhat here.

As far as I know, I can't use check_result() with these because they're also also using use_isql=True.

machow commented 7 years ago

Here's a cropped version of the code, where It's a bit easier to see the parse error. The red dot in the parser graph indicates an error, it was a bit tucked away in the full code.

edit:

The isql part is a bit tough, since that means we can only use test_student_typed, when there's a parser error. I'll look into setting the exercise to fail whenever isql returns an error.

colinricardo commented 7 years ago

Ah, sorry - thanks!

Related, I was thinking it would be cool if one could do something like test_student_did_not_type() then you could just check if there's any blanks in the submission that way.

filipsch commented 7 years ago

@colinricardo, can you raise that in another issue, with an example that illustrates? Thanks!

colinricardo commented 7 years ago

@filipsch sure thing.

colinricardo commented 7 years ago

@machow is there any update on setting the exercise to fail whenever isql returns an error?

machow commented 7 years ago

@colinricardo not currently, we could probably just search for the error message and add an option that way. I'll open an issue.

filipsch commented 6 years ago

This has been resolved through switching from isql to sqlcmd, and implementing the test_not functionality in protowhat (which can be used by sqlwhat).