Computed answers are run through safe_exec.

This commit is contained in:
Ned Batchelder
2013-02-14 13:15:29 -05:00
parent 37ca6bf77e
commit a6677aa0a8
3 changed files with 20 additions and 2 deletions

View File

@@ -92,6 +92,20 @@ print(num)
</text>
</problem>
<problem url_name="computed_answer">
<customresponse>
<textline size="5" correct_answer="Xyzzy"/>
<answer type="loncapa/python">
if submission[0] == "Xyzzy":
correct = ['correct']
else:
correct = ['incorrect']
</answer>
</customresponse>
</problem>
</vertical>
</chapter>
</course>