Here you can Make a Quiz for your Blog visiotrs with instant check results option. The most importent thing in Representing the instant answer is
Step1:-
Go to </head>
Steps to reach </head>
step(a)-log into your blog account clcik on "Layout"
step(b)-Edit Html
step(c)-Clcik "Ctrl+F" and search for </head>
Step2:-
Copy and paste the following code before </head>
<style type="text/css">
.commenthidden {display:none}
.commentshown {display:inline}
</style>
<script type="text/Javascript">
function togglecomments (postid) {
var whichpost = document.getElementById(postid);
if (whichpost.className=="commentshown") { whichpost.className="commenthidden"; } else { whichpost.className="commentshown"; }
} </script>
Step3:-Save your template.
Step4:-Open new post and write the code as follows or you can copy the following code and paste it in "edit html" you have to change the text as you wish to represent.
<a aiotitle="click to expand" href="javascript:togglecomments('UniqueName')"
>Link Title</a><br />
<div class="commenthidden" id="UniqueName"
>Expanded Content</div>
Remember the name should be same in both" javascript togglecomments" and in "comment hidden id"
If you want to add more questions/data in your post just give space between question to question while you post
My Quiz
Click Answer
Working code for the above quiz.
My Quiz
<form name="f">
<b>What is your favorite color?
</b>
<input name="a" value="4" type="radio">Blue.
<input name="a" value="1" type="radio">Red.
<input name="a" value="2" type="radio">Violet.
<input name="a" value="3" type="radio">Black.
<a aiotitle="click to expand" href="javascript:togglecomments('1a')">ClickAnswer</a>
<div style="font-weight: bold; color: rgb(153, 0, 0);" class="commenthidden" id="1a"> A</div>
<b>How do you like your steak cooked?
</b>
<input name="b" value="2" type="radio">Violet.
<input name="b" value="4" type="radio">Blue.
<input name="b" value="1" type="radio">Red.
<input name="b" value="3" type="radio">Black.</form>
<a aiotitle="click to expand" href="javascript:togglecomments('2a')">Click Answer</a>
<div class="commenthidden" id="2a"><span style="color: rgb(102, 0, 0); font-weight: bold;">B</span>
Working code for the above quiz.
</div>



0 comments:
Post a Comment