Skip to content

Commit 31f00b4

Browse files
committed
Added mcqs
1 parent e84f109 commit 31f00b4

File tree

4 files changed

+223
-11
lines changed

4 files changed

+223
-11
lines changed

app.py

+27-3
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,35 @@ def home():
103103
return render_template("home.html",fname=fname,lab1=str(lab1),lab2=str(lab2))
104104

105105

106-
@app.route("/expa1")
106+
@app.route("/expa1", methods = ["GET", "POST"])
107107
@login_required
108108
def expa1():
109-
return render_template("expa1.html")
110-
109+
if request.method == "GET":
110+
return render_template("expa1.html")
111+
else:
112+
points=0
113+
ans1 = int(request.form.get("qn1"))
114+
ans2 = int(request.form.get("qn2"))
115+
ans3 = int(request.form.get("qn3"))
116+
ans4 = int(request.form.get("qn4"))
117+
ans5 = int(request.form.get("qn5"))
118+
if ans1 == 2:
119+
points+=2
120+
if ans2 == 3:
121+
points+=2
122+
if ans3 == 4:
123+
points+=2
124+
if ans4 == 1:
125+
points+=2
126+
if ans5 == 2:
127+
points+=2
128+
if points > 6:
129+
db.execute("UPDATE users SET lab1=:lab1 WHERE id=:cid", lab1=1, cid=session["user_id"])
130+
flash("You have successfully completed Experiment1 of Mechanical.")
131+
return redirect("/home")
132+
else:
133+
flash("You did not score sufficient points, try again later.")
134+
return redirect("/home")
111135

112136
@app.route("/expa2")
113137
@login_required

maindb.db

0 Bytes
Binary file not shown.

templates/expa1.html

+195-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{% extends "ollayout.html" %}
22
{% block main %}
33
<br/><br/>
4+
<style>
5+
.row {
6+
display:flex;
7+
}
8+
.column {
9+
flex: 50%
10+
}
11+
</style>
412
<h1 class="display-5" style="text-align: center; color:dodgerblue;">Mechanical Engineering Workshop</h1>
513
<h1 style="color: steelblue; text-align: center;">Experiment 1: Carpentry</h1>
614
<br/>
@@ -13,10 +21,15 @@ <h2> <strong>Tools Required:</strong>
1321
<iframe title="A 3D model" width="640" height="480" src="https://sketchfab.com/models/c8e3f42e592c4addad281fed0cca95a9/embed?autostart=0&amp;camera=0&amp;ui_controls=1&amp;ui_infos=1&amp;ui_inspector=1&amp;ui_stop=1&amp;ui_watermark=1&amp;ui_watermark_link=1" frameborder="0" allow="autoplay; fullscreen; vr" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
1422
</div>
1523
<br/>
16-
<p style="font-size: 25px;">Bench-vice</p>
24+
<p style="font-size: 25px;">Chisel</p>
1725
<div class="sketchfab-embed-wrapper">
18-
<iframe title="A 3D model" width="640" height="480" src="https://go.echoar.xyz/e35X" frameborder="0" allow="autoplay; fullscreen; vr" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
19-
</div>
26+
<iframe title="A 3D model" width="640" height="480" src="https://sketchfab.com/models/e93e7dbbe1724a309b725d5acc254334/embed?autostart=0&amp;ui_controls=1&amp;ui_infos=1&amp;ui_inspector=1&amp;ui_stop=1&amp;ui_watermark=1&amp;ui_watermark_link=1" frameborder="0" allow="autoplay; fullscreen; vr" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
27+
</div>
28+
<br/>
29+
<p style="font-size: 25px;">Rasp file</p>
30+
<div class="sketchfab-embed-wrapper">
31+
<iframe title="A 3D model" width="640" height="480" src="https://sketchfab.com/models/7f8102d911b74fa7903bebb667d9fc68/embed?autostart=0&amp;ui_controls=1&amp;ui_infos=1&amp;ui_inspector=1&amp;ui_stop=1&amp;ui_watermark=1&amp;ui_watermark_link=1" frameborder="0" allow="autoplay; fullscreen; vr" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
32+
</div>
2033
<br/><br/>
2134
<h2> <strong>Procedure:</strong> <br/> <br/> <span style="font-size: 25px;">1. Fix the wooden block firmly on the carpenter's vice.</span> <br/> <span style="font-size: 25px;">2. Cut it into the required length using steel rule and pencil.</span> <br/> <span style="font-size: 25px;">3. Fix the block on bench vice and using the hacksaw, divide it into 2 pieces through the middle.</span> <br/> <span style="font-size: 25px;">4. Using hacksaw, carefully cut away excess portions from the two pieces to be obtained.</span> <br/> <span style="font-size: 25px;">5. Using the file, file away the excess portions and smoothen the edges till required dimensions are obtained.</span></h2>
2235
<br/>
@@ -25,4 +38,183 @@ <h2> <strong>Procedure:</strong> <br/> <br/> <span style="font-size: 25px;">1. F
2538
</center>
2639
<br/><br/>
2740
<h2> <strong>Result:</strong> <span style="font-size: 25px;">A plane wooden block of required dimensions is obtained.</span></h2>
41+
<br/><br/>
42+
<h1 style="text-align: center;">Assessment</h1>
43+
<br/<br/>
44+
<form action="/expa1" method="post">
45+
<br/<br/>
46+
<h3>1) Which tool was used to fix the wooden block?</h3>
47+
<br/>
48+
<div class="row">
49+
<div class="column">
50+
<div class="form-check">
51+
<input class="form-check-input" type="radio" name="qn1" id="exampleRadios1" value="1">
52+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
53+
Bench vice
54+
</label>
55+
</div>
56+
<br/>
57+
<div class="form-check">
58+
<input class="form-check-input" type="radio" name="qn1" id="exampleRadios1" value="2">
59+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
60+
Carpenter's vice
61+
</label>
62+
</div>
63+
<br/>
64+
<div class="form-check">
65+
<input class="form-check-input" type="radio" name="qn1" id="exampleRadios1" value="3">
66+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
67+
Wheel brace
68+
</label>
69+
</div>
70+
<br/>
71+
<div class="form-check">
72+
<input class="form-check-input" type="radio" name="qn1" id="exampleRadios1" value="4">
73+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
74+
Ratchet Brace
75+
</label>
76+
</div>
77+
</div>
78+
</div>
79+
<br/<br/><br/><br/>
80+
<h3>2) Which tool is used to check the trueness of planed surface?</h3>
81+
<br/>
82+
<div class="row">
83+
<div class="column">
84+
<div class="form-check">
85+
<input class="form-check-input" type="radio" name="qn2" id="exampleRadios1" value="1">
86+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
87+
Marking gauge
88+
</label>
89+
</div>
90+
<br/>
91+
<div class="form-check">
92+
<input class="form-check-input" type="radio" name="qn2" id="exampleRadios1" value="2">
93+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
94+
Mortise chisel
95+
</label>
96+
</div>
97+
<br/>
98+
<div class="form-check">
99+
<input class="form-check-input" type="radio" name="qn2" id="exampleRadios1" value="3">
100+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
101+
Try square
102+
</label>
103+
</div>
104+
<br/>
105+
<div class="form-check">
106+
<input class="form-check-input" type="radio" name="qn2" id="exampleRadios1" value="4">
107+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
108+
Bevel
109+
</label>
110+
</div>
111+
</div>
112+
</div>
113+
<br/<br/><br/><br/>
114+
<h3>3) The bottom face of wooden jack plane is called?</h3>
115+
<br/>
116+
<div class="row">
117+
<div class="column">
118+
<div class="form-check">
119+
<input class="form-check-input" type="radio" name="qn3" id="exampleRadios1" value="1">
120+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
121+
Base
122+
</label>
123+
</div>
124+
<br/>
125+
<div class="form-check">
126+
<input class="form-check-input" type="radio" name="qn3" id="exampleRadios1" value="2">
127+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
128+
Mouth
129+
</label>
130+
</div>
131+
<br/>
132+
<div class="form-check">
133+
<input class="form-check-input" type="radio" name="qn3" id="exampleRadios1" value="3">
134+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
135+
Stock
136+
</label>
137+
</div>
138+
<br/>
139+
<div class="form-check">
140+
<input class="form-check-input" type="radio" name="qn3" id="exampleRadios1" value="4">
141+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
142+
Sole
143+
</label>
144+
</div>
145+
</div>
146+
</div>
147+
<br/<br/><br/><br/>
148+
<h3>4) Which type of file is used in wood work ?</h3>
149+
<br/>
150+
<div class="row">
151+
<div class="column">
152+
<div class="form-check">
153+
<input class="form-check-input" type="radio" name="qn4" id="exampleRadios1" value="1">
154+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
155+
Rasp file
156+
</label>
157+
</div>
158+
<br/>
159+
<div class="form-check">
160+
<input class="form-check-input" type="radio" name="qn4" id="exampleRadios1" value="2">
161+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
162+
Half-round file
163+
</label>
164+
</div>
165+
<br/>
166+
<div class="form-check">
167+
<input class="form-check-input" type="radio" name="qn4" id="exampleRadios1" value="3">
168+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
169+
Round file
170+
</label>
171+
</div>
172+
<br/>
173+
<div class="form-check">
174+
<input class="form-check-input" type="radio" name="qn4" id="exampleRadios1" value="4">
175+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
176+
None of the above
177+
</label>
178+
</div>
179+
</div>
180+
</div>
181+
<br/<br/><br/><br/>
182+
<h3>5) Which among the following is used for striking as well as for pulling the nails from the wood?</h3>
183+
<br/>
184+
<div class="row">
185+
<div class="column">
186+
<div class="form-check">
187+
<input class="form-check-input" type="radio" name="qn5" id="exampleRadios1" value="1">
188+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
189+
Ball peen hammer
190+
</label>
191+
</div>
192+
<br/>
193+
<div class="form-check">
194+
<input class="form-check-input" type="radio" name="qn5" id="exampleRadios1" value="2">
195+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
196+
Claw hammer
197+
</label>
198+
</div>
199+
<br/>
200+
<div class="form-check">
201+
<input class="form-check-input" type="radio" name="qn5" id="exampleRadios1" value="3">
202+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
203+
Cross peen hammer
204+
</label>
205+
</div>
206+
<br/>
207+
<div class="form-check">
208+
<input class="form-check-input" type="radio" name="qn5" id="exampleRadios1" value="4">
209+
<label style="font-size: 18px;" class="form-check-label" for="exampleRadios1">
210+
Mallet
211+
</label>
212+
</div>
213+
</div>
214+
</div>
215+
<br/><br/>
216+
<center>
217+
<button class="btn btn-outline-success" type="submit">Submit</button>
218+
</center>
219+
</form>
28220
{% endblock %}

templates/home.html

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ <h1 style="color: steelblue; text-align: center;">Your workshops</h1>
1414
<h1 class="display-5">Mechanical Engineering Workshop</h1>
1515
<hr class="my-4">
1616
<p style="font-size: 26px; color: teal">Progress: {{lab1}} / 2 experiments completed</p>
17-
{% if lab1 == 1 %}
17+
{% if lab1 %}
1818
<div class="progress">
1919
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 50%"></div>
2020
</div>
21-
{% elif lab1 == 2 %}
22-
<div class="progress">
23-
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>
24-
</div>
2521
{% else %}
2622
<div class="progress">
2723
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>

0 commit comments

Comments
 (0)