[LON-CAPA-users] Custom Response Partial Credit

Harding, Gene L glhardin at purdue.edu
Fri May 18 17:54:22 EDT 2018


Hi,

I rewrote the problem I have been working on so that it is now a custom response, but am having trouble getting it to properly grade the problem submission. This is the code for grading inside the answer block:
         if ($total_score == 1) { return 'EXACT_ANS'; }
           elsif ($total_score > 0) { return ('ASSIGNED_SCORE',$total_score); }
           else  { return 'INCORRECT'; }
         return ('ASSIGNED_SCORE',$total_score);

I have tried it with and without the second return statement, but either way the Correct/Partially Correct/Incorrect grading seems almost random. $total_score is computed in a perl script higher up in the program, and I am outputting it to verify that it is being computed correctly. I also have a retrypartial parameter at the top of the program because I want the students to be able to take three tries at it on the practice version:
<parameter name="retrypartial" type="string_yesno" description="Partially correct is answerable" default="yes" />

Can anyone see what I am doing wrong?

Thanks for any help/advice you can provide.

Best regards,

Gene L. Harding, PE
Associate Professor of ECET
574-520-4190

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20180518/89e87eee/attachment.html>


More information about the LON-CAPA-users mailing list