QuestionTemplate.htm 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ********** 模板入口 *************
  2. {#template MAIN}
  3. {#include questionBuilder root=$T}
  4. {#/template MAIN}
  5. ********** 创建题干和答案模板 *********
  6. {#template questionBuilder}
  7. <div class="question-type">{$T.typeName}</div>
  8. <div class="questioncontainer">
  9. {#if $T.base_question_type_id == 1}
  10. {currentIndex}.&nbsp;&nbsp;{$T.content}&nbsp;<font color='red'>({$T.score}分)</font></div>
  11. {#include questionImg root=$T}
  12. <div class="answercontainer">
  13. {#foreach $T.Answers as a}
  14. <div class="ae">
  15. <span class="answers"><input type="radio" id="{$T.a.provid_answer_id}" value="{$T.a.provid_answer_id}" name="st-radio-{$T.base_question_type_id}-{$T.test_question_Id}" onclick='Check_rad(this,"{$T.a.provid_answer_id}","{$T.test_question_Id}");' />
  16. <label for='{$T.a.provid_answer_id}'>{$T.a.answer_name}</label>{#include answerImg root=$T.a}</span>
  17. </div>
  18. {#/for}
  19. </div>
  20. {#elseif $T.base_question_type_id == 2}
  21. {currentIndex}.&nbsp;&nbsp;{transformMuilte($T.base_question_type_id,$T.typeName,$T)}&nbsp;<font color='red'>({$T.score}分)</font></div>
  22. {#include questionImg root=$T}
  23. {#elseif $T.base_question_type_id == 3}
  24. {currentIndex}.&nbsp;&nbsp;{$T.content}&nbsp;<font color='red'>({$T.score}分)</font></div>
  25. {#include questionImg root=$T}
  26. <div class="answercontainer">
  27. {#foreach $T.Answers as a}
  28. <div class="ae">
  29. <input type="checkbox" id="{$T.a.provid_answer_id}" value="{$T.a.provid_answer_id}" name="st-{$T.base_question_type_id}-{$T.test_question_Id}" onclick="Check_chk(this,'st-{$T.base_question_type_id}-{$T.test_question_Id}','{$T.a.provid_answer_id}','{$T.test_question_Id}');"/>
  30. <label for='{$T.a.provid_answer_id}'>{$T.a.answer_name}</label>{#include answerImg root=$T.a}
  31. </div>
  32. {#/for}
  33. </div>
  34. {#elseif $T.base_question_type_id == 4}
  35. {currentIndex}.&nbsp;&nbsp;{$T.content}&nbsp;<font color='red'>({$T.score}分)</font></div>
  36. {#include questionImg root=$T}
  37. <div class="answercontainer">
  38. {#foreach $T.Answers as a}
  39. <div class="ae">
  40. <span class="answer"><input type="radio" id="{$T.a.provid_answer_id}" value="{$T.a.provid_answer_id}" name="st-{$T.base_question_type_id}-{$T.test_question_Id}" onclick='Check_rad(this,"{$T.a.provid_answer_id}","{$T.test_question_Id}");' />
  41. <label for='{$T.a.provid_answer_id}'>{$T.a.answer_name}</label>{#include answerImg root=$T.a}</span>
  42. </div>
  43. {#/for}
  44. <div style="clear:both;"></div>
  45. </div>
  46. {#elseif $T.base_question_type_id == 5}
  47. {currentIndex}.&nbsp;&nbsp;{$T.content}&nbsp;<font color='red'>({$T.score}分)</font></div>
  48. {#include questionImg root=$T}
  49. <div class="answercontainer">
  50. <textarea questionid='{$T.question_id}' style='WIDTH:90%;HEIGHT:100px' name='ST-{$T.base_question_type_id}-{$T.test_question_Id}'
  51. onblur='Check_area(this,"{$T.Answers[0].provid_answer_id}","{$T.test_question_Id}");'></textarea>
  52. </div>
  53. {#/if}
  54. <div id="rightAnswerContainer">参考答案为: <span id="refAnswer"></span></div>
  55. {#/template questionBuilder}
  56. {#template questionImg}
  57. {#if $T.hasImg}
  58. <div>
  59. <img src="{fileServerUrl + $T.url}" width="250px" style="cursor:pointer;margin-left:15px;" />
  60. </div>
  61. {#/if}
  62. {#/template questionImg}
  63. {#template answerImg}
  64. {#if $T.hasImg}
  65. <div>
  66. <img src="{fileServerUrl + $T.url}" width="250px" style="cursor:pointer;margin-left:15px;" />
  67. </div>
  68. {#/if}
  69. {#/template answerImg}