473,394 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Flash 8 Quiz Guru Needed: Make link appear for next test only if test taker passes.

Greeings, all,

Flash 8 has quiz templates which are coded for multiple choice, true/false, text statement, and matching types of questions, along with hotspots and probably anoher type I am forgetting. The test taker makes their selection(s) or answers, and clicks a "check answer" button. They then get a feedback statements depending on whether they have answered correctly or not. Many questions involve multiple selections to be correct, but all must click on the "check answer" button to advance to the next question.

The point is that all of this functionality is coded in the component(s) which make the template so versatile. A copy of my .fla shouldn't actually be needed (I am guessing here), because the component code is what I believe needs tweaking, at least the part where the final percentage of correct answers is calculated at the end of the test, and that percentage is compared to a user-defined passing percentage score.

I think this requires a Flash Quiz Guru, who knows just how to connect the pass or fail result to a new button or a "go to" redirect. I don't know whether the same effect could be accomplished by frame scripting, but I expect tweaking the component(s) code would seem a more direct approach.

I cannot fill in the blanks for any idea that is just an idea. If anyone can code this, make it work and test it, and direct me to where the snippets must be placed, I would be deeply grateful. This is about education, not a game or commercial razz-ma-tazz.

Are there any Flash Quiz Guru's who can help me out with this?

Thank you.

regards,

stevenjs
____________________________________
"I am but an egg."
--Stranger in a Strange Land
Apr 18 '07 #1
1 4446
Hello again,

Here's a copy of the Flash 8 Quiz Component called "QuizGlobalClass" in the template library, prior to any of the quiz parameters being set in the component interface (hence some items are "undefined" :

**************************

#initclip 1

/*--------------VERSION CONTROL INFORMATION----------------------

Quiz Template Global Toolbox Class
Developed by Dan Carr
Quality Assurance by Andrew Chemey
Last Modified for Flash 2004: July 6, 2003
Copyright 2003 Macromedia Inc. All rights reserved.

------------------END VERSION CONTROL--------------------------
*/


// SECTION 1: BUILD THE QUIZ CLASS FOR EVENT HANDLING

// 1-1: Set the contructor function for the Quiz Class

_global.Quiz = function (){

this.total_correct = 0;
this.total_wrong = 0;
this.percent_correct = 0;
this.percent_display = undefined;

this.quest_to_ask = 0;
this.randomize = undefined;
this.login_file = undefined;
this.activity_ID = undefined;
this.activity_name = undefined;
this.results_page = undefined;

this.level = undefined;

this.Quest_Frames = new Array();
this.quest_num = 0;
this.page_num = undefined;
this.endFlag = false;
}

_global.Quiz.prototype = new Object();

Object.registerClass("QuizSuperClass",Quiz);

// 1-2: Initialize Quiz tracking session

Quiz.prototype.initStartQuiz = function (){

this.start_time = Math.round(getTimer()/1000);
var start_param = this.login_file+";"+this.activity_ID+";"+this.acti vity_name;

fscommand("CMIInitialize" ;
fscommand("MM_cmiSetLessonStatus", "i" ;
fscommand("MM_StartSession", start_param);
}


// 1-3: Initialize a new quiz page

Quiz.prototype.initNewPage = function(num){

fscommand("CMISetLocation", num);
}


// 1-4: Conclude the Quiz session and submit score

Quiz.prototype.initSubmitScore = function(){

this.stop_time = Math.round(getTimer()/1000);
this.elapsed_time = this.getLatency(this.stop_time - this.start_time);
this.percent_correct = Math.round(this.total_correct/(this.total_correct+this.total_wrong)*100);

fscommand("MM_cmiSetLessonStatus", "c" ;
fscommand("CMISetTime", this.elapsed_time);
fscommand("CMISetScore", this.percent_correct);
fscommand("CMIFinish" ;
fscommand("CMIExitAU" ;
}


// 1-5: Format Latency for correct tracking

Quiz.prototype.getLatency = function (timeInSec){

var l_seconds, l_minutes, l_hours, timeInHours;

if (timeInSec <= 9) {
l_seconds = "0"+timeInSec;
l_minutes = "00";
l_hours = "00";
} else {
l_seconds = timeInSec;
l_minutes = "00";
l_hours = "00";
}
if (l_seconds > 59) {
l_minutes = int(l_seconds / 60);
l_minutes = this.formatNum(l_minutes);
l_seconds = l_seconds - (l_minutes * 60);
l_seconds = this.formatNum(l_seconds);
l_hours = "00";
}
if (l_minutes > 59) {
l_hours = int(l_minutes/ 60);
l_hours = this.formatNum(l_hours);
l_minutes = l_minutes - (l_hours * 60);
l_minutes = this.formatNum(l_minutes);
}
timeInHours = l_hours+":"+l_minutes+":"+l_seconds;
return timeInHours;
}


// 1-6: Return formatted number - convert from single digit to double digit

Quiz.prototype.formatNum = function (num) {

if (num <= 9) {
num = "0"+num;
}
return num;
}


// 1-7: Set the pooling number and build an array of page numbers

Quiz.prototype.setQuestArray = function(){

this.pooling_array = new Array();
this.start_page;
this.end_page;

for (var i = 0; i < _root._totalframes; i++) {
this.pooling_array = i+1;
}
this.start_page = this.pooling_array.shift();
this.end_page = this.pooling_array.pop();

if (this.randomize == true) {
this.setRandomArray(this.pooling_array);
}

if (this.quest_to_ask > this.pooling_array.length || this.quest_to_ask < 1) {
this.quest_to_ask = this.pooling_array.length;
} else {
this.quest_to_ask = int(this.quest_to_ask);
}

for (var i = 0; i < this.quest_to_ask; i++) {
this.Quest_Frames = this.pooling_array;
}
}


// 1-8: Randomize the array of page numbers if requested

Quiz.prototype.setRandomArray = function(array){

for (var i=0 ; i < array.length; i++) {
newLoc = Math.round(Math.random() * (array.length-1));
currLoc = array;
array = array[newLoc];
array[newLoc] = currLoc;
}
}


// 1-9: Set the navigation to the next page in the array

Quiz.prototype.setNewPage = function() {

if (this.endFlag == false){

this.page_num = this.Quest_Frames[this.quest_num];
this.quest_num++;

this.initNewPage(this.page_num);
_root.gotoAndStop(this.page_num);

} else if (this.endFlag == true) {
this.percent_format = this.percent_correct+"%";
_root.gotoAndStop(_root._totalframes);
}
}


// 1-10: Catch the result variables from the interactions

Quiz.prototype.countScore = function (weightNum){

if (weightNum < 0) {
this.total_wrong += Math.abs(weightNum);
} else {
this.total_correct += Number(weightNum);
}

this.quest_to_ask--;

if(this.quest_to_ask > 0){
_root.nav.nextBtn.gotoAndStop(1);

} else if (this.quest_to_ask == 0) {
this.initSubmitScore();
this.endFlag = true;

if(this.results_page == true){
_root.nav.nextBtn.gotoAndStop(1);
} else {
_root.nav.nextBtn.gotoAndStop(2);
}
}
}

#endinitclip 1
*************************************

Although I am guessing, it seems what's needed is a conditional statement, perhaps using "this.percent_display = undefined;" (once defined). When the percentage of correct answers is at or greater than a given passing grade percentage, the test taker is redirected to a more advanced quiz. When the percentage of correct answers is lower than passing, the test taker is invited to retake the test.

Please, anyone?

regards,

stevenjs
__________________________
--Stranger in a Strange Land
Apr 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
2
by: Sketcher | last post by:
Hi, I am trying to create a quiz, Code is as follows: <html> <head> <title>Quiz</title> </head> <BODY> <Center><TABLE cellSpacing=3 cellPadding=0 border=0>
4
by: DAL | last post by:
I want to build my kid a program that cycles through questions (using a label for the question), and lets him choose one of two radio buttons for the right answer. How do I get every set of...
56
by: tasteless | last post by:
Hi guys, I need really hard questions (about 10) about PHP programming (some of elements OOP as well, but no MySQL questions - this is different part), this questions needs to be very hard, but...
1
by: korr | last post by:
Hi there, i'm trying to develop a quiz in flash. Searching on the net, I found a quiz in flashkit from sephiroth.it by Alessandro Crugnola. His quiz has a script that puts the questions and the...
0
nomad
by: nomad | last post by:
Hello Everyone: Would like to know if this is possible. I have a client that want me to create a quiz which would be created in Flash and the data would be in XML. I can do that part, but the next...
3
by: empiresolutions | last post by:
I am building a app that creates quizzes. This is how it goes - - Create Quiz - Provide up to 10 different types of Quiz Results - Give up to 50 Questions - Each Question has up to 10 possible...
1
by: Holly Six | last post by:
I have a quiz file using the e-learning and quiz components. There is a bug for one condition - the user takes the quiz and fails, click the retake button and passes. The score that is written to the...
2
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.