Quiz 1: Basic of Thermodynamics Online Objective Quiz 


Attempt this 20 questions related to Thermodynamics .You Can check your answer by clicking show answer button and to solve next question click on next button .

/*

* This function is called on loading of the page
* The current question value is set to 1
* The default marks value is set to 0

*/
function load()

{

//.rows[2].cells[4].innerText
document.getElementById(“currentquestion”).value = 1;
document.getElementById(“totalscore”).value = 0;

}

function checkButton()
{
var counter = document.getElementById(“currentquestion”).value; // By default the counter value is 1

var useranswer = 0;
var actualanswer = document.getElementById(“answer” + counter).value;
var options = document.getElementsByName(“question” + counter);

for (var i = 0; i < options.length; i++) { if (options[i].checked) { useranswer = i + 1; } } document.getElementById('sampleans').style.display = "block"; document.getElementById('sampledet').style.display = "block"; var detailanswer = document.getElementById("details" + counter).value; if (useranswer == actualanswer) { document.getElementById('sampleans').innerHTML = "" + "Your Answer is Correct Its " + " " + actualanswer + " " + ""; document.getElementById('sampledet').innerHTML = "" + "Detailed ans : " + " " + detailanswer + " " + ""; if (actualanswer == 1) { document.getElementById("simple" + counter).rows[1].cells[0].style.color = "green"; } else if (actualanswer == 2) { document.getElementById("simple" + counter).rows[1].cells[1].style.color = "green"; } else if (actualanswer == 3) { document.getElementById("simple" + counter).rows[2].cells[0].style.color = "green"; } else if (actualanswer == 4) { document.getElementById("simple" + counter).rows[2].cells[1].style.color = "green"; } }else { document.getElementById('sampleans').innerHTML = "" + "Wrong !!! Correct Answer is" + " " + actualanswer + " " + ""; document.getElementById('sampledet').innerHTML = "" + "Detailed ans : " + " " + detailanswer + " " + ""; if (useranswer == 1 && useranswer != actualanswer) { document.getElementById("simple" + counter).rows[1].cells[0].style.color = "red"; } else if (useranswer == 2 && useranswer != actualanswer) { document.getElementById("simple" + counter).rows[1].cells[1].style.color = "red"; } else if (useranswer == 3 && useranswer != actualanswer) { document.getElementById("simple" + counter).rows[2].cells[0].style.color = "red"; } else if (useranswer == 4 && useranswer != actualanswer) { document.getElementById("simple" + counter).rows[2].cells[1].style.color = "red"; } } } function nextButton() { var counter = document.getElementById("currentquestion").value; // By default the counter value is 1 document.getElementById('sampleans').style.display = "none"; document.getElementById('sampledet').style.display = "none"; counter++; if (counter < 20) { document.getElementById("sample" + counter).style.display = "block"; //here the next question will be visible document.getElementById("sample" + (counter - 1)).style.display = "none"; //the previous question will be hided document.getElementById("currentquestion").value = counter; } else if (counter == 20) { document.getElementById("sample" + counter).style.display = "block"; document.getElementById("sample" + (counter - 1)).style.display = "none"; document.getElementById("currentquestion").value = counter; document.getElementById("b1").style.display = "none"; document.getElementById("b2").style.display = "block"; } } function finish() { var useranswer = 0; document.getElementById("samplet").style.display = "none"; document.getElementById("sampleans").style.display = "none"; document.getElementById("sampledet").style.display = "none"; document.getElementById("b0").style.display = "none"; var marks = document.getElementById("totalscore").value; document.getElementById("b2").style.display = "none"; document.getElementById("b3").style.display = "block"; for (var j = 1; j

Spread the love

Related Posts

Automatic Pneumatic Clutch and Braking System

Automatic Pneumatic Clutch and Braking System

Effects of Common Alloying Elements in Steel

Effects of Common Alloying Elements in Steel

What Is Mechanical Engineering | Career , Salary ,Skill Needed

What Is Mechanical Engineering | Career , Salary ,Skill Needed

Fabrication of Brass screw threading and cutting machine

Fabrication of Brass screw threading and cutting machine

Aircraft Auto Pilot Roll  Control System project Report Download

Aircraft Auto Pilot Roll Control System project Report Download