home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2002 September
/
PCWorld_2002-09_cd.bin
/
Akce
/
Quartet
/
Main
/
MAIN.SWF
/
scripts
/
frame_75
/
DoAction.as
Wrap
Text File
|
2002-08-07
|
5KB
|
152 lines
function Exit()
{
showWait();
SaveCurrentInteraction();
_exit = true;
putParam();
}
function NextPage()
{
if(_PageNumber < _MaxPages)
{
GotoPage(_PageNumber + 1);
}
}
function PreviousPage()
{
if(_PageNumber > 1)
{
GotoPage(_PageNumber - 1);
}
}
function SetButtons(page)
{
if(page == 1)
{
"navig.previous:gotoAndStop"("disable");
}
else
{
"navig.previous:gotoAndStop"("enable");
}
if(page == _MaxPages)
{
"navig.next:gotoAndStop"("disable");
}
else
{
"navig.next:gotoAndStop"("enable");
}
}
function GotoPage(page_number)
{
navig.sun._x = eval("navig.navig_" add page_number add "._x");
SetButtons(page_number);
if(!_FirstQuestion)
{
SaveCurrentInteraction();
}
else
{
_FirstQuestion = false;
}
var q_id = _arQuestions.getID(page_number - 1);
var b_id = _arBlocksQuestions.getBlockID(q_id);
gotoAndStop(b_id);
_PageNumber = page_number;
var b_number = _arBlocks.getNumber(b_id);
var b_type = _arBlocks.getType(b_number);
"blocks:gotoAndStop"("init");
set("blocks:image",_arBlocks.getImage(b_number));
set("blocks:item",_arBlocks.getItem(b_number));
"blocks:gotoAndStop"(b_type);
var err = "0";
"questions:gotoAndStop"("init");
var e = _arQuestions.getAnswer(page_number - 1);
if(e.nodeName == "ANSWER")
{
Q_type = e.attributes.TYPE;
Q_question_id = _arQuestions.getID(page_number - 1);
Q_name = _arQuestions.getName(page_number - 1);
Q_description = _arQuestions.getDescription(page_number - 1);
Q_tracking = _arQuestions.getTracking(page_number - 1);
Q_objective_id = _arQuestions.getOid(page_number - 1);
Q_weight = _arQuestions.getWeighting(page_number - 1);
"play:gotoAndStop"("disable");
modal_questions._visible = false;
"questions:gotoAndStop"(Q_type);
switch(q_type)
{
case "MC-1":
info_text = "info_2";
Q_size = e.attributes.SIZE;
set("questions.mMC-1:Q_description",Q_description);
set("questions.mMC-1:Q_audio",e.attributes.AUDIO);
var chid = 0;
var i = 0;
while(i < e.childNodes.length)
{
if(e.childNodes[i].nodeName == "CHOICE")
{
set("questions.mMC-1:mc_choice_id" + chr(97 + chid),e.childNodes[i].attributes.CHOICE_ID);
set("questions.mMC-1:mc_text" + chr(97 + chid),e.childNodes[i].firstChild.nodeValue);
set("questions.mMC-1:mc_correct" + chr(97 + chid),e.childNodes[i].attributes.CORRECT);
set("questions.mMC-1:mc_score" + chr(97 + chid),e.childNodes[i].attributes.SCORE);
chid++;
}
i++;
}
break;
case "SC-1":
info_text = "info_1";
Q_size = e.attributes.SIZE;
set("questions.mSC-1:Q_description",Q_description);
set("questions.mSC-1:Q_audio",e.attributes.AUDIO);
var chid = 0;
var i = 0;
while(i < e.childNodes.length)
{
if(e.childNodes[i].nodeName == "CHOICE")
{
set("questions.mSC-1:sc_choice_id" + chr(97 + chid),e.childNodes[i].attributes.CHOICE_ID);
set("questions.mSC-1:sc_text" + chr(97 + chid),e.childNodes[i].firstChild.nodeValue);
set("questions.mSC-1:sc_correct" + chr(97 + chid),e.childNodes[i].attributes.CORRECT);
set("questions.mSC-1:sc_score" + chr(97 + chid),e.childNodes[i].attributes.SCORE);
chid++;
}
i++;
}
break;
case "EX-1":
info_text = "info_4";
Q_size = e.attributes.SIZE;
var chid = 0;
var i = 0;
while(i < e.childNodes.length)
{
if(e.childNodes[i].nodeName == "CHOICE")
{
set("questions.mEX_1:ex_choice_id" + chr(97 + chid),e.childNodes[i].attributes.CHOICE_ID);
set("questions.mEX_1:ex_image" + chr(97 + chid),e.childNodes[i].attributes.IMAGE);
set("questions.mEX_1:ex_audio" + chr(97 + chid),e.childNodes[i].attributes.AUDIO);
chid++;
}
i++;
}
}
}
else
{
err = "1";
}
Q_starttime = int(getTimer() / 1000);
Q_stoptime = 0;
if(err != "0")
{
}
}
var _PageNumber = 1;
var _MaxPages = 3;
var _FirstQuestion = true;
var _StartTime = Number(int(getTimer() / 1000));