Question Authors' Forum

Checking error

 
Picture of Vladimir Ilyin
Checking error
by Vladimir Ilyin - Thursday, 21 September 2017, 12:49 AM
 

Hello,

Some times I get

Syntax Error(s)

/var/www/html/jobe/application/libraries/../../runguard/runguard: warning: timelimit exceeded (wall time): aborting command
/var/www/html/jobe/application/libraries/../../runguard/runguard: warning: command terminated with signal 15
as a result of testing correct solution.

I understand what it means, but why "Syntax error"?

And how can I fix the problem?

Picture of Richard Lobb
Re: Checking error
by Richard Lobb - Thursday, 21 September 2017, 9:36 AM
 

There are two steps in executing a job in any language: a so-called "compile" step followed, if successful, by a run. For interpreted languages, the compile step is usually some form of syntax check.

It seems your job has timed out in the compile step; any failure in the compile step is taken to be a syntax error. I agree in this context "Syntax error" is inappopriate but entitling it "Compile error" would be very confusing in the much more common situation of an interpreted language like Python or PHP failing its preliminary syntax checks.

I am surprised to see a compile step time out. What language are you using? What question type? And how long was the code you submitted?

The short term fix is to increase the job's timelimit in the question itself or its prototype. The timelimit is used for both the compilation and execution steps separately. The entry field is in the Advanced Customisation section of the author's form when customising a question.

However, I would still like to know how you came to have a timeout error when compiling. The timeout is usually at least 3 seconds.

Richard

Picture of Vladimir Ilyin
Re: Checking error
by Vladimir Ilyin - Thursday, 21 September 2017, 3:27 PM
 

I used java_program question type and my students sent solution without any cycle.
Just input, output and one "if" in a program. 

Testing took several minutes.

I think the reason is many submits at the same time.
It was about 50 submits at one time

One submit at one time testing  takes about 40 seconds .
I think it is a very long time too.

The question's field TIMELIMIT is empty.

Picture of Richard Lobb
Re: Checking error
by Richard Lobb - Thursday, 21 September 2017, 8:17 PM
 

40 seconds for a single run of a question is certainly not acceptable. Have you tried the Java questions on this website in the C and Java quiz? You'll find they take from 2 - 5 seconds.

How many test cases does your question have? If you have a lot of test cases and either:

  • the prototype for the question does not use a combinator template and/or
  • each test case has different standard input
then you'll be sending a separate compile-and-run job to the jobe server for every test case. Java is pretty sluggish so I could imagine 20 or more test cases taking 40 seconds.

If you're writing questions with a large number of test cases, you might want to consider an alternative way of marking the student submission, e.g. by writing your own template grader that contains all the test data within it, so you need only a single job run.

If you not using a large number of test cases and you're experiencing run times like 40 seconds for a single submission then something is seriously broken. Is it possible that some process in Moodle, Jobe or the student browser is timing out on a web request to an inaccessible site, for example?

As an aside it is possible to write question types that package up all the test cases into a single run, even when multiple standard inputs are required. You can get some hints on how to do this by opening the question authoring form, clicking customise, and reading the Template controls help. But it's tricky, and I haven't done it for Java, as I don't currently teach any courses using it.

Richard


Picture of Vladimir Ilyin
Re: Checking error
by Vladimir Ilyin - Saturday, 23 September 2017, 12:17 AM
 
All of my problems has no cases, but different input.

I think it will be useful to not recompile the solution if all cases are empty.

I tried to make combinator (make cases from inputs).

It seems to be ok, but the template debugging shows, that after combinator run
the system run all testcases separately.

Why Combinator is checked, of course.


Picture of Richard Lobb
Re: Checking error
by Richard Lobb - Saturday, 23 September 2017, 10:22 AM
 

You probably need to check the box "Allow multiple stdins". The on-line template controls documentation hopefully explains this:

"However, if testcases have standard input defined, combinator templates become problematic. If the template constructs a single program, what should the standard input be? The simplest (and default) solution is to run the test cases one at a time, using the combinator template to build each program, passing it a TESTCASES variable containing just a single test. This 'trick' allows the combinator template to serve a dual role: it behaves as a per-test-case template (with a 1-element TESTCASES array) when the question author supplies standard input but as a proper combinator (with an n-element TESTCASES array) otherwise. To change this behaviour so that the combinator receives all testcases, even when stdin is present, check the 'Allow multiple stdins' checkbox."

Richard

Picture of Vladimir Ilyin
Re: Checking error
by Vladimir Ilyin - Saturday, 23 September 2017, 3:51 PM
 

I don't see checkbox "Allow multiple stdins" anywhere.

May be I have to upgrade CodeRunner from 3.0.1?

The question I made from scratch with java_method template works correctly. It starts once.

I checked twice - now in my question on inputs are empty. Just testcases and expected are filled. And It starts N + 1 time...

Picture of Richard Lobb
Re: Checking error
by Richard Lobb - Saturday, 23 September 2017, 5:32 PM
 

Ah, yes - the "Allow multiple stdins" is new (July 2017, CodeRunner version 3.2.0). However, a simple workaround with older versions is to use the Extra field instead for the standard inputs. 

If your program is running N + 1 times I suspect you're getting a timeout (or some other exception) on the first submission. CodeRunner then backs off to running test cases one by one. Increase the timeout?

Richard

Picture of Vladimir Ilyin
Re: Checking error
by Vladimir Ilyin - Monday, 25 September 2017, 7:04 AM
 

Thank you.

The reason was the combinator run is not usual run.

If student call exit() - the combinator run breaks down.

But I moved my stdins to testcase boxes, because the extra fields are not presented in auto examples.

So everything is fine. Combinator run is much faster.