Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <problem>
- <text>
- <p>
- <h4>Problema Con Consejo Adaptativo</h4>
- </p>
- <p>
- Este Problema demuestra una pregunta con consejos, basados usando el método <tt class="tt">hintfn</tt>.</p>
- <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 'java' in ans:
- hint = 'ese es bueno solo para beber'
- elif 'perl' in ans:
- hint = 'no ese rico'
- elif 'pascal' in ans:
- hint = 'ese es un lenguaje bohemio'
- elif 'fortran' in ans:
- hint = 'esos fueron buenos días'
- elif 'clu' in ans:
- hint = 'debes ser invariante'
- if hint:
- hint = "<font color='blue'>Hint: {0}</font>".format(hint)
- new_cmap.set_hint_and_mode(aid,hint,'always')
- </script>
- <label>
- ¿Cuál es el mejor lenguaje de programación que existe hoy en día? Puedes ingrear la respuesta en mayúsculas o minúsculas, con o sin comillas.
- <customresponse cfn="test_str" expect="python">
- <textline correct_answer="python"/>
- <hintgroup hintfn="hint_fn"/>
- </customresponse>
- </label>
- </text>
- </problem>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement