tiki-take_quiz.tpl 1.98 KB
Newer Older
1
<!- templates/tiki-take_quiz.tpl start ->
2
<form enctype="multipart/form-data" name="aform" action="tiki-take_quiz.php" method="post">
3 4
<input type="hidden" name="quizId" value="{$quizId|escape}" />
<input id='timeleft' name="timeleft" type="hidden" value={$quiz_info.timeLimitsec} /><br />
lrargerich's avatar
lrargerich committed
5
{if $quiz_info.timeLimited eq 'y'}
changi67's avatar
changi67 committed
6
{tr}Time Left:{/tr}<input id='minleft' name="minleft" type="text" size="3" value=0 />:<input size="3" id='secleft' name="secleft" type="text" value=0 />
lrargerich's avatar
lrargerich committed
7 8 9 10
{/if}

{if $ans eq 'n'}
{if $quiz_info.timeLimited eq 'y'}
11
{jq}
lrargerich's avatar
lrargerich committed
12 13 14 15 16 17 18 19 20 21 22 23
var itid;
function settimeleft() {
  document.getElementById('timeleft').value -= 1;
  if(document.getElementById('timeleft').value<1) {
    window.clearInterval(itid); 
    document.aform.submit();
  }
  document.getElementById('minleft').value = Math.floor(document.getElementById('timeleft').value/60);
  document.getElementById('secleft').value = document.getElementById('timeleft').value%60; 
}
itid = window.setInterval('settimeleft();',1000); 
settimeleft(itid);
24
{/jq}
lrargerich's avatar
lrargerich committed
25 26 27
{/if}
{/if}

chealer's avatar
chealer committed
28
<h2>{$quiz_info.name|escape}</h2>
29
<div class="description">{$quiz_info.description|escape}</div>
lrargerich's avatar
lrargerich committed
30 31 32
{if $ans eq 'n'}
{section name=ix loop=$questions}
<div class="questionblock">
chealer's avatar
chealer committed
33
<div class="quizquestion">{$questions[ix].question|escape}</div>
lrargerich's avatar
lrargerich committed
34 35
<div class="quizoptions">
  {section name=jx loop=$questions[ix].options}
chealer's avatar
chealer committed
36
  <input type="radio" value="{$questions[ix].options[jx].optionId|escape}" name="question_{$questions[ix].questionId}" />{$questions[ix].options[jx].optionText|escape}<br />
lrargerich's avatar
lrargerich committed
37 38
  {/section}
</div>  
39
{if $questions[ix].type eq "f" }
40
<br />
41
<div class="quizupload">
42
Supporting Documentation: <input name="question_upload_{$questions[ix].questionId}" type="file" />
43 44
</div>
{/if}
lrargerich's avatar
lrargerich committed
45 46
</div>  
{/section}
47
<input type="submit" value="{tr}Send Answers{/tr}" name="ans" />
lrargerich's avatar
lrargerich committed
48 49
{/if}
{if $ans eq 'y'}
changi67's avatar
changi67 committed
50
{tr}Result:{/tr}
lrargerich's avatar
lrargerich committed
51
<div class="quizanswer">
52
{if $result.answer}
chealer's avatar
chealer committed
53
{$result.answer|escape|nl2br}
54 55 56
{else}
{tr}Thank you for your submission{/tr}.
{/if}
lrargerich's avatar
lrargerich committed
57 58
</div>
{/if}
59
</form>
60
<!- templates/tiki-take_quiz.tpl end ->