PaperTemplate.htm 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 $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;{$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($T.q.answers) as a}
  19. <div class="answers">
  20. <span><input type="radio" id="Radio1" {IsUserAnswer($T.q.question_id,$T.a.answer_id,$T.q.userAnswer)} 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. <div>参考答案:{ShowAnswerSelect($T.q.rightAnswer,$T.q.answers)}</div>
  26. <div>你的答案:{ShowAnswerSelect($T.q.userAnswer,$T.q.answers)}</div>
  27. <div>你的得分:<input type="text" style="width:30px" id="Text1" value="{$T.q.userscore}"></input></div>
  28. {#elseif $T.t.name == "填空题"}
  29. {#include sign root=$T.q.question_id}
  30. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{transform2($T.t,$T.q)}</div>
  31. {#include questionImg root=$T.q}
  32. <div>参考答案:{ShowAnswer2($T.q.rightAnswer,$T.q.answers)}</div>
  33. <div>你的答案:{ShowAnswer2($T.q.userAnswer,$T.q.answers)}</div>
  34. <div>你的得分:<input type="text" style="width:30px" id="txtScore" value="{$T.q.userscore}"></input></div>
  35. {#elseif $T.t.name == "多选题"}
  36. {#include sign root=$T.q.question_id}
  37. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  38. {#include questionImg root=$T.q}
  39. <div class="answercontainer">
  40. {#foreach ReplaceFirstChar(prepareAnswers($T.q.answers)) as a}
  41. <div class="answers">
  42. <span><input type="checkbox" id="{$T.a.answer_id}" {IsUserAnswer($T.q.question_id,$T.a.answer_id,$T.q.userAnswer)} 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()" />
  43. <label for='{$T.a.answer_id}'>{$T.a.content}</label>{#include answerImg root=$T.a}</span>
  44. </div>
  45. {#/for}
  46. <div>参考答案:{ShowAnswerSelect($T.q.rightAnswer,$T.q.answers)}</div>
  47. <div>你的答案:{ShowAnswerSelect($T.q.userAnswer,$T.q.answers)}</div>
  48. <div>你的得分:<input type="text" style="width:30px" id="Text2" value="{$T.q.userscore}"></input></div>
  49. <div style="clear:both;"></div>
  50. </div>
  51. {#elseif $T.t.name == "是非题"}
  52. {#include sign root=$T.q.question_id}
  53. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  54. {#include questionImg root=$T.q}
  55. <div class="answercontainer">
  56. {#foreach ($T.q.answers) as a}
  57. <div class="answers">
  58. <span><input type="radio" id="{$T.a.answer_id}" {IsUserAnswer($T.q.question_id,$T.a.answer_id,$T.q.userAnswer)} 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}");' />
  59. <label for='{$T.a.answer_id}'>{$T.a.content}</label>{#include answerImg root=$T.a}</span>
  60. </div>
  61. {#/for}
  62. </div>
  63. {#elseif $T.t.name == "简答题"}
  64. {#include sign root=$T.q.question_id}
  65. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  66. {#include questionImg root=$T.q}
  67. <div class="answercontainer">
  68. <textarea questionid='{$T.q.question_id}' answertype='{$T.t.name}' style='WIDTH:90%;HEIGHT:100px' name='ST-{$T.t.id}-{$T.q.question_id}'
  69. onblur='behaviour.Check_area(this,"{$T.q.answers.answer_id}","{$T.q.question_id}");'></textarea>
  70. </div>
  71. {#/if}
  72. {#/for}
  73. {#/for}
  74. </div>
  75. {#/template questionBuilder}
  76. {#template sign}
  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}