Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions src/lab/exp11/Quizzes.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<!-- Custom CSS -->
<link href="../../../css/style.css" rel="stylesheet">
<script type="text/javascript" src = 'tabs.js'></script>
<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-67020197-1', 'auto');ga('send', 'pageview');</script>
<script type="text/javascript" src = '../js/exp11/quiz_check.js'></script>
<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');ga('create', 'UA-67020197-1', 'auto');ga('send', 'pageview');</script>
</head>
<body id="page-top" class="index">
<div id="top">
Expand Down Expand Up @@ -102,36 +103,42 @@ <h1 class="text-h2-lightblue">Digital Signatures Scheme</h1><div class="content"
<ol>
<li>Digital signature can’t provide ______ for the message
<ol class="d">
<li><input name="quest_644" type="radio" value="Integrity "/>Integrity </li>
<li><input name="quest_644" type="radio" value="Integrity"/>Integrity </li>
<li><input name="quest_644" type="radio" value="Confidentiality"/>Confidentiality</li>
<li><input name="quest_644" type="radio" value="Non repudiation "/>Non repudiation </li>
<li><input name="quest_644" type="radio" value="Authentication "/>Authentication </li>
<li><input name="quest_644" type="radio" value="Non repudiation"/>Non repudiation </li>
<li><input name="quest_644" type="radio" value="Authentication"/>Authentication </li>
<p id="q1" style="display:none"></p>
</ol>
</li>
<li>Digital signature uses ______ for generating valid signature
<ol class="d">
<li>Private key </li>
<li>Public key</li>
<li>Secret key</li>
<li>None of the aboove</li>
<li><input name="quest_645" type="radio" value="Private key"/>Private key </li>
<li><input name="quest_645" type="radio" value="Public key"/>Public key</li>
<li><input name="quest_645" type="radio" value="Secret key"/>Secret key</li>
<li><input name="quest_645" type="radio" value="None of the above"/>None of the above</li>
<p id="q2" style="display:none"></p>
</ol>
</li>
<li>Verification Algorithm uses ______ for validating digital signature
<ol class="d">
<li>Private key </li>
<li>Public key</li>
<li>Secret key</li>
<li>None of the aboove</li>
<li><input name="quest_646" type="radio" value="Private key"/>Private key </li>
<li><input name="quest_646" type="radio" value="Public key"/>Public key</li>
<li><input name="quest_646" type="radio" value="Secret key"/>Secret key</li>
<li><input name="quest_646" type="radio" value="None of the above"/>None of the above</li>
<p id="q3" style="display:none"></p>
</ol>
</li>
<li>Is digital signature scheme possible without public key cryptography
<ol type="d">
<li>Yes </li>
<li>No</li>
<li>May be exist </li>
<li>None of the aboove</li>
<li><input name="quest_647" type="radio" value="Yes"/>Yes </li>
<li><input name="quest_647" type="radio" value="No"/>No</li>
<li><input name="quest_647" type="radio" value="May be"/>May be</li>
<li><input name="quest_647" type="radio" value="None of the above"/>None of the above</li>
<p id="q4" style="display:none"></p>
</ol>
</li>
<input type="button" value="Submit MCQ answers" onclick="gradeQuiz()"></input>
<br><br>
<li>
Explain importance of Hashing(using experiment)and explain why Hashing is needed ?
</li>
Expand Down
33 changes: 33 additions & 0 deletions src/lab/js/exp11/quiz_check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function checkAnswer(q_name, ans) {
var q = document.getElementsByName(q_name)
var valid = false
var i = 0
while (!valid && i < q.length) {
if(q[i].checked && i == (ans-1))
valid = true
i++
}
return valid
}

var question_id = new Array("quest_644", "quest_645", "quest_646", "quest_647")
var ans_id = new Array("q1", "q2", "q3", "q4")
var answers = new Array(2, 1, 1, 2);

function gradeQuiz() {
var i;
for(i=0; i<answers.length; i++) {
if(checkAnswer(question_id[i], answers[i])) {
var temp = document.getElementById(ans_id[i])
temp.style.display="block"
temp.innerHTML="Correct"
temp.style.color="Green"
}
else {
var temp = document.getElementById(ans_id[i])
temp.style.display="block"
temp.innerHTML="Incorret, The right answer is option " + answers[i]
temp.style.color="Red"
}
}
}