ViewPaperTemplate.htm 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. {#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}{transform2($T.t,$T.q)}</div>
  29. {#include questionImg root=$T.q}
  30. <div>参考答案:{ShowAnswer2($T.q.rightAnswer,$T.q.answers)}</div>
  31. {#elseif $T.t.name == "多选题"}
  32. {#include sign root=$T.q.question_id}
  33. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  34. {#include questionImg root=$T.q}
  35. <div class="answercontainer">
  36. {#foreach ReplaceFirstChar(prepareAnswers($T.q.answers)) as a}
  37. <div class="answers">
  38. <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()" />
  39. <label for='{$T.a.answer_id}'>{$T.a.content}</label>{#include answerImg root=$T.a}</span>
  40. </div>
  41. {#/for}
  42. <div>参考答案:{ShowAnswerSelect($T.q.rightAnswer,$T.q.answers)}</div>
  43. <div style="clear:both;"></div>
  44. </div>
  45. {#elseif $T.t.name == "是非题"}
  46. {#include sign root=$T.q.question_id}
  47. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  48. {#include questionImg root=$T.q}
  49. <div class="answercontainer">
  50. {#foreach ($T.q.answers) as a}
  51. <div class="answers">
  52. <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}");' />
  53. <label for='{$T.a.answer_id}'>{$T.a.content}</label>{#include answerImg root=$T.a}</span>
  54. </div>
  55. {#/for}
  56. </div>
  57. {#elseif $T.t.name == "简答题"}
  58. {#include sign root=$T.q.question_id}
  59. <font color='red'>({$T.q.score}分)</font>&nbsp;{$P.st = $P.st + 1}{#include casual root=$T.t}{$T.q.content}</div>
  60. {#include questionImg root=$T.q}
  61. <div class="answercontainer">
  62. <textarea questionid='{$T.q.question_id}' answertype='{$T.t.name}' style='WIDTH:90%;HEIGHT:100px' name='ST-{$T.t.id}-{$T.q.question_id}'
  63. onblur='behaviour.Check_area(this,"{$T.q.answers.answer_id}","{$T.q.question_id}");'></textarea>
  64. </div>
  65. {#/if}
  66. {#/for}
  67. {#/for}
  68. </div>
  69. {#/template questionBuilder}
  70. {#template sign}
  71. {#/template sign}
  72. {#template casual}
  73. .&nbsp;&nbsp;
  74. {#/template casual}
  75. {#template checkComplate}
  76. {#if $T==1}{#/if}
  77. {#/template checkComplate}
  78. {#template questionImg}
  79. {#if $T.hasImg==1}
  80. <div style="padding-left:80px">
  81. <img src="{examinee.fileServerUrl + $T.url}" title="{$T.note}" width="150px" onclick="radopen('{examinee.fileServerUrl + $T.url}','showImg')" style="cursor:pointer;" />
  82. </div>
  83. {#/if}
  84. {#/template questionImg}
  85. {#template answerImg}
  86. {#if $T.hasImg==1}
  87. <div style="padding-left:30px">
  88. <img src="{examinee.fileServerUrl + $T.url}" title="{$T.note}" width="150px" onclick="radopen('{examinee.fileServerUrl + $T.url}','showImg')" style="cursor:pointer;" />
  89. </div>
  90. {#/if}
  91. {#/template answerImg}