[LON-CAPA-users] LON-CAPA Error

Raeburn, Stuart raeburn at msu.edu
Sun Nov 8 16:01:43 EST 2020


Gene,

Maybe you could assign me a student role in your sandbox course?  

If I can replicate the "Unable to understand formula" issue for this particular problem part on one of the LON-CAPA servers I run, I'll then be able to add some debug code within LON-CAPA, which hopefully will allow me to determine the cause.

I believe you'll find that your old code would grade a submission of log10(σ^10) as incorrect, but 10*log10(σ) as correct, whereas the code I provided would be consistent, in grading both as correct (which was the main point of my previous reply).

Stuart Raeburn
LON-CAPA Academic Consortium
________________________________________
From: LON-CAPA-users <lon-capa-users-bounces at mail.lon-capa.org> on behalf of Harding, Gene L <glhardin at purdue.edu>
Sent: Sunday, November 8, 2020 2:23 PM
To: Discussion list for LON-CAPA users
Subject: Re: [LON-CAPA-users] LON-CAPA Error

Hi Stuart,

Thank you for your reply. I tried the code you sent, and it works same as the old code: correctly when I am logged in as me, but "Unable to understand formula" when I log in as a student in the sandbox. I guess I am still confused about why it would interpret a formula correctly in one setting, but not in the other...

BR,

Gene L. Harding, PE
Associate Professor of ECET

-----Original Message-----
From: LON-CAPA-users <lon-capa-users-bounces at mail.lon-capa.org> On Behalf Of Raeburn, Stuart
Sent: Saturday, November 7, 2020 2:36 PM
To: Discussion list for LON-CAPA users <lon-capa-users at mail.lon-capa.org>
Subject: Re: [LON-CAPA-users] LON-CAPA Error

Gene,

In a formularesponse item, a student's submission will be checked for correctness using the maxima CAS, unless sample points were specified in the formularesponse tag (in which case CAPA is used to check for correctness via sampling; note: ó is not supported as a variable name in this older sample-based checking).

The log() function is available in maxima for natural logs, but log10() is not available, by default.

If students will be submitting answers that include log10() then one approach would be to call a preprocessor routine which would use a call to &cas('maxima') to convert the log10(ó) in the submitted expression to natural logs, i.e., convert log10(ó) to log(ó)/log(10), before comparison with the computer's answer.  Note: in this case the "computer's answer" would need to be expressed using natural logs.

Accordingly, the script block would contain:

$radarRCS  = "+10*log(ó)";
$radarRCS2 = "+10*log(ó)/log(10)";

sub convertlogten {
    ($answer)=@_;
    $expr = 'log10(x) := log(x) / log(10); '.$answer;
    $answer = &cas('maxima',$expr);
    return $answer;
}

and the formularesponse item would be:

<formularesponse preprocess="convertlogten">
    <answergroup type="ordered">
        <answer name="log" type="ordered">
            <value>$radarRCS</value>
        </answer>
        <answer name="log10" type="ordered">
            <value>$radarRCS2</value>
        </answer>
    </answergroup>
    <textline addchars="ó" size="25" />
</formularesponse>

This change is necessary so that if a student submits an answer of:

log10(ó^10)

this will be graded as correct (i.e., for answer name: log10), as it is equivalent to 10*log10(ó), which would then be similar to the current behavior if a student submits an answer of:

log(ó^10)

(i.e., for answer name: log) which is graded as correct as it is equivalent to 10*log(ó)

Note in the preview, displayed below the textbox used to enter an answer, when log10 is typed, the previewer actually displays the 10 as a subscript.

Stuart Raeburn
LON-CAPA Academic Consortium
________________________________________
From: LON-CAPA-users <lon-capa-users-bounces at mail.lon-capa.org> on behalf of Harding, Gene L <glhardin at purdue.edu>
Sent: Thursday, November 5, 2020 11:19 AM
To: Discussion list for LON-CAPA users
Subject: [LON-CAPA-users] LON-CAPA Error

Hi,

I am getting an error I don't remember seeing before with a formula response problem that takes a Greek letter as part of the formula. The odd thing is that it works fine for me, whether in student or course coordinator mode, but not for the students. I have been able to recreate the error by logging in as a student to a Test course and doing the problem from there. The first time I submitted a response it took 20-30 seconds to process, and gave a timeout error. Subsequent submissions appear to process much faster, and gave an "Unable to understand formula" error. It is set up to take either of two formulas for the answer.

Here are the perl script formula definitions:
$radarRCS  = "+10*log(ó)";
$radarRCS2 = "+10*log10(ó)";

This is the formula response code:
<formularesponse id="14">
    <answergroup type="ordered">
        <answer name="log" type="ordered">
            <value>$radarRCS</value>
        </answer>
        <answer name="log10" type="ordered">
            <value>$radarRCS2</value>
        </answer>
    </answergroup>
    <textline addchars="ó" size="25" />
</formularesponse>

This approach works fine for the two preceding problem parts, but they do not use the "addchars" modifier with a Greek letter.

Has anyone seen this error before and have an idea of what causes it?

Best regards,

Gene L. Harding, PE
Associate Professor of ECET

_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users at mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users at mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users


More information about the LON-CAPA-users mailing list