...

View Full Version : Adding question to quiz



SteveH
03-28-2008, 06:45 PM
Hello

I have a Flash quiz which I have downloaded (it was free) and eventually hope to post something like it online, but I need first to come to terms with what is going on in the Timeline.

After answering a question the

function answer (choice) {

advances the user to the next question and at the end of the two questions (!), a total score is given.

The Action Script looks like this:



var quizTimeline = this; // Stores reference to the timeline that contains the quiz user interface.
var numQuestions = 2; // Number of questions in the quiz
var q1answer; // User's answer for question 1
var q2answer; // User's answer for question 2
var correctAnswer1 = 3; // The correct choice for question 1
var correctAnswer2 = 2; // The correct choice for question 2
answer.currentQuestion = 0; // Function property: the question being answered



If I wished to add a third or fourth question, or any number of questions, I understand that I need to add to the AS as follows:




var numQuestions = 5; // Number of questions in the quiz
var q1answer; // User's answer for question 1
var q2answer; // User's answer for question 2
var q3answer; // User's answer for question 3
var q4answer; // User's answer for question 4
var q5answer; // User's answer for question 5
var correctAnswer1 = 3; // The correct choice for question 1
var correctAnswer2 = 3; // The correct choice for question 2
var correctAnswer3 = 1; // The correct choice for question 3
var correctAnswer4 = 2; // The correct choice for question 4
var correctAnswer5 = 1; // The correct choice for question 5



What I am unsure about is how to customise the Timeline. I have copied and pasted frames and tried to change the nature of the questions asked (and their numbers) graphically on the stage, but I cannot get it to work doing that. For example, under question 2 I can see question 1, etc after pressing Ctrl + Enter.

What would be the best way of proceeding? I can post the file if it helps.

Many thanks.

Steve

jairusbondoc
04-13-2008, 02:48 PM
yeah better post the file. i am assuming it might be a same instance problem.

SteveH
04-15-2008, 11:10 AM
Hello jairusbondoc

Many thanks for getting back to me.

I have tried to add a couple of questions to the quiz since my post and have had some success, though it is not completely working.

Confession: I have added them, but I'm not sure how. You mention instance names, but I think I have included them where necessary.

The AS does not pose a problem as the main work to be done is in the timeline.

To add a question, do I simply pull out all the layers by 10 frames and add another layer to introduce an additional question? I am unsure of the sequence of stages I need to go through in order to do it properly.

Many thanks for taking the time to look at it.

Steve

Sajad
09-02-2011, 10:48 AM
Sir

I have a .js file in which i have placed Urdu text like

function Urdutext()
{
innerHTML.right_column='HTML tags and Urdu text';}

the .js file contains near about 80 lines of urdu text.

When i try to run the .js file it displays only half of the file and where the rest of lines go i dnt know.

And when i include the file in my web page and want to display the urdu text nothing displays becaus the file remains in a wrong syntax. AS i have said I cant understand y the file gets half uploaded and y not full.

Plz help me.

Thanks
Sajad



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum