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>
This code makes your answers "show/hide"

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>
Note1:-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
</div>
Sample Quiz
Following is the code for above "Sample Quiz". Copy this code to any text editor(notepad/word) Replace the Question1,2...10 with your own questions. I have left multiple answers empty for your convenience. Type your answers beside immediately following ABCD.The code is as follows,


Points to remember
Note:-If you are posting multiple quizzes in a single post or representing multiple quizzes in single page. Then you must be careful about “unique id”, means if you have given ids in Quiz 1 as 1a for answer1 , 2a for answer 2 and have given the same 1a ,2a,3a like answer ids in quiz2 and in quiz3 and posted all three quizzes in a single post or represented in single page then Only Quiz 1 displays and hides the answers where as remaining quizzes doesn’t work. If you open quiz2 and quiz 3 in separate links (in individual separate pages) then they work.
You should not give same id types to different answrs of separate/different questions. The id should be unique.
For example you may have given answers ids like
Q1-1a,-A
Q2-2a-B,
Q3-2a-C,
Q4-2a-D,
Q5-2a-A for question 1,2,3,4,5..then if you click for the answer of Q1 you will see the answer as A, if you click for the answer of Q2 you will see the answer as B, if you click for the answer of Q3,Q4,Q5 you will see the answer as B at the location of Question2 answer location, it is because you have given the same id for 3,4,5 which is actually addresses to Q2 answer…that’s why when you click for the 3,4,5 answers …answer will be displayed at Q2 answer location .
So, you must give ids as follows
Quiz 1
A1=1-1a
A2=1-2a
A3=1-3a
Quiz 2
A1=2-1a
A2=2-2a
A3=2-3a
Quiz 3
A1=3-1a
A2=3-2a
A3=3-3a
For More quizzes go here.www.blogspotquiz.blogspot.com
0 comments:
Post a Comment