Thanks for the help. I post below a special "grader" that allows me to simulate and experiment with grader output. When I simply press "check", it shows the code and the table etc. as expected. But if I change for example "fraction" to "friction", ie correct except that I have used the wrong key, all that returns is
"Stored test results could not be deserialised. Perhaps try regrading?
Your code must pass all tests to earn any marks. Try again."
Is there any way to get more specific information, like "friction not recognised" or similar?
I'm running in a local "sandpit", and the question is being previewed from the question bank.
Thanks!
<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<question type="coderunner">
<name>
<text>Quiz CS6721 Result tester 211102</text>
</name>
<questiontext format="html">
<text><![CDATA[<div style="font-size: 20;">
<p>Test results passed back to Moodle.</p>
<table>
<tbody>
<tr>
<td>got</td>
<td>STUDENT_ANSWER</td>
</tr>
<tr>
<td>comment</td>
<td>arbitrary</td>
</tr>
<tr>
<td>fraction</td>
<td>real</td>
</tr>
<tr>
<td>awarded</td>
<td>integer</td>
</tr>
<tr>
<td>abort</td>
<td>Boolean</td>
</tr>
<tr>
<td>prologuehtml</td>
<td>html</td>
</tr>
<tr>
<td>epilogue</td>
<td>html</td>
</tr>
<tr>
<td>testresults</td>
<td>list of lists</td>
</tr>
<tr>
<td>showoutputonly</td>
<td>Boolean</td>
</tr>
</tbody>
</table>
</div>]]></text>
</questiontext>
<generalfeedback format="html">
<text></text>
</generalfeedback>
<defaultgrade>10.0000000</defaultgrade>
<penalty>0.0000000</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<coderunnertype>python3</coderunnertype>
<prototypetype>0</prototypetype>
<allornothing>1</allornothing>
<penaltyregime>10, 20, ...</penaltyregime>
<precheck>4</precheck>
<showsource>1</showsource>
<answerboxlines>18</answerboxlines>
<answerboxcolumns>100</answerboxcolumns>
<answerpreload></answerpreload>
<globalextra><![CDATA[<div><pre><div>
<p>Processing stops when the name field is empty.</p>
<p>
<table>
<tr>
<td>N00 <input type='text' name='N00' class='coderunner-ui-element' value='showoutputonly' size=50></input></td>
<td>V00 <input type='text' name='V00' class='coderunner-ui-element' value='false' size=50></input></td>
</tr><tr>
<td>N01 <input type='text' name='N01' class='coderunner-ui-element' value='testresults' size=50></input></td>
<td>V01 <input type='text' name='V01' class='coderunner-ui-element' value='[["L","R"],[0,1]]' size=50></input></td>
</tr><tr>
<td>N02 <input type='text' name='N02' class='coderunner-ui-element' value='fraction' size=50></input></td>
<td>V02 <input type='text' name='V02' class='coderunner-ui-element' value='0.5' size=50></input></td>
</tr><tr>
<td>N03 <input type='text' name='N03' class='coderunner-ui-element' value='prologuehtml' size=50></input></td>
<td>V03 <input type='text' name='V03' class='coderunner-ui-element' value='"prologue"' size=50></input></td>
</tr><tr>
<td>N04 <input type='text' name='N04' class='coderunner-ui-element' value='epiloguehtml' size=50></input></td>
<td>V04 <input type='text' name='V04' class='coderunner-ui-element' value='"epilogue"' size=50></input></td>
</tr><tr>
<td>N05 <input type='text' name='N05' class='coderunner-ui-element' value='' size=50></input></td>
<td>V05 <input type='text' name='V05' class='coderunner-ui-element' value='' size=50></input></td>
</tr><tr>
<td>N06 <input type='text' name='N06' class='coderunner-ui-element' value='' size=50></input></td>
<td>V06 <input type='text' name='V06' class='coderunner-ui-element' value='' size=50></input></td>
</tr><tr>
<td>N07 <input type='text' name='N07' class='coderunner-ui-element' value='' size=50></input></td>
<td>V07 <input type='text' name='V07' class='coderunner-ui-element' value='' size=50></input></td>
</tr><tr>
<td>N08 <input type='text' name='N08' class='coderunner-ui-element' value='' size=50></input></td>
<td>V08 <input type='text' name='V08' class='coderunner-ui-element' value='' size=50></input></td>
</tr><tr>
<td>N09 <input type='text' name='N09' class='coderunner-ui-element' value='' size=50></input></td>
<td>V09 <input type='text' name='V09' class='coderunner-ui-element' value='' size=50></input></td>
</tr></table>
</p>
<div><pre></div>]]></globalextra>
<useace></useace>
<resultcolumns></resultcolumns>
<template><![CDATA[import json
# Get answer.
answerString= """{{ STUDENT_ANSWER | e('py') }}"""
answerDict= json.loads(answerString)
results,n= {},0
while True:
dd= '{:02d}'.format(n)
name= answerDict['N'+dd][0]
if name=='': break
value= answerDict['V'+dd][0]
results[name]= json.loads(value)
n+= 1
print(json.dumps(results))
]]></template>
<iscombinatortemplate></iscombinatortemplate>
<allowmultiplestdins></allowmultiplestdins>
<answer></answer>
<validateonsave>1</validateonsave>
<testsplitterre></testsplitterre>
<language></language>
<acelang></acelang>
<sandbox></sandbox>
<grader>TemplateGrader</grader>
<cputimelimitsecs></cputimelimitsecs>
<memlimitmb></memlimitmb>
<sandboxparams></sandboxparams>
<templateparams></templateparams>
<hoisttemplateparams>1</hoisttemplateparams>
<twigall>0</twigall>
<uiplugin>html</uiplugin>
<attachments>0</attachments>
<attachmentsrequired>0</attachmentsrequired>
<maxfilesize>10240</maxfilesize>
<filenamesregex></filenamesregex>
<filenamesexplain></filenamesexplain>
<displayfeedback>1</displayfeedback>
<testcases>
</testcases>
</question>
</quiz>