Frame 1
_root.edviewer_player.viewscreen.watch_btn.pick();
_root.edviewer_player.watch_btn.pick();
Symbol 4 MovieClip [quizClass] Frame 1
function initTryQuiz(target) {
var _local2 = [{type:"mc", label:"Q1", audio:"Q1", responses:["Q1correct", "Q1wrongB", "Q1wrongC"]}, {type:"mc", label:"Q2", audio:"Q2", responses:["Q2wrongAB", "Q2wrongAB", "Q2correct"]}, {type:"mc", label:"Q3", audio:"Q3", responses:["Q3wrongA", "Q3correct", "Q3wrongC"]}, {type:"mc", label:"Q4", audio:"Q4", responses:["Q4wrongA", "Q4wrongB", "Q4correct"]}, {type:"mc", label:"Q5", audio:"Q5", responses:["Q5wrongA", "Q5correct", "Q5wrongC"]}, {type:"mc", label:"Q6", audio:"Q6", responses:["Q6wrongA", "Q6wrongB", "Q6correct"]}];
var _local1 = new QuizClass(target, _local2, "think-Leadout");
return(_local1);
}
function initApplyQuiz(target) {
var _local2 = [{type:"mc", label:"AQ1", audio:"Question1", responses:["Q1correct", "Q1wrong", "Q1wrong"], pmAnswer:"A"}, {type:"mc", label:"AQ2", audio:"Question2", responses:["Q2wrong", "Q2correct", "Q2wrong"], pmAnswer:"B"}, {type:"mc", label:"AQ3", audio:"Question3", responses:["Q3wrong", "Q3wrong", "Q3correct"], pmAnswer:"C"}, {type:"mc", label:"AQ4", audio:"Question4", responses:["Q4correct", "Q4wrong", "Q4wrong"], pmAnswer:"A"}, {type:"mc", label:"AQ5", audio:"Question5", responses:["Q5wrong", "Q5correct", "Q5wrong"], pmAnswer:"B"}, {type:"mc", label:"AQ6", audio:"Question6", responses:["Q6correct", "Q6wrong", "Q6wrong"], pmAnswer:"A"}, {type:"mc", label:"AQ7", audio:"Question7", responses:["Q7wrong", "Q7wrong", "Q7correct"], pmAnswer:"C"}, {type:"mc", label:"AQ8", audio:"Question8", responses:["Q8wrong", "Q8correct", "Q8wrong"], pmAnswer:"B"}];
var _local1 = new QuizClass(target, _local2, "apply-Leadout");
_local1.usePointManager = true;
return(_local1);
}
function QuizClass(timeline, questions, leadout) {
this.timeline = timeline;
this.questions = questions;
this.leadout = leadout;
this.crntQstn = -1;
this.usePointManager = false;
this.questions = new Array();
var _local3 = questions.length;
var _local5 = 0;
while (_local5 < _local3) {
var _local6 = questions[_local5];
var _local4 = new Object();
switch (_local6.type) {
case "mc" :
_local4 = new MultipleChoiceQuestion(this, _local6);
break;
case "dd" :
_local4 = new DragDropQuestion(this, _local6);
}
this.questions.push(_local4);
_local5++;
}
this.nextQuestion = function (qstnIndex) {
var _local4 = this;
this.crntQstn++;
if (qstnIndex != undefined) {
this.crntQstn = qstnIndex;
}
if (this.crntQstn < this.questions.length) {
var _local2 = this.questions[this.crntQstn];
this.timeline.gotoAndStop(_local2.label);
this.timeline.dialog.gotoAndPlay(_local2.audio);
_local2.draw();
} else {
this.timeline.gotoAndPlay(this.leadout);
}
};
this.introNextQuestion = function () {
var _local4 = this;
var _local2 = this.crntQstn + 1;
if (_local2 < this.questions.length) {
var _local3 = this.questions[_local2];
this.timeline.gotoAndPlay(_local3.label + "-intro");
} else {
this.nextQuestion();
}
};
this.gotoResponse = function (goto) {
var _local2 = goto.split(".");
if (_local2.length < 2) {
_local2.unshift("dialog");
}
var _local4 = _local2[0];
var _local3 = _local2[1];
this.timeline[_local4].gotoAndPlay(_local3);
};
this.replayQuestion = function () {
var _local2 = this.questions[this.crntQstn];
this.timeline.replayQstn.gotoAndPlay(_local2.audio);
};
this.checkAnswer = function () {
var _local2 = this.questions[this.crntQstn];
_local2.check();
};
this.showHint = function () {
var _local2 = this.questions[this.crntQstn];
_local2.showHint();
};
this.freeze = function () {
var _local2 = this.questions[this.crntQstn];
_local2.onFreeze();
};
this.unfreeze = function () {
var _local2 = this.questions[this.crntQstn];
_local2.onUnfreeze();
};
this.onTextInput = function (newText) {
var _local2 = this.questions[this.crntQstn];
_local2.onTextInput(newText);
};
this.broadcastPoints = function (qstn) {
if (this.usePointManager) {
var _local3 = qstn.pmAnswer;
var _local6 = qstn.trys;
var _local4 = this.crntQstn + 1;
var _local5 = this.questions.length;
trace("-- points management call from ed video --");
trace("correct answer: " + _local3);
trace("answer attempt: " + _local6);
trace("question num: " + _local4);
trace("number of q's: " + _local5);
trace("------------------------------------------");
trace("");
_root.points_management.questionAnswered(_local3, _local6, _local4, _local5);
}
};
this.nextQuestion();
}
function MultipleChoiceQuestion(owner, qstnData) {
this.owner = owner;
this.trys = 0;
this.choices = new Array();
this.crntChoice;
for (var _local7 in qstnData) {
this[_local7] = qstnData[_local7];
}
this.draw = function () {
var _local5 = this.owner.timeline;
var o = this;
var _local3 = 0;
var _local6 = function () {
o.choiceClick(this.position);
};
while (true) {
_local3++;
var _local4 = "choice" + _local3;
var _local2 = _local5[_local4];
if (_local2 == undefined) {
break;
}
_local2.position = _local3;
_local2.onRelease = _local6;
this.choices.push(_local2);
}
if (this.answer != undefined) {
owner.timeline.hilight.gotoAndStop(1);
}
};
this.choiceClick = function (choicePosition) {
this.crntChoice = choicePosition;
if (this.input == undefined) {
this.check();
} else {
this.selectChoice(choicePosition);
}
};
this.selectChoice = function (position) {
choicePosition = 0;
while (true) {
choicePosition++;
var _local3 = "choice" + choicePosition;
var _local2 = this.owner.timeline[_local3];
if (_local2 == undefined) {
break;
}
if (choicePosition == position) {
_local2._alpha = 100;
continue;
}
_local2._alpha = 50;
}
};
this.showHint = function () {
this.owner.gotoResponse(this.hint);
};
this.check = function () {
this.trys++;
var _local2 = this.responses[this.crntChoice - 1];
if (typeof(_local2) != "string") {
var _local5 = Math.floor(Math.random() * _local2.length);
_local2 = _local2[_local5];
}
if (_local2 != undefined) {
this.owner.gotoResponse(_local2);
this.onFreeze();
}
var _local4 = ["A", "B", "C", "D", "E", "F", "G", "H"];
var _local3 = _local4[this.crntChoice - 1] == this.pmAnswer;
if (_local3) {
this.owner.broadcastPoints(this);
}
};
this.onFreeze = function () {
var _local4 = this.choices.length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = this.choices[_local2];
_local3.enabled = false;
_local2++;
}
};
this.onUnfreeze = function () {
var _local4 = this.choices.length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = this.choices[_local2];
_local3.enabled = true;
_local2++;
}
};
this.onTextInput = function (newText) {
this.textInput = newText;
};
}
function DragDropQuestion(owner, qstnData) {
this.owner = owner;
for (var _local11 in qstnData) {
this[_local11] = qstnData[_local11];
}
this.drags = new Array();
this.drops = new Array();
this.draw = function () {
var _local6 = this.owner.timeline;
var o = this;
_local6.createEmptyMovieClip("aboveAll_mc", 200);
var _local7 = function () {
var _local2 = this._parent;
_local2.swapDepths(_local2._parent.aboveAll_mc);
_local2.startDrag();
};
var _local8 = function () {
var _local2 = this._parent;
_local2.stopDrag();
_local2._parent.aboveAll_mc.swapDepths(_local2);
var _local3 = o.hitDetect(_local2);
if (_local3 == undefined) {
_local2.reset();
} else {
if (_local3.linkTo == undefined) {
_local2.attach(_local3);
_local2.setLoc(_local3);
} else if (_local3.linkTo == _local2) {
_local2.setLoc(_local3);
} else {
_local3.linkTo.reset();
_local2.attach(_local3);
_local2.setLoc(_local3);
}
o.check();
}
};
this.drags = new Array();
var _local5 = 0;
while (true) {
var _local3 = "drag" + (_local5 + 1);
var _local2 = _local6[_local3];
if (_local2 == undefined) {
break;
}
_local2.btn.onPress = _local7;
_local2.btn.onRelease = (_local2.btn.onReleaseOutside = _local8);
_local2.origX = _local2._x;
_local2.origY = _local2._y;
_local2.control = this;
_local2.value = this.items[_local5];
_local2.attached = undefined;
_local2.reset = function () {
this.attached.linkTo = undefined;
this.attached = undefined;
this._x = this.origX;
this._y = this.origY;
};
_local2.setLoc = function (targetClip) {
this._x = targetClip._x - 134;
this._y = targetClip._y - 13;
};
_local2.attach = function (targetClip) {
this.attached.linkTo = undefined;
targetClip.linkTo = this;
this.attached = targetClip;
};
this.drags.push(_local2);
_local5++;
}
this.drops = new Array();
var _local4 = 1;
while (true) {
var _local3 = "drop" + _local4;
var _local2 = _local6[_local3];
if (_local2 == undefined) {
break;
}
_local2.linkTo = undefined;
_local2.index = _local4 - 1;
this.drops.push(_local2);
_local4++;
}
_local6.hint_btn.onRelease = function () {
o.hint();
};
_local6.check_btn.onRelease = function () {
o.check();
};
};
this.showHint = function () {
trace("show hint");
};
this.check = function () {
var _local4 = true;
var _local3 = true;
var _local6 = this.drops.length;
var _local2 = 0;
while (_local2 < _local6) {
if (this.links[_local2] != "") {
if (this.links[_local2] != this.drops[_local2].linkTo.value) {
_local3 = false;
}
}
if (this.drops[_local2].linkTo.value == undefined) {
_local4 = false;
}
_local2++;
}
if (_local4) {
if (_local3) {
var _local5 = this.correct;
} else {
var _local5 = this.wrong;
}
if (typeof(_local5) != "string") {
var _local7 = Math.floor(Math.random() * _local5.length);
var _local5 = _local5[_local7];
}
this.owner.gotoResponse(_local5);
}
};
this.hitDetect = function (dragClip) {
var _local5;
var _local7 = this.owner.timeline;
var _local4 = this.drops.length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = this.drops[_local2];
if (dragClip.hitTest(_local3)) {
_local5 = _local3;
break;
}
_local2++;
}
return(_local5);
};
this.arrayContains = function (list, item) {
var _local2 = false;
var _local3 = list.length;
var _local1 = 0;
while (_local1 < _local3) {
if (list[_local1] == item) {
_local2 = true;
break;
}
_local1++;
}
return(_local2);
};
}
this._visible = false;
stop();