previous

page 17

next

Second, the images need to be scaled to create the strip effect. In fact they will all need the same height and this will depend on how many questions we asked! Here's my final finale():

function finale() {
var el=document.getElementById('main');
el.style.display='none';
Show('end');
var height=parseInt(65/g_questions)+'vmin';
for (var i=0;i<g_questions;i++) {
var el=document.getElementById('e'+i);
el.src=g_dir+'/'+g_used[i]+'.jpg';
el.style.height=height;
}
}

Why 65?

A good question!

My original quiz had 5 questions and I found a height of 13vmin worked well. So I figured that one question would need 5x13vmin, hence 65.

So all the work is done and we have a quiz program that works really well. Time to go and change the number of questions in globals.js.

And don't forget that by changing the first line in globals.js, you can switch to a different quiz!

Of course we can't expect our players to get in and make that change! The rest of this tute will concentrate on setting up a way for players to choose which quiz they want.

previous
next