Error output for matlab/octave question type

Error output for matlab/octave question type

de Yusri Yusup -
Número de respuestas: 6

Dear all, 

I got this output when testing the question for Matlab/octave. Is there a fix?

***Error***

terminate called after throwing an instance of 'octave::exit_exception'

panic: Aborted -- stopping myself...

attempting to save variables to 'octave-workspace'...

save to 'octave-workspace' complete

Aborted (core dumped)

En respuesta a Yusri Yusup

Re: Error output for matlab/octave question type

de Richard Lobb -

There is a bug in Octave 4.2 - see here - which results in an unhandled exception if a script with a call to exit() is executed from a bash command line. There used to be a call to exit() in the Octave template(s) but it got removed some years back when that bug surfaced. Are you getting it as a consequence of having an old version of CodeRunner or because you're running your own or student's code with a call to exit() in it?

Either way, the easiest workaround is simply to remove any calls to exit().

Alternatively, since the bug is fixed in later versions of Octave, you can try upgrading Jobe to use a later version (e.g. see here) but it's a big download and you'll have to replace /usr/bin/octave with a script to run octave with flatpak. I haven't tried this myself, so you're on your own here.

En respuesta a Richard Lobb

Re: Error output for matlab/octave question type

de Yusri Yusup -

Thank you so much for the reply. 

No, there was no call to exit() in the submitted code so I probably need to update the Jobe server.

Will this bug also affect the Matlab question type?

En respuesta a Yusri Yusup

Re: Error output for matlab/octave question type

de Richard Lobb -

The exit() must be coming from the CodeRunner template, not the Jobe server. Is this one of the built-in question types? If so which, one?

Try editing the question, click the Customise checkbox and inspect what template is being used. I think there must be an exit() in there. Try removing it. Also, paste the template into your next posting so I can see what's going on.

What version of CodeRunner are you running?

En respuesta a Richard Lobb

Re: Error output for matlab/octave question type

de Yusri Yusup -
Its this one UOC_PROTOTYPE_matlab_script. I downloaded it from the other forum post though not sure which one.

Anyway, this is the template:

function disp(x)

    if (strcmp(class(x), 'logical') == 1)

        printf('%6d', x)

        printf('\n')

    elseif (strcmp(class(x), 'double') == 1)

        if (int64(x) == x)   % Integral?

            printf('%6d', x)

            printf('\n')

        else

            printf('%10.4f', x)

            printf('\n')

        end

    elseif (strcmp(class(x), 'char') == 1)

        printf('%s\n', x)

    else

        printf('Unexpected data type passed to disp')

    end

end


{% for TEST in TESTCASES %}

{{ TEST.testcode }};

{{ STUDENT_ANSWER }}

clear;

{% if not loop.last %}

disp('#<ab@17943918#@>#');

{% endif %}

{% endfor %}

quit();