Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-18-2003, 05:26 AM   #11
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

sorry.. the tick/ wrong comes correct... in the output window- i need to check from the bottom- i was checking from the top (which includes question 0)..

sorry abt. that!!
texbala is offline   Reply With Quote
Old 04-18-2003, 05:37 AM   #12
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Yeah... I was obviously not paying much attention on 0 and 1 stuff...

I think this one works better in terms or right and wrong...
ActionScript Code:
stop(); loadVarsText = new loadVars(); loadVarsText.load("questions_text.txt"); loadVarsText.onLoad = function(success) {     if (success)     {         //trace("sucess");         //    questions.text = true;         mainQuestion.text = this.themainQuestion;         question1.text = this.thequestion1;         question2.text = this.thequestion2;         question3.text = this.thequestion3;         question4.text = this.thequestion4;         question5.text = this.thequestion5;         question6.text = this.thequestion6;         question7.text = this.thequestion7;         question8.text = this.thequestion8;     }     else     {         trace("unsuccess");     } }; //data for combobox a = new Array(1, 2, 3, 4, 5, 6, 7, 8); var noOfQuestions = 8; /* for (i=0; i<noOfQuestions; i++) {     this["holder"+i].attachMovie("tick", "tick"+i, i);     //trace(this["holder"+i]); } */ for (i = 1; i <= noOfQuestions; i++) {     this.onLoad = populateCb(this["q" + i + "_cb"]); } this.onLoad = populateCb(q1_cb); function populateCb(value1) {     var q1Labels = new Array("Coherance", "Symbolism", "Positioning");     var q1Data = new Array(1, 2, 3);     for (var i = 0; i < q1Data.length; i++)     {         value1.addItem(q1Labels[i], q1Data[i]);     } } var total; btn_check.onPress = function() {     var correctAnswers = new Array("1", "2", "3", "1", "2", "3", "1", "2");     var userAnswers = new Array(q1_cb.getValue(), q2_cb.getValue(), q3_cb.getValue(), q4_cb.getValue(), q5_cb.getValue(), q6_cb.getValue(), q7_cb.getValue(), q8_cb.getValue());     for (i = 0; i < noOfQuestions; i++)     {         _level0["holder" + (i + 1)].removeMovieClip(); //    trace("userAnswers " + userAnswers[i] + " correctAnswer " + correctAnswers[i]);         if (userAnswers[i] == correctAnswers[i])         {             trace("Question No. " + (i + 1) + " : " + "userAnswers " + userAnswers[i] + " correctAnswer " + correctAnswers[i] + "\tRIGHT ANSWER"); //      _level0["holder" + (i + 1)].attachMovie("Tick", "Tick" + (i + 1), (i + 1) * 10 + 1000, {_x:20, _y:this["q" + (i + 1) + "_cb"]._y});             _level0["holder" + (i + 1)].attachMovie("Tick", "Tick" + (i + 1), (i + 1) * 10 + 1000);         }         else         {             trace("Question No. " + (i + 1) + " : " + "userAnswers " + userAnswers[i] + " correctAnswer " + correctAnswers[i] + "\tWRONG ANSWER"); //      _level0["holder" + (i + 1)].attachMovie("Wrong", "Wrong" + (i + 1), (i + 1) * 10 + 2000, {_x:160, _y:this["q" + (i + 1) + "_cb"]._y});             _level0["holder" + (i + 1)].attachMovie("Wrong", "Wrong" + (i + 1), (i + 1) * 10 + 2000);         }         /*                                              trace(this["holder"+i]);                     trace("userAnswers "+ userAnswers[i] + " correctAnswer "+ correctAnswers[i]);                     total++                     trace(total);                 } else {                     this["holder"+i].attachMovie("wrong", "wrong"+i, i);                 }*/     } };
Quote:
how can i add two answers to be correct
This... Hm... I guess you can try something like this...
ActionScript Code:
var correctAnswers = new Array("1", "2,3", "3", "1,3", "2", "3", "1", "2");
and check the length of each element and if it is 1 then use the above if statement to check the validity, and if it is bigger than 1 then, you will have to create another array by using split() function and create an if statement with multiple conditions... Would this work for you???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 04-18-2003, 05:46 AM   #13
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

thnx Cyanblue...

the array didn't work out properly.. i will try to do it in the weekend... I am planning to extend this with XML... any idea of how to proceed... am very low in XML stuff...

thnx very much for ur help!! good night!!
texbala is offline   Reply With Quote
Old 04-18-2003, 05:49 AM   #14
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Well... I don't know much about XML myself either... But there are some good stuff on the forum... See if you can find some...

Let me know what you come up with this weekend, alrighty???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 04-18-2003, 03:24 PM   #15
subquark
yep, it's martini time!
 
subquark's Avatar
 
Join Date: Jun 2002
Location: Boston
Posts: 1,983
Default oh no!

haha Bala! I'm working on the same AIU form!! What a hoot!

I think they will take the best solution and use it themselves and not hire anyone. Did you notice that the graphics on their .fla files aren't even placed on whole numbers?

I think we are being scammed! Anyway, fear not, I will not steal the code here. This forum is too important for me and more important than AIU.

BTW, your flash link at http://www4.ncsu.edu:8030/~bjagann/s...ortfolio1.html does not work for me . . .

__________________
mr. olive . . . hold on to your monkey!

Last edited by subquark; 04-18-2003 at 03:50 PM.
subquark is offline   Reply With Quote
Old 04-18-2003, 03:31 PM   #16
subquark
yep, it's martini time!
 
subquark's Avatar
 
Join Date: Jun 2002
Location: Boston
Posts: 1,983
Default

bala, you might try to look at Colin Moock's quiz examples, while he does not use the combobox, it can all be done within Flash (don't go the xml route, AIU probably wants it all self contained).

Of particular note, Moock uses external files. Also, did you try the Flash MX Quiz templates?

Here is moock's URL: here
__________________
mr. olive . . . hold on to your monkey!
subquark is offline   Reply With Quote
Old 04-18-2003, 03:32 PM   #17
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

subquark!!

yeah.. i need to fix the portfolio link...

pls. send personal comments to me @bjagannATunity.ncsu.edu

also.. i don't like putting the contact names on the boards... no offense!!! pls

btw. u disabled ur PM option....
texbala is offline   Reply With Quote
Old 04-18-2003, 03:46 PM   #18
texbala
[AS]FlashyLearner++[/AS]
 
Join Date: Jul 2002
Location: India
Posts: 342
Default

subquark...

the portfolio link is corrected now...

i havn't used the templates till now.. it looks good... thnx for letting me know!!

ur webpage is good!! - havn't explored everything!!
texbala is offline   Reply With Quote
Old 04-18-2003, 03:47 PM   #19
subquark
yep, it's martini time!
 
subquark's Avatar
 
Join Date: Jun 2002
Location: Boston
Posts: 1,983
Default

oh it's okay, that guy is probably going to take your code and run with it! But I'll edit the post and take it off . . .

I too have a Master's degree and am somewhat aware of the way of the world, so no need to reprimand me. I could have just snagged the zip and sent it to Brian!

Your solution seems to work fine to me, just change the circles to green check marks as indicated in src2.jpg and you are set.

Good luck!
__________________
mr. olive . . . hold on to your monkey!
subquark is offline   Reply With Quote
Old 04-18-2003, 03:53 PM   #20
subquark
yep, it's martini time!
 
subquark's Avatar
 
Join Date: Jun 2002
Location: Boston
Posts: 1,983
Default

hey, your link to gogoddessgo just pulls up a blank page (source code: <META name="postinfo" content="/scripts/postinfo.asp">)
__________________
mr. olive . . . hold on to your monkey!
subquark is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:04 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.