Problem in SQL Type Question

Problem in SQL Type Question

de Pierre FACON -
Número de respuestas: 4

Hello everyone, i found (i think a bug) in the SQL Type question.

While you are creating a new test case for SQLLITE, if, in the

"Test case 1" entry field, the input begins with the 1, for example, you input 

"1st test", then, after execution you have this error at the end of screen :

***Error***
Error: near line 7: unrecognized token: "1st"
But everything works fine if the 1 is after the first caracter (for exemple "test 1")

That took me a lot of time to find it.

Thanks to the creators of that  very good product

En respuesta a Pierre FACON

Re: Problem in SQL Type Question

de Pierre FACON -

I think that this is even more restrictive.

The entry field has to begin with "--" if we want it to run.

Not very clear.

Thanks !

En respuesta a Pierre FACON

Re: Problem in SQL Type Question

de Richard Lobb -

It sounds like you're expecting to enter a textual description of the test you're performing into the Test field. But the test field defines the SQL code to be executed for the test. A line starting with a '1' isn't valid SQL. In sqlite3 '--' denotes the start of a comment, which then makes your description into valid SQL, though it doesn't achieve anything beyond communicating to the student.

En respuesta a Richard Lobb

Re: Problem in SQL Type Question

de Pierre FACON -

Hello Richard,

I understand now, and you are right, this is well documented when mouse is over the test caption.

But until now, i only used the "answer" input field, and that seemed to be enought to evaluate sql knowledge of students.

The question is, in which case we can use the test code ? i see that it is executed after the response is itselt executed.

Should it be used for example to validate "insert into table" response, and be sure that inserts have well be done ? 

Thanks for all!


En respuesta a Pierre FACON

Re: Problem in SQL Type Question

de Richard Lobb -

Sure. You can use the test to verify that the student has changed the database state in the required way, e.g. that they've inserted the required rows, or done required updates, or created an appropriate table etc.