I am facing issue in production. I tried to create a new question type. But after creating one adaptive hint questions. I am seeing this error. How i can resolve this issue. I have fresh Installation.
hi @Parvinkumar please test with this code, the example in the official documention has a problem based on the python version. Just pay attention to the code formatting and insertion.
<problem>
<text>
<script type="text/python" system_path="python_lib">
def test_str(expect, ans):
print (expect, ans)
ans = ans.strip("'")
ans = ans.strip('"')
return expect == ans.lower()
def hint_fn(answer_ids, student_answers, new_cmap, old_cmap):
aid = answer_ids[0]
ans = str(student_answers[aid]).lower()
print ('hint_fn called, ans=', ans)
hint = ''
if '0.05' in ans:
hint = 'Make sure you enter your answer in cents. and go to www.google.com'
if hint:
hint = "<font color='blue'>Hint: {0}</font>".format(hint)
new_cmap.set_hint_and_mode(aid,hint,'always')
</script>
<p>If a bat and a ball cost $1.10 together, and the bat costs $1.00 more than the
ball, how much does the ball cost? Enter your answer in cents, and include only
the number (that is, do not include a $ or a ยข sign).</p>
<p>
<p>based on 10.35.1. Create a Problem with an Adaptive Hint</p>
<customresponse cfn="test_str" expect="5">
<textline correct_answer="5" label="How much does the ball cost?"/>
<hintgroup hintfn="hint_fn"/>
</customresponse>
</p>
</text>
</problem>
@abstract-technology Thank you very much so kind of you.
@Parvinkumar works now?
@abstract-technology I am so sorry to for late reply but it is not working for your reference i am attaching screenshot https://www.screencast.com/t/Clr0ulvgOy7m
@abstract-technology I am so sorry to for late reply but it is not working for your reference.