PaperTemplate.htm 5.2 KB

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