0% found this document useful (0 votes)
8 views

Mathq

Uploaded by

enock01111992
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Mathq

Uploaded by

enock01111992
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

<html>

<head>

<meta name=”viewport” content=”width=device-width, initial-scale=1”>

<title>Test Your Skills</title>

<link rel=”stylesheet” href=”stylesheet.css”>

<link href=https://fonts.googleapis.com/css?family=Roboto+Slab
rel=”stylesheet”>

</head>

<body>

<div id=”wrapper”>

<nav>

<ul>

<li id=”about”>About Us</li>

<li><a href=mailto:[email protected] class=”mail”>Contact


Us</a></li>

</ul>

</nav>

<div id=”form-box”>

<form>

<select id=”language”>

<option value=”HTML”selected=”selected”>HTML</option>

<option value=”CSS”>CSS</option>

<option value=”JS”>Javascript</option>

<option value=”PY”>Python</option>
<option value=”C”>C language</option>

</select>

<a href=”#lb3” class=”choose-lang”>Test Skills</a>

</form>

</div>

</div>

<div class=”quiz”>

<div id=”info”>

<div id=”score”>Score: 0</div>

<div id=”ques-left”>Question:1/20</div>

</div>

<div id=”ques-view”>

</div>

<div class=”question”>

<h1>Question</h1>

</div>

<div class=”choice”>

<div class=”options”><input type=”radio” name=”options”


value=”option1” id=”opt0”><label for=”opt0”
id=”lb0”>Option1</label></div>

<div class=”options”><input type=”radio” name=”options”


value=”option2” id=”opt1”><label for=”opt1”
id=”lb1”>Option2</label></div>
<div class=”options”><input type=”radio” name=”options”
value=”option3” checked=”checked” id=”opt2”><label for=”opt2”
id=”lb2”>Option3</label></div>

<div class=”options”><input type=”radio” name=”options”


value=”option4” id=”opt3”><label for=”opt3”
id=”lb3”>Option4</label></div>

</div>

<div class=”ans-btn”>

<button type=”button” class=”submit-answer”>Submit


Answer</button>

<a href=”#display-final-score” type=”button” class=”view-


results”>View Results</a>

</div>

</div>

<div class=”final-result”>

<h1>The Quiz is Over</h1>

<div class=”solved-ques-no”>You Solved 10 questions of


HTML</div>

<div class=”right-wrong”>3 Were Right and 4 were Wrong</div>

<div id=”display-final-score”>Your Final Score is: 35</div>

<div class=”remark”>Remark: Satisfactory, Keep trying.</div>

<button id=”restart”>Restart Quiz</button>

</div>

<script
src=https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js></
script>
<script src=”script.js”></script>

</body>

</html>

//function myfunc(){

// alert(document.getElementById(“language”).value);

//}

Var countQues=0;

Var lang;

Var score=0;

Var HTMLquestions=[

Question: “HTML is what type of language ?”,

Choices: [“Scripting Language”,”Markup Language”,”Programming


Language”,”Network Protocol”],

Answer: 2
},

Question: “HTML uses :”,

Choices: [“User defined tags”,”Pre-specified tags”,”Fixed tags defined


by the language”,”Tags only for linking”],

Answer: 3

},

Question: “The year in which HTML was first proposed _______.”,

Choices: [“1990”,”1980”,”2000”,”1995”],

Answer: 1

},

Question: “Apart from <b> tag, what other tag makes text bold ?”,

Choices: [“fat”,”strong”,”black”,”emp”],

Answer: 2

},

{/*5*/

Question: “How can you make a bulleted list with numbers? “,

Choices: [“dl”,”ol”,”list”,”ul”],

Answer: 2
},

Question: “What tag is used to display a picture in a HTML page?”,

Choices: [“picture”,”image”,”pic”,”img”],

Answer: 4

},

Question: “HTML web pages can be read and rendered by _________.”,

Choices: [“Compiler”,”Server”,”Web Browser”,”Interpreter”],

Answer: 3

},

Question: “Which of the following is not a browser ?”,

Choices: [“Microsofts Bing”,”Netscape Navigator”,”Mozilla


Firefox”,”Opera”],

Answer: 1

},

Question: “HTML tags are surrounded by which type of brackets.”,

Choices: [“Curly”,”Round”,”Squart”,”Angle”],

Answer: 4

},

{/*10*/
Question: “Tags and test that are not directly displayed on the page are
written in _____ section.”,

Choices: [“head”,”title”,”body”,”html”],

Answer: 1

];

Var CSSquestions=[

Question: “If we want define style for an unique element, then which
css selector will we use ?”,

Choices: [“Id”,”text”,”class”,”name”],

Answer: 1

},

Question: “If we don’t want to allow a floating div to the left side of an
element, which css property will we use ?”,

Choices: [“margin”,”clear”,”float”,”padding”],

Answer: 2

},

{
Question: “Suppose we want to arragnge five nos. Of DIVs so that DIV4
is placed above DIV1. Now, which css property will we use to control the
order of stack ?”,

Choices: [“d-inex”,”s-index”,”x-index”,”z-index”],

Answer: 4

},

{/*4*/

Question: “Can we align a Block element by setting the left and right
margins ?”,

Choices: [“Yes, we can”,”Not Possible”,”Depends on browser”,”Depends


upon operating System”],

Answer: 2

},

Question: “If we want to wrap a block of text around an image, which


css property will we use ?”,

Choices: [“wrap”,”push”,”float”,”align”],

Answer: 3

},

{/*6*/

Question: “If we want to show an Arrow as cursor, then which value we


will use ?”,

Choices: [“pointer”,”default”,”arrow”,”arr”],

Answer: 2

},
{

Question: “If we want to use a nice looking green dotted border around
an image, which css property will we use?”,

Choices: [“border-color”,”border-decoration”,”border-style”,”border-
line”],

Answer: 3

},

{/*8*/

Question: “Which of the following properties will we use to display


border around a cell without any content ?”,

Choices: [“empty-cell”,”blank-cell”,”noncontent-cell”,”void-cell”],

Answer: 1

},

Question: “What should be the table width, so that the width of a table
adjust to the current width of the browser window?”,

Choices: [“640 pixels”,”100%”,”full-screen”,”1024px”],

Answer: 2

},

Question: “How can we write comment along with CSS code ?”,

Choices: [“/* a comment */”,”// a comment //”,”/ a comment /”,”<’ a


comment’>”],

Answer: 1
}

];

Var JSquestions=[

Question: “Which of the following is true about variable naming


conventions in JavaScript?”,

Choices: [“JavaScript variable names must begin with a letter or the


underscore character.”,”JavaScript variable names are case sensitive.”,”Both
of the above.”,” None of the above.”],

Answer: 3

},

{/*wscubetech*/

Question: “ Which of the following is a server-side Java Script object?”,

Choices: [“Function”,”File”,”FilleUpload”,”Data”],

Answer: 2

},

Question: “Java script can be used for Storing the form’s contents to a
database file on the server”,

Choices: [“False”,”True”],

Answer: 1

},

{
Question: “How does Java Script store dates in objects of Date type?”,

Choices: [“The number of days since January 1 st, 1900”,”The number of


seconds since January 1st, 1970”,”The number of milliseconds since January
1st, 1970”,”The number of picoseconds since January 1 st, 1970”],

Answer: 3

},

Question: “C-style block-level scoping is not supported in Java script”,

Choices: [“False”,”True”],

Answer: 2

},

Question: “JavaScript ignores extra spaces in Syntax”,

Choices: [“True”,”False”],

Answer: 2

},

Question: “Which of the following is the tainted property of a window


object in Java Script?”,

Choices: [“Pathname”,”Protocol”,”Defaultststus”,”Host”],

Answer: 3

},

{
Question: “Which attribute needs to be changed to make elements
invisible?”,

Choices: [“visibilty”,”visible”,”invisible”,”None of the above”],

Answer: 1

},

Question: “ Javascript is an object oriented language?”,

Choices: [“False”,”True”],

Answer: 2

},

Question: “What is the alternate name for Java script?”,

Choices: [“LimeScript”,”ECMScript”,”Both of the above”,”ECMAScript”],

Answer: 4

];

Var PYquestions=[

Question: “What is the output of the following program : print(Hello


World’[::-1])”,

Choices: [“dlroW olleH”,”Hello Worl”,”d”,”Error”],

Answer: 1
},

Question: “Given a function that does not return any value, what value
is shown when executed at the shell?”,

Choices: [“int”,”bool”,”void”,”None”],

Answer: 4

},

Question: “Which module in Python supports regular expressions?”,

Choices: [“re”,”regex”,”pyregex”,”None of the above”],

Answer: 1

},

Question: “What is the output of the following program : (tricky ques.)


print (0.1 + 0.2 == 0.3) “,

Choices: [“True”,”False”,”Machine Dependent”,”Error”],

Answer: 2

},

Question: “Which of the following is not a complex number?”,

Choices: [“k = 2 + 3j”,”k = complex(2, 3)”,”k = 2 + 3l”,”k = 2 + 3J”],

Answer: 3
},

Question: “What does ~~~~~~5 evaluate to?”,

Choices: [“+5”,”-11”,”+11”,”-5”],

Answer: 1

},

Question: “Given a string s = “Welcome”, which of the following code is


incorrect?”,

Choices: [“print s[0]”,”print s.lower()”,”s[1] = ‘r’”,”print s.strip()”],

Answer: 3

},

Question: “________ is a simple but incomplete version of a function.”,

Choices: [“Stub”,”Function”,”A function developed using bottom-up


approach”,”A function developed using top-down approach”],

Answer: 1

},

Question: “To start Python from the command prompt, use the
command ______”,

Choices: [“execute python”,”go python”,”python”,”run python”],

Answer: 3

},
{

Question: “Which of the following is correct about Python?”,

Choices: [“It supports automatic garbage collection.”,”It can be easily


integrated with C, C++, COM, ActiveX, CORBA, and Java”,”Both of the
above”,”None of the above”],

Answer: 3

];

Var Cquestions=[

Question: “C Language was developed in the year ____”,

Choices: [“1970”,”1975”,”1980”,”1985”],

Answer: 1

},

Question: “Which one is not a reserve keyword in C Language?”,

Choices: [“auto”,”main”,”case”,”register”],

Answer: 2

},

Question: “A C variable name can start with a ____”,

Choices: [“Number”,”Plus Sign”,”Underscore”,”Asterisk”],


Answer: 3

},

Question: “Prototype of a function means _____”,

Choices: [“Name of Function”,”Output of Function”,”Declaration of


Function”,”Input of a Function”],

Answer: 3

},

Question: “Name the loop that executes at least once.”,

Choices: [“for”,”If”,”do-while”,”while”],

Answer: 3

},

Question: “Far pointer can access _____”,

Choices: [“Single memory location”,”No memory location”,”All memory


location”,”First and Last Memory Address”],

Answer: 3

},

Question: “A pointer pointing to a memory location of the variable even


after deletion of the variavle is known as _____”,

Choices: [“far pointer”,”dangling pointer”,”null pointer”,”void pointer”],

Answer: 2
},

Question: “An uninitialized pointer in C is called ___”,

Choices: [“Constructor”,”dangling pointer”,”Wild Pointer”,”Destructor”],

Answer: 3

},

Question: “A pointer that is pointing to NOTHING is called ____”,

Choices: [“VOID Pointer”,”DANGLING Pointer”,”NULL Pointer”,”WILD


Pointer”],

Answer: 3

},

Question: “Who is known as the father of C Language ?”,

Choices: [“Digvijay”,”James A. Sosling”,”Dr. E. F. Codd”,”Dennis


Ritchie”],

Answer: 4

];
//alert(questions.length);

Document.getElementById(“score”).textContent=”Score : “+0;

Document.querySelector(“.view-results”).style.display=”none”;

Document.querySelector(“.quiz”).style.display=”none”;

Document.querySelector(“.final-result”).style.display=”none”;

Document.querySelector(“.choose-lang”).addEventListener(“click”,function()
{

Lang=document.getElementById(“language”).value+”questions”;

Document.getElementById(“ques-left”).textContent=”Question : “+
(countQues+1)+”/”+window[lang].length;

// alert(window[lang].length);

//window[“anything”] will convert “anything” string to object because


window is also an object

Document.querySelector(“.quiz”).style.display=”block”;
Document.querySelector(“.question”).innerHTML=”<h1>”+window[lang]
[countQues].question+”</h1>”;

For (i=0;i<=3;i++){

Document.getElementById(“opt”+i).value=window[lang]
[countQues].choices[i];

Document.getElementById(“lb”+i).innerHTML=window[lang]
[countQues].choices[i];

};/*For loop Closed*/

// window.location.href=”#score”;

});

Document.querySelector(“.submit-
answer”).addEventListener(“click”,function(){

// alert(window[lang][countQues].choices[window[lang]
[countQues].answer-1]);

// alert(document.querySelector(‘input[name=”options”]:checked’).value);

If(document.querySelector(‘input[name=”options”]:checked’).value===wind
ow[lang][countQues].choices[window[lang][countQues].answer-1]){

Score+=10;
Document.getElementById(“score”).textContent=”Score : “+score;

Document.getElementById(“ques-view”).innerHTML+=”<div
class=’ques-circle correct’>”+(countQues+1)+”</div>”;

}else{

Score-=5;

Document.getElementById(“score”).textContent=”Score : “+score;

Document.getElementById(“ques-view”).innerHTML+=”<div
class=’ques-circle incorrect’>”+(countQues+1)+”</div>”;

};

If (countQues<window[lang].length-1){

countQues++;

}else{

Document.querySelector(“.submit-answer”).style.display=”none”;

Document.querySelector(“.view-results”).style.display=”unset”;

Document.getElementById(“ques-left”).textContent=”Question : “+
(countQues+1)+”/”+window[lang].length;

Document.querySelector(“.question”).innerHTML=”<h1>”+window[lang]
[countQues].question+”</h1>”;

For (i=0;i<=3;i++){

Document.getElementById(“opt”+i).value=window[lang]
[countQues].choices[i];

Document.getElementById(“lb”+i).innerHTML=window[lang]
[countQues].choices[i];
};/*For loop Closed*/

});

Document.querySelector(“.view-results”).addEventListener(“click”,function()
{

Document.querySelector(“.final-result”).style.display=”block”;

Document.querySelector(“.solved-ques-no”).innerHTML=”You Solved “+
(countQues+1)+” questions of
“+document.getElementById(“language”).value;

Var correct= document.getElementById(“ques-


view”).getElementsByClassName(“correct”).length;

Document.querySelector(“.right-wrong”).innerHTML=correct+” were Right


and “+((countQues+1)-correct)+” were Wrong”;

Document.getElementById(“display-final-score”).innerHTML=”Your Final
Score is: “+score;

If (correct/(countQues+1)>0.8){

Document.querySelector(“.remark”).innerHTML=”Remark:
OutStanding ! ”;

}else if(correct/(countQues+1)>0.6){

Document.querySelector(“.remark”).innerHTML=”Remark: Good, Keep


Improving.”;
}else if(correct/(countQues+1)){

Document.querySelector(“.remark”).innerHTML=”Remark: Satisfactory,
Learn More.”;

}else{

Document.querySelector(“.remark”).innerHTML=”Remark:
Unsatisfactory, Try Again.”;

// window.location.href=”#display-final-score”;

});

Document.getElementById(“restart”).addEventListener(“click”,function(){

Location.reload();

});

Document.getElementById(“about”).addEventListener(“click”,function(){

Alert(“Quiz Website Project Created By Digvijay Singh”);

});

/*Smooth Scroll*/
$(document).on(‘click’, ‘a[href^=”#”]’, function (event) {

Event.preventDefault();

$(‘html, body’).animate({

scrollTop: $($.attr(this, ‘href’)).offset().top

}, 1000);

});

/*Smooth Scroll End*/

Body {

Margin: 0px;

Padding: 0px;

Nav{

/* background-color: blueviolet;*/

Height: 50px;

Text-align: right;

Color: #fff;
Font-family: sans-serif;

Margin: 0 auto;

Nav li{

Display: inline-block;

Margin-right: 30px;

Padding: 15px;

Font-size: 20;

.mail{

Text-decoration: none;

Color: #fff;

Cursor: pointer;

#about{

Cursor: pointer;

#wrapper{

Background-image:linear-gradient(rgba(0,0,0,0.7),rgba(0,0,0,0.8)),
url(“hero-img.jpg”);

Background-position: center;

Background-size: cover;

Height: 100vh;
Text-align: center;

#form-box{

/* background-color: aqua;*/

Padding:1%;

Top:50%;

Position: absolute;

Left:40%;

.choose-lang{

Text-decoration: none;

Color: black;

Background-color:#fff;

Margin-left: 30px;

Border: 2px solid #FF9933;

Padding: 15px;

Border-radius: 20px;

Font-family: monospace;

/* letter-spacing: 1.5px;*/

/* font-weight: 400;*/

Transition: background-color 0.3s,border 0.2s, color 0.2s;

.choose-lang:hover{

Background-color: #FF9933;
Color:#fff;

Cursor: pointer;

/* width: 120px;*/

Font-size: 110%;

#language{

Background-color:white;

Padding:12px;

Border-radius: 5px;

Cursor:pointer;

Border:2px solid black;

#language:hover{

Background-color:#fff;

#language option{

Background-color: #fff;

.quiz{

Background-color: #fff;
Text-align: center;

/* padding: 0%;*/

Margin-top: 20px;

Height: 100vh;

#info{

Height:25px;

Background-color: #fff;

#score{

Width:50%;

Float:left;

Font-size: 25px;

#ques-left{

Width:50%;

Float:left;

Font-size:25px;

#ques-view{

/* background-color:aqua;*/
Height: 35px;

Margin-top: 10px;

Padding: 2px;

.ques-circle{

Float: left;

Border-radius: 50%;

Width: 35px;

Height: 90%;

Margin-left: 10px;

Margin-top: 10px;

.correct{

Background-color: #2ecc71;

.incorrect{

Background-color: #fc5c65;

Color: #fff;

.question{

/* background-color: antiquewhite;*/

Font-family: ‘Roboto Slab’, sans-serif;

Letter-spacing: .13em;

.choice{
Background-color: #fff;

Padding: 3%;

.options{

Background-color: #fff;

Display:block;

Margin-left: 13%;

Font-size: 25px;

Font-weight: 100;

Margin-top: 30px;

Text-align: left;

Input[type=radio] {

Border: 5px solid white;

Width: 20px;

Height: 1.3em;

Float: left;

.ans-btn{

Background-color: #fff;

Padding: 2%;

}
.submit-answer{

Background-color:white;

Border: 2px solid #FF9933;

Padding: 15px;

Border-radius: 20px;

Font-family: monospace;

Transition: background-color 0.3s,border 0.2s, color 0.2s;

.submit-answer:hover{

Background-color: #FF9933;

Padding: 16px;

Color: #fff;

Cursor: pointer;

Border-radius: 20px;

.view-results{

Text-decoration: none;

Color: black;

Background-color:white;

Border: 2px solid #FF9933;

Padding: 15px;

Border-radius: 20px;

Font-family: monospace;
Transition: background-color 0.3s,border 0.2s, color 0.2s;

.view-results:hover{

Background-color: #FF9933;

Padding: 16px;

Color: #fff;

Cursor: pointer;

Border-radius: 20px;

/*Final Results*/

.final-result{

Background-color: #fff;

Text-align: center;

Padding: 10px;

Font-size: 1.5em;

Height: 100vh;

.solved-ques-no{

Padding: 10px;

.right-wrong{

Padding: 10px;

}
#display-final-score{

Padding: 5%;

.remark{

Padding: 5%

#restart{

Background-color:#ff9933;

Margin-left: 30px;

Border: 2px solid #FF9933;

Padding: 15px;

Border-radius: 20px;

Font-size: 80%;

Transition: background-color 0.3s,border 0.2s, color 0.2s;

#restart:hover{

Background-color: #FF9933;

Color:#fff;

Cursor: pointer;

/* width: 120px;*/

Font-size: 90%;

@media only screen and (max-width: 1250px) {


.options{

Margin-left: 8%

@media only screen and (max-width: 850px) {

.options{

Margin-left: 4%;

@media only screen and (max-width: 650px) {

.options{

Display: block;

Margin-top: 3%;

@media only screen and (max-width: 550px) {

.options{

Margin-top: 3%;

.choose-lang{

Display: block;
Margin-top: 25px;

Margin-left: 0px;

#language{

Display: block;

You might also like