-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
219 lines (191 loc) · 7.89 KB
/
Copy pathindex.html
File metadata and controls
219 lines (191 loc) · 7.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!DOCTYPE html>
<html lang="en" data-theme="light">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Java MCQ Quiz — Sanfoundry</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="topbar">
<div class="topbar-in">
<div class="brand">Java <span>MCQ</span> Quiz</div>
<nav class="nav-tabs">
<button class="tab on" id="tabQuiz">Quiz</button>
<button class="tab" id="tabTheory">Theory</button>
</nav>
<div class="spacer"></div>
<button class="icon-btn hide" id="btnQuit">Quit</button>
<button class="icon-btn" id="btnTheme">Dark</button>
</div>
</div>
<div class="wrap">
<!-- ============ START ============ -->
<section id="screenStart">
<div class="card">
<h1>Java Multiple Choice Questions</h1>
<p class="sub">The full Sanfoundry Java MCQ bank — questions, options and answers exactly as
published by Sanfoundry.</p>
<div class="stats">
<div class="stat"><b id="stTotal">0</b><span>Questions</span></div>
<div class="stat"><b id="stTopics">0</b><span>Topics</span></div>
<div class="stat"><b id="stCode">0</b><span>Code questions</span></div>
<div class="stat"><b id="stExp">0</b><span>Explanations</span></div>
</div>
<div class="field">
<label>Quick picks <span class="lbl-hint">sets the topics below in one click</span></label>
<div class="chips" id="presetChips"></div>
</div>
<div class="field">
<label>Category <span class="lbl-hint">click one to practise it on its own</span></label>
<div class="chips" id="catChips"></div>
</div>
<div class="field">
<label>Question type <span class="lbl-hint">code-output questions vs plain theory</span></label>
<div class="chips" id="typeChips"></div>
</div>
<div class="field">
<label>Topics <span class="lbl-hint" id="topicCount"></span></label>
<input type="search" id="topicSearch" placeholder="Filter topics…">
<div class="topic-box" id="topicBox"></div>
<div class="btn-row" style="margin-top:9px">
<button class="icon-btn" id="btnAllTopics">Select all</button>
<button class="icon-btn" id="btnNoTopics">Clear</button>
</div>
</div>
<div class="field">
<label>Number of questions</label>
<div class="chips" id="lenChips"></div>
</div>
<div class="field">
<label>Questions per page <span class="lbl-hint">scroll through a page, then load the next</span></label>
<div class="chips" id="pageChips"></div>
</div>
<div class="field">
<label>Mode</label>
<div class="chips" id="modeChips">
<button class="chip on" data-mode="practice">Practice — answer reveals instantly</button>
<button class="chip" data-mode="exam">Exam — score at the end</button>
</div>
</div>
<div class="field">
<label>Options</label>
<div class="switches">
<label class="switch"><input type="checkbox" id="optShuffleQ" checked> Shuffle questions</label>
<label class="switch"><input type="checkbox" id="optShuffleO"> Shuffle answer options</label>
<label class="switch"><input type="checkbox" id="optTimer"> Show timer</label>
</div>
</div>
<div class="btn-row">
<button class="btn" id="btnStart">Start quiz</button>
<span class="hint" id="startHint"></span>
</div>
</div>
</section>
<!-- ============ QUIZ (scrolling list) ============ -->
<section id="screenQuiz" class="hide">
<div class="quizbar" id="quizbar">
<div class="quizbar-in">
<span class="counter" id="qPageInfo"></span>
<span class="spacer"></span>
<span class="counter" id="qTimer"></span>
<span class="counter" id="qAnswered"></span>
</div>
<div class="progress"><i id="qProgress"></i></div>
</div>
<div id="qList"></div>
<div class="card pagenav">
<div class="btn-row">
<button class="btn ghost" id="btnPrevPage">← Previous page</button>
<button class="btn" id="btnNextPage">Next page →</button>
<button class="btn" id="btnFinish">Finish & see score</button>
<span class="hint" id="pageHint"></span>
</div>
</div>
</section>
<!-- ============ RESULTS ============ -->
<section id="screenResult" class="hide">
<div class="card">
<h1>Results</h1>
<div class="score-ring">
<div class="ring" id="ring"><div><b id="rsPct">0%</b><span id="rsGrade"></span></div></div>
<div class="tally">
<div class="stat"><b class="ok" id="rsOk">0</b><span>Correct</span></div>
<div class="stat"><b class="bad" id="rsBad">0</b><span>Wrong</span></div>
<div class="stat"><b id="rsSkip">0</b><span>Skipped</span></div>
<div class="stat"><b id="rsTime">—</b><span>Time</span></div>
</div>
</div>
<div class="btn-row">
<button class="btn" id="btnAgain">New quiz</button>
<button class="btn ghost" id="btnRetryWrong">Retry wrong only</button>
<button class="btn ghost" id="btnExport">Export results (.csv)</button>
</div>
</div>
<div class="card" id="cardBreakdown">
<h2>By topic</h2>
<div class="bars" id="rsBars"></div>
</div>
<div class="card">
<div class="qhead" style="margin-bottom:16px">
<h2 style="margin:0">Review</h2>
<span class="spacer"></span>
<button class="icon-btn" id="btnFilterAll">All</button>
<button class="icon-btn" id="btnFilterWrong">Wrong only</button>
</div>
<div id="rsReview"></div>
</div>
</section>
<!-- ============ THEORY ============ -->
<section id="screenTheory" class="hide">
<div class="card">
<h1>Theory questions</h1>
<p class="sub">Written-answer questions — not multiple choice. From your COS 202 course
companion, and from the “FAQs on …” sections of Sanfoundry's Java tutorials.</p>
<div class="stats">
<div class="stat"><b id="thCount">0</b><span>Theory Q&A</span></div>
<div class="stat"><b id="thCos">0</b><span>From COS 202</span></div>
<div class="stat"><b id="thPoints">0</b><span>Key points</span></div>
<div class="stat"><b id="thPred">0</b><span>Predicted code Qs</span></div>
</div>
<div class="field">
<label>Source</label>
<div class="chips" id="thSrcChips"></div>
</div>
<div class="field">
<label>Topic</label>
<div class="chips" id="thChips"></div>
</div>
<div class="btn-row">
<button class="btn ghost" id="thReveal">Reveal all answers</button>
<button class="btn ghost" id="thHide">Hide all</button>
<span class="hint" id="thHint"></span>
</div>
</div>
<div id="thList"></div>
<div class="card" id="thKeyCard">
<h2>Key points to remember</h2>
<div id="thKeys"></div>
</div>
<div class="card">
<div class="warnbox">
<b>Heads up — this last part is not from Sanfoundry.</b>
The 10 questions below were written as extra practice in the style of your syllabus.
Every answer was checked by actually compiling and running the code on JDK 21, so the
outputs are real — but the questions themselves are predictions, not published material.
</div>
<h2 style="margin-top:16px">Predicted code questions</h2>
<div id="thPredList"></div>
</div>
</section>
</div>
<div class="footer">
Questions, answers and explanations sourced from
<a href="https://www.sanfoundry.com/java-programming-questions-answers/" target="_blank" rel="noopener">Sanfoundry</a>
(via the Internet Archive). Educational use — all content belongs to Sanfoundry.
</div>
<script src="questions.js"></script>
<script src="theory.js"></script>
<script src="app.js"></script>
</body>
</html>