Skip to content

Commit 09fb6de

Browse files
add summary page
1 parent 6ed0be5 commit 09fb6de

2 files changed

Lines changed: 61 additions & 4 deletions

File tree

view/_exam.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<style type="text/css">
2-
32
.data-choice{
43
text-align: left;
54
}
@@ -59,13 +58,18 @@ <h3 id="timer" style="padding-left: 10px; color: #63b359;">Time 10: 10</h3>
5958
var lblDisplayNo = $('#lblDisplayNo');
6059
var btnNext = $('#btnNext');
6160

62-
var countDownDate = new Date("Sep 15, 2017 00:50:00").getTime();
61+
var questionId = '00001';
62+
var n = '10';
63+
var nTotal = '';
64+
65+
var countDownDate = new Date("Sep 15, 2018 21:50:00").getTime();
6366

6467
$(function() {
65-
$.post('api/api_exam.php?GET_QUESTION', { token: 'test', questionId: '00001', questionNo: '10' }).done(function(data) {
68+
$.post('api/api_exam.php?GET_QUESTION', { token: 'test', questionId: questionId, questionNo: n }).done(function(data) {
6669
data = $.parseJSON(data);
6770
question.html(data.question);
6871
lblDisplayNo.html(data.n+' / '+data.nTotal);
72+
6973
$.each(data.choices, function(index, val) {
7074
$('#'+index).html(val)
7175
});
@@ -84,14 +88,17 @@ <h3 id="timer" style="padding-left: 10px; color: #63b359;">Time 10: 10</h3>
8488
btnNext.click(function(){
8589
$.post('api/api_exam.php?SEND_ANSWER', { token: 'test' }).done(function(data) {
8690
});
91+
92+
$.post('api/api_exam.php?SEND_ANSWER', { token: 'test' }).done(function(data) {
93+
});
8794
});
8895

8996
btnPrevious.click(function(){
9097

9198
});
9299

93100
function BlockUI(){
94-
$.blockUI({ message : '<h3>หมดเวลา<br><br>ระบบกำลังส่งคำตอบ <br><br> โปรดรอสักครู่ .... </h3>',
101+
$.blockUI({ message : '<h3>หมดเวลา<br><br>ระบบกำลังส่งคำตอบ<br><br> โปรดรอสักครู่ .... </h3>',
95102
css: {
96103
width:'80%',
97104
left:'10%',

view/_summary.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
3+
<div class="row">
4+
<div class="col-md-9" id="exam"> </div>
5+
<div class="col-md-3">
6+
<h2>ผลสอบ</h2>
7+
<h2>หมวด xxxx, บท .....</h2>
8+
<h2>Username : XXXXX</h2>
9+
<h2>Result : 10/20</h2>
10+
<hr>
11+
<div class="table-responsive table-bordered">
12+
<table class="table">
13+
<thead>
14+
<tr>
15+
<th>xxxxxx</th>
16+
<th>xxxxxx</th>
17+
<th>xxxxxx</th>
18+
<th>xxxxxx</th>
19+
<th>xxxxxx</th>
20+
</tr>
21+
</thead>
22+
<tbody>
23+
<tr>
24+
<td>xxxxxx</td>
25+
<td>xxxxxx</td>
26+
<td>xxxxxx</td>
27+
<td>xxxxxx</td>
28+
<td>xxxxxx</td>
29+
</tr>
30+
</tbody>
31+
</table>
32+
</div>
33+
<hr>
34+
<div class="progress">
35+
<div class="progress-bar progress-bar-success" role="progressbar" style="width:50%">
36+
50
37+
</div>
38+
<div class="progress-bar progress-bar-danger" role="progressbar" style="width:50%">
39+
50
40+
</div>
41+
</div>
42+
</div>
43+
</div>
44+
45+
<script type="text/javascript">
46+
var exam = $('#exam')
47+
48+
exam.load('view/_exam.html');
49+
50+
</script>

0 commit comments

Comments
 (0)