Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teja #76

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

teja #76

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
2 changes: 1 addition & 1 deletion src/lab/exp1/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
Ans["q8"]=0;

</script>
<script type="text/javascript" src="../js/quiz.js"> </script>
<script type="text/javascript" src="quiz.js"> </script>
<!-- ***************************************************** -->
</body>
</html>
55 changes: 55 additions & 0 deletions src/lab/exp1/quiz.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
function checkAns(form)
{
wrong="";
var flag=0;
var a=0;
var b=0;
var c=0;
for(i=1;i<=len;++i)
{
var ll = form["q"+i].length;
var sel=-1;
for(j=0;j<ll;++j)
{
if(form["q"+i][j].checked){

sel=j;
a++;
if(Ans["q"+i]!=parseInt(sel)){

wrong+="Q"+i+", ";
flag++;}
else if(Ans["q"+i]==parseInt(sel)){


c++;}
}


/*else if(!form["q"+i][j].checked){
b++;
}*/
}
}


wrong = wrong.substring(0,wrong.length-2);
if(flag>=1){
if(wrong!="")
alert(wrong +" are wrong");
else
alert("all ans are correct.")
return false;
}
else {
if(a===0)
alert("Please attempt all questions");
if(c===5)
{alert('All Answers are correct');}
/*else
alert("all ans are correct.");*/
return false;
}

}

2 changes: 1 addition & 1 deletion src/lab/exp10/experiment/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<li><a href="../exp3/index.php">EXPERIMENT 3</a></li>
<li><a href="../exp4/index.php">EXPERIMENT 4</a></li>-->
<li style="text-decoration:none;padding:17px;width:760px;background:#009900;color:#eee;float:left;"></li>
<li><a href="../" target="blank" style="border-top-right-radius:0.8em;border-bottom-right-radius:0.8em;padding-left:00px">HELP</a></li>
<li><a href="http://ccnsb04-iiith.virtual-labs.ac.in/exp10/index.php?section=Manual" target="blank"" target="blank" style="border-top-right-radius:0.8em;border-bottom-right-radius:0.8em;padding-left:00px">HELP</a></li>
</ul>
</div><!--header ends-->
4 changes: 2 additions & 2 deletions src/lab/exp3/experiment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

<div id="content" style="padding-top:50px;padding-bottom:30px;"><!--content starts-->
<center>
<applet code="vib_rotationalSpectroscopy.Spectroscopy$MyApplet" width="1100px" height="700px" >
<applet code="vib_rotationalSpectroscopy.Spectroscopy$MyApplet.class" width="1100px" height="700px" >
</applet>
</center>
</div><!--content ends-->
Expand All @@ -75,4 +75,4 @@

</body>

</html>
</html>
56 changes: 38 additions & 18 deletions src/lab/js/quiz.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,54 @@
function checkAns(form)
{
wrong="";
correct="";
var flag=0;
var a=0;
var b=0;
var c=0;
for(i=1;i<=len;++i)
{
var ll = form["q"+i].length;
var sel=-1;
for(j=0;j<ll;++j)
{
if(form["q"+i][j].checked)
if(form["q"+i][j].checked){

sel=j;
}
if(Ans["q"+i]!=parseInt(sel)){
wrong+="Q"+i+", ";
flag++;
}
a++;

if(Ans["q"+i]==parseInt(sel)){

correct+="Q"+i+", ";
flag++;
c++;}
else if(Ans["q"+i]!=parseInt(sel)){
flag++;}
}


/*else if(!form["q"+i][j].checked){
b++;
}*/
}
}
wrong = wrong.substring(0,wrong.length-2);
if(flag>1){
if(wrong!="")
alert(wrong +" are wrong");
else
alert("all ans are correct.")


correct = correct.substring(0,correct.length-2);
if(flag>=1){
if(correct!="")
alert(correct+" correct");
else if(correct=="")
alert("None are correct");
return false;
}
else {
if(wrong!="")
alert(wrong +" is wrong");
else
alert("all ans are correct.")
if(a===0)
alert("Please attempt atleast one question");
if(c===len)
{alert('All Answers are correct');}
/*else
alert("all ans are correct.");*/
return false;
}
}

}