QuestionTemplate.htm 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. ********** 模板入口 *************
  2. {#template MAIN}
  3. {#include questionBuilder root=$T}
  4. {#/template MAIN}
  5. ********** 创建题干和答案模板 *********
  6. {#template questionBuilder}
  7. {#param name=st value=0}
  8. {#foreach $T as t}
  9. {#foreach prepareQuestions($T.t.id,$T.t.questions) as q}
  10. <div id="q_{$T.q.question_id}" class="q_container" {#if $P.st != 0} style="display:none;" {#/if}>
  11. <div class="singleQuestionContainer">
  12. <div class="questioncontainer">
  13. <div class="question-title">{$T.t.name}</div>
  14. {#if $T.t.name == "单选题"}
  15. {#include sign root=$T.q.question_id}
  16. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  17. {#include questionImg root=$T.q}
  18. <div class="answercontainer">
  19. {#foreach ReplaceFirstChar(prepareAnswers($T.q.answers)) as a}
  20. <div class="answers">
  21. <span><input type="radio" id="{$T.a.answer_id}" {GetCheckAnswer($T.q.question_id,$T.a.answer_id)} value="{$T.a.answer_id}" name="st-{$T.t.id}-{$T.q.question_id}" onclick='behaviour.Check_rad(this,"{$T.a.answer_id}","{$T.q.question_id}");ChecComplate()' />
  22. <label for='{$T.a.answer_id}'>{$T.a.content}</label>{#include answerImg root=$T.a}</span>
  23. </div>
  24. {#/for}
  25. </div>
  26. {#elseif $T.t.name == "填空题"}
  27. {#include sign root=$T.q.question_id}
  28. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{transformMuilte($T.t,$T.q)}</div>
  29. {#include questionImg root=$T.q}
  30. {#elseif $T.t.name == "多选题"}
  31. {#include sign root=$T.q.question_id}
  32. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  33. {#include questionImg root=$T.q}
  34. <div class="answercontainer">
  35. {#foreach ReplaceFirstChar(prepareAnswers($T.q.answers)) as a}
  36. <div class="answers">
  37. <span><input type="checkbox" id="{$T.a.answer_id}" {GetCheckAnswer($T.q.question_id,$T.a.answer_id)} value="{$T.a.answer_id}" name="st-{$T.t.id}-{$T.q.question_id}" onclick="behaviour.Check_chk(this,'st-{$T.t.id}-{$T.q.question_id}','{$T.a.answer_id}','{$T.q.question_id}');ChecComplate()" />
  38. <label for='{$T.a.answer_id}'>{$T.a.content}</label>{#include answerImg root=$T.a}</span>
  39. </div>
  40. {#/for}
  41. <div style="clear:both;"></div>
  42. </div>
  43. {#elseif $T.t.name == "是非题"}
  44. {#include sign root=$T.q.question_id}
  45. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  46. {#include questionImg root=$T.q}
  47. <div class="answercontainer">
  48. {#foreach ($T.q.answers) as a}
  49. <div class="answers">
  50. <span><input type="radio" id="{$T.a.answer_id}" {GetCheckAnswer($T.q.question_id,$T.a.answer_id)} value="{$T.a.answer_id}" name="st-{$T.t.id}-{$T.q.question_id}" onclick='behaviour.Check_rad(this,"{$T.a.answer_id}","{$T.q.question_id}");' />
  51. <label for='{$T.a.answer_id}'>{$T.a.content}</label>{#include answerImg root=$T.a}</span>
  52. </div>
  53. {#/for}
  54. <div style="clear:both;"></div>
  55. </div>
  56. {#elseif $T.t.name == "简答题"}
  57. {#include sign root=$T.q.question_id}
  58. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  59. {#include questionImg root=$T.q}
  60. <div class="answercontainer">
  61. <textarea questionid='{$T.q.question_id}' answertype='{$T.t.name}' style='WIDTH:90%;HEIGHT:100px' name='ST-{$T.t.id}-{$T.q.question_id}'
  62. onblur='behaviour.Check_area(this,"{$T.q.answers.answer_id}","{$T.q.question_id}");'></textarea>
  63. </div>
  64. {#/if}
  65. <div class="buttonContainer">
  66. <div class="leftButtonContainer"><input type="button" value="上一题" class="longbutton" {#if $P.st == 1} style="display:none" {#/if} onclick=" PreBtnEvent(this);" /></div>
  67. <div class="rightButtonContainer"><input type="button" value="下一题" class="longbutton" {#if $P.st == examInfo.questionCount} style="display:none" {#/if} onclick="NextBtnEvent(this);" /></div>
  68. <div class="box"></div>
  69. </div>
  70. </div>
  71. </div>
  72. {#/for}
  73. {#/for}
  74. {#/template questionBuilder}
  75. {#template sign}
  76. <input type='button' value=' 标识 ' class='btn_sign' author='{$T}' />&nbsp;<br />
  77. {#/template sign}
  78. {#template casual}
  79. .&nbsp;&nbsp;
  80. {#/template casual}
  81. {#template checkComplate}
  82. {#if $T==1}{#/if}
  83. {#/template checkComplate}
  84. {#template questionImg}
  85. {#if $T.hasImg==1}
  86. <div style="padding-left:80px">
  87. <img src="{examinee.fileServerUrl + $T.url}" title="{$T.note}" width="150px" onclick="radopen('{examinee.fileServerUrl + $T.url}','showImg')" style="cursor:pointer;" />
  88. </div>
  89. {#/if}
  90. {#/template questionImg}
  91. {#template answerImg}
  92. {#if $T.hasImg==1}
  93. <div style="padding-left:30px">
  94. <img src="{examinee.fileServerUrl + $T.url}" title="{$T.note}" width="150px" onclick="radopen('{examinee.fileServerUrl + $T.url}','showImg')" style="cursor:pointer;" />
  95. </div>
  96. {#/if}
  97. {#/template answerImg}