Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Action script...
- // [onClipEvent of sprite 65 in frame 15]
- onClipEvent (load)
- {
- setProperty("", _visible, false);
- }
- // [onClipEvent of sprite 65 in frame 15]
- onClipEvent (load)
- {
- setProperty("", _visible, false);
- }
- // [onClipEvent of sprite 126 in frame 15]
- onClipEvent (load)
- {
- setProperty("", _visible, false);
- }
- // [Action in Frame 1]
- testName = "Trigonometry - missing angles";
- testID = 1131;
- useCalc = true;
- function showanswers(numstart, numboxes, questionnum, mymaths, tidyup)
- {
- theAnswers = new Array();
- for (i = numstart; i <= numboxes; i++)
- {
- if (questionnum == 1)
- {
- theAnswers[i] = q1answers[i];
- } // end if
- if (questionnum == 2)
- {
- theAnswers[i] = q2answers[i];
- } // end if
- } // end of for
- ansMovie = eval("q" + questionnum + "ansmov");
- for (i = numstart; i <= numboxes; i++)
- {
- obj = eval("box" + i);
- wid = obj._width;
- ht = obj._height;
- x = obj._x;
- y = obj._y + ht / 1.500000E+000;
- an = obj.text;
- showThis = true;
- an = roundit(obj.text);
- if (an == "")
- {
- obj.text = " ";
- showThis = false;
- } // end if
- answer = "answer" + i;
- obj2 = eval("box" + (i + 1));
- xgap = Math.abs(obj2._x - obj._x);
- ygap = obj2._y - obj._y;
- ans = theAnswers[i];
- fraction = false;
- if (ygap <= ht && ygap > 0 && xgap < wid)
- {
- fraction = true;
- x = obj._x + wid;
- y = obj._y;
- ht = ht * 2;
- temp = String(theAnswers[i + 1]);
- linelength = temp.length;
- an = an / obj2.text;
- cancelDown(theAnswers[i], theAnswers[i + 1]);
- ans = showFracVals[0] / showFracVals[1];
- theAnswers[i] = showFracVals[0] + "\n" + showFracVals[1];
- theAnswers[i + 1] = "";
- } // end if
- if (an != ans && ShowThis)
- {
- ansMovie.createTextField(answer, i, x, y, wid, ht);
- answer = eval(ansMovie + ".answer" + i);
- answer.text = theAnswers[i];
- if (fraction)
- {
- line = "line" + i;
- ansMovie.createEmptyMovieClip(line, 100 + i);
- obj = eval(ansMovie + "." + line);
- lineLength = linelength * 5;
- with (obj)
- {
- lineStyle(2, 10066380, 100);
- moveTo(x + wid / 2 - lineLength, y + ht / 2.200000E+000);
- lineTo(x + wid / 2 + lineLength, y + ht / 2.200000E+000);
- } // End of with
- } // end if
- answer.multiline = true;
- answer.wordWrap = true;
- answer.border = false;
- myformat = new TextFormat();
- objFormat = obj.getTextFormat();
- myformat.color = 10066380;
- if (objFormat.font == null)
- {
- myformat.font = "Verdana";
- myformat.size = 16;
- myformat.align = "center";
- }
- else
- {
- myformat.font = objFormat.font;
- myformat.size = objFormat.size;
- myformat.align = objFormat.align;
- } // end else if
- answer.embedFonts = true;
- answer.selectable = false;
- answer.setTextFormat(myformat);
- } // end if
- } // end of for
- } // End of the function
- function cancelDown(a, b)
- {
- for (j = 0; j < div.length; j++)
- {
- fac = div[j];
- if (Math.round(a / fac) == a / fac && Math.round(b / fac) == b / fac)
- {
- a = a / fac;
- b = b / fac;
- --j;
- } // end if
- } // end of for
- showFracVals = new Array(a, b);
- } // End of the function
- div = new Array(2, 3, 5, 7, 11, 13, 17, 19, 23);
- function roundit(txt)
- {
- if (isNaN(txt))
- {
- l = txt.length;
- txt = txt.toLowerCase();
- for (iCount = 0; iCount <= l; iCount++)
- {
- if (txt.charAt(iCount) == "\"")
- {
- txt = txt.substr(0, iCount) + "@" + txt.substr(iCount + 1, l);
- } // end if
- } // end of for
- l = txt.length;
- for (iCount = 0; iCount <= l; iCount++)
- {
- if (txt.charAt(iCount) == " ")
- {
- txt = txt.substr(0, iCount) + "" + txt.substr(iCount + 1, l);
- --iCount;
- --l;
- } // end if
- } // end of for
- txt = String(txt.toLowerCase());
- }
- else
- {
- txt = Math.round(1000 * txt) / 1000;
- } // end else if
- return (txt);
- } // End of the function
- function despace(txt)
- {
- txt = roundit(txt);
- return (txt);
- } // End of the function
- function inputbox(v)
- {
- for (i = 1; i <= v; i++)
- {
- obj = eval("box" + i);
- obj.tabIndex = i;
- obj.type = "input";
- obj.selectable = true;
- obj.textColor = "0x660000";
- obj.borderColor = "0xcccccc";
- } // end of for
- } // End of the function
- function dynamicbox(v)
- {
- for (i = 1; i <= v; i++)
- {
- obj = eval("box" + i);
- obj.type = "dynamic";
- obj.selectable = false;
- obj.textColor = "0x000000";
- obj.border = false;
- } // end of for
- } // End of the function
- function common(p, q, r)
- {
- flag = false;
- for (i = 0; i < div.length; i++)
- {
- fac = div[i];
- if (rnd(p, fac) && rnd(q, fac) && rnd(r, fac))
- {
- flag = true;
- break;
- } // end if
- } // end of for
- if (flag)
- {
- return (true);
- }
- else
- {
- return (false);
- } // end else if
- } // End of the function
- function rnd(val, fact)
- {
- if (Math.round(val / fact) == val / fact)
- {
- return (true);
- }
- else
- {
- return (false);
- } // end else if
- } // End of the function
- function markit(an1, an2, ansa, ansb, tic1, tic2)
- {
- thisscore = 0;
- tic1._visible = false;
- tic2._visible = false;
- an1 = roundit(an1);
- an2 = roundit(an2);
- if (an1 == ansa && an2 == ansb || an2 == ansa && an1 == ansb)
- {
- tic1._visible = true;
- tic2._visible = true;
- thisscore = thisscore + 2;
- }
- else if (an1 == ansa && an2 != ansa || an1 == ansb && an2 != ansb)
- {
- tic1._visible = true;
- ++thisscore;
- }
- else if (an2 == ansa && an1 != ansa || an2 == ansb && an1 != ansb)
- {
- tic2._visible = true;
- ++thisscore;
- } // end else if
- return (thisscore);
- } // End of the function
- function markit2(an1, an2, ansa1, ansa2, ansb1, ansb2, tic1, tic2)
- {
- score = 0;
- tic1._visible = false;
- tic2._visible = false;
- if (an1 != "" && an2 != "")
- {
- an1 = roundit(an1);
- an2 = roundit(an2);
- if (an1 >= ansa1 && an1 <= ansa2 && (an2 >= ansb1 && an2 <= ansb2) || an2 >= ansa1 && an2 <= ansa2 && (an1 >= ansb1 && an1 <= ansb2))
- {
- tic1._visible = true;
- tic2._visible = true;
- score = score + 2;
- }
- else if (an1 >= ansa1 && an1 <= ansa2 && !(an2 >= ansa1 && an2 <= ansa2) || an1 >= ansb1 && an1 <= ansb2 && !(an2 >= ansb1 && an2 <= ansb2))
- {
- tic1._visible = true;
- ++score;
- }
- else if (an2 >= ansa1 && an2 <= ansa2 && !(an1 >= ansa1 && an1 <= ansa2) || !(an2 >= ansb1 && an2 <= ansb2) && !(an1 >= ansb1 && an1 <= ansb2))
- {
- tic2._visible = true;
- ++score;
- } // end else if
- return (score);
- } // end if
- } // End of the function
- rad = 5.729578E+001;
- now = new Date();
- year = now.getFullYear();
- yearnum = year - 2000;
- thisDay = now.getDate();
- testStamp = Number(testID) + Number(thisDay);
- testStamp = Math.pow(testStamp, 3) + testStamp;
- div = new Array(2, 3, 5, 7, 9, 11, 13, 17, 19, 23, 29);
- function repeatSave()
- {
- sCode = authCode * testID;
- sCode = sCode + q1score * 100 + Number(q2score);
- sCode = sCode * 10000;
- sCode = sCode + testID * testID;
- urls = "../../studentRecords/saveDataOH.asp?sCode=" + sCode + "&q1score=" + q1score + "&q2score=" + q2score + "&taskID=" + testID;
- loadVariablesNum(urls, 0);
- } // End of the function
- function loadLogin()
- {
- gCode = authCode * testID * testID + Number(username);
- urls = "../../studentRecords/getDataOH.asp?gCode=" + gCode + "&xlogin=" + username + "&xpass=" + xpass + "&taskID=" + testID;
- loadVariablesNum(urls, 0);
- } // End of the function
- function save()
- {
- total = Number(q1marks) + Number(q2marks);
- totscore = Number(q1score) + Number(q2score);
- if (q1marked && q2marked && !saved)
- {
- co._visible = true;
- coRem.play();
- perc = Math.round(totscore / total * 100);
- score = perc + "%";
- if (studentLogged)
- {
- if (perc >= percentage)
- {
- newrecord = true;
- newperc = perc;
- percentage = perc;
- }
- else
- {
- newrecord = false;
- newperc = percentage;
- } // end else if
- repeatSave();
- saved = true;
- } // end if
- } // end if
- } // End of the function
- stop ();
- // [Action in Frame 2]
- gotoAndStop(1);
- // [Action in Frame 4]
- stop ();
- username = xpass = login = "";
- box1.tabIndex = 1;
- box2.tabIndex = 2;
- Selection.setFocus(box1);
- studentLogged = false;
- if (useCalc)
- {
- calcComment._visible = false;
- } // end if
- // [Action in Frame 5]
- stop ();
- this.onEnterFrame = function ()
- {
- if (login == 2)
- {
- failed._visible = true;
- gotoAndStop(4);
- } // end if
- if (login == 1)
- {
- gotoAndPlay(8);
- } // end if
- };
- // [Action in Frame 6]
- gotoAndPlay(5);
- // [Action in Frame 8]
- details = ".: " + school + " | " + student + " :.";
- studentLogged = true;
- this.onEnterFrame = function ()
- {
- };
- gotoAndStop(10);
- // [Action in Frame 10]
- q1title = "Simple triangles";
- q1marks = 12;
- q1in1 = q1in2 = q1in3 = q1in4 = q1in5 = q1in6 = q1in7 = q1in8 = "";
- q1text1 = q1text2 = q1text3 = q1text4 = q1text5 = q1text6 = q1text7 = q1text8 = "";
- q1an1 = q1an2 = q1an3 = q1an4 = q1an5 = q1an6 = q1an7 = q1an8 = "";
- q1v1 = 2 + random(4);
- q1v2 = 2 + random(6);
- q1v3 = 2 + random(9);
- q1v4 = 3 + random(5) + (1 + random(9)) / 10;
- q1v5 = 3 + random(5) + (1 + random(9)) / 10;
- q1v6 = 3 + random(5) + (1 + random(9)) / 10;
- q1v1a = q1v1 + 1 + random(2);
- q1v2a = q1v2 * 2 + random(3);
- q1v3a = q1v3 * 2 - 1;
- q1v4a = q1v4 + 1 + (1 + random(9)) / 10;
- q1v5a = q1v5 + 1 + (1 + random(9)) / 10;
- q1v6a = q1v6 + (1 + random(9)) / 10;
- q1text1 = q1v1 + "cm";
- q1text2 = q1v2 + "cm";
- q1text3 = q1v3 + "cm";
- q1text4 = q1v4 + "cm";
- q1text5 = q1v5 + "cm";
- q1text6 = q1v6 + "cm";
- q1text1a = q1v1a + "cm";
- q1text2a = q1v2a + "cm";
- q1text3a = q1v3a + "cm";
- q1text4a = q1v4a + "cm";
- q1text5a = q1v5a + "cm";
- q1text6a = q1v6a + "cm";
- q1ans1 = 180 * Math.asin(q1v1 / q1v1a) / 3.141593E+000;
- q1ans2 = 180 * Math.atan(q1v2 / q1v2a) / 3.141593E+000;
- q1ans3 = 180 * Math.acos(q1v3 / q1v3a) / 3.141593E+000;
- q1ans4 = 180 * Math.acos(q1v4 / q1v4a) / 3.141593E+000;
- q1ans5 = 180 * Math.asin(q1v5 / q1v5a) / 3.141593E+000;
- q1ans6 = 180 * Math.atan(q1v6 / q1v6a) / 3.141593E+000;
- q1ans1 = roundit(Math.round(q1ans1));
- q1ans2 = roundit(Math.round(q1ans2));
- q1ans3 = roundit(Math.round(q1ans3));
- q1ans4 = roundit(Math.round(q1ans4));
- q1ans5 = roundit(Math.round(q1ans5));
- q1ans6 = roundit(Math.round(q1ans6));
- q1answers = new Array(0, q1ans1, q1ans2, q1ans3, q1ans4, q1ans5, q1ans6, q1ans7, q1ans8);
- q2title = "Harder questions";
- q2marks = 9;
- q2in1 = q2in2 = q2in3 = q2in4 = q2in5 = q2in6 = q2in7 = q2in8 = "";
- q2text1 = q2text2 = q2text3 = q2text4 = q2text5 = q2text6 = q2text7 = q2text8 = "";
- q2v1 = q2v2 = q2v3 = q2v4 = q2v5 = q2v6 = q2v7 = q2v8 = "";
- q2an1 = q2an2 = q2an3 = q2an4 = q2an5 = q2an6 = q2an7 = q2an8 = "";
- q2v1 = 9 + random(6);
- q2v1a = q2v1 - 2 - random(3);
- q2v2 = 15 + random(5);
- q2v2a = q2v2 - 3 - random(3);
- q2v3 = 20 + random(10);
- q2v3a = q2v3 - 7 - random(3);
- q2text1 = q2v1 + "cm";
- q2text1a = q2v1a + "cm";
- q2text2 = q2v2 + "cm";
- q2text2a = q2v2a + "cm";
- q2text3 = q2v3 + "cm";
- q2text3a = "BC = " + q2v3a + "cm.";
- q2k = 5.729578E+001;
- q2ans1 = q2k * Math.acos(q2v1a / (2 * q2v1));
- q2ans1 = roundit(Math.round(q2ans1));
- q2ans2 = q2k * 2 * Math.atan(q2v2a / q2v2);
- q2ans2 = roundit(Math.round(q2ans2));
- q2ans3a = q2k * Math.atan(q2v3a / q2v3);
- q2ans3b = q2k * Math.atan(q2v3a / (2 * q2v3));
- q2ans3 = q2ans3a - q2ans3b;
- q2ans3 = roundit(Math.round(q2ans3));
- q2answers = new Array(0, q2ans1, q2ans2, q2ans3, q2ans4, q2ans5, q2ans6, q2ans7, q2ans8);
- stop ();
- q1score = q2score = 0;
- totscore = "";
- total = q1marks + q2marks;
- q1grade = q2grade = q1marked = q2marked = saved = false;
- gotoAndStop(15);
- // [Action in Frame 15]
- q1button.onRelease = function ()
- {
- gotoAndStop(15);
- };
- q2button.onRelease = function ()
- {
- gotoAndStop(19);
- };
- q1button.onRollOver = function ()
- {
- if (!q1active)
- {
- q1button.gotoAndStop(2);
- } // end if
- };
- q1button.onRollOut = function ()
- {
- if (!q1active)
- {
- q1button.gotoAndStop(1);
- } // end if
- };
- q2button.onRollOver = function ()
- {
- if (!q2active)
- {
- q2button.gotoAndStop(2);
- } // end if
- };
- q2button.onRollOut = function ()
- {
- if (!q2active)
- {
- q2button.gotoAndStop(1);
- } // end if
- };
- if (!useCalc)
- {
- calc.nextFrame();
- } // end if
- q2button.gotoAndStop(1);
- q1button.gotoAndStop(3);
- unloadMovieNum(10000);
- q1active = true;
- q2active = false;
- if (q1marked)
- {
- nextFrame ();
- }
- else
- {
- Selection.setFocus("box1");
- inputbox(8);
- } // end else if
- // [Action in Frame 16]
- showanswers(1, 8, 1);
- q1marked = true;
- unloadMovieNum(10000);
- q1score = 0;
- butlab1._alpha = 40;
- dynamicbox(8);
- an = roundit(q1an1);
- if (an == q1ans1)
- {
- q1score = q1score + 2;
- q1t1._visible = true;
- } // end if
- an = roundit(q1an2);
- if (an == q1ans2)
- {
- q1score = q1score + 2;
- q1t2._visible = true;
- } // end if
- an = roundit(q1an3);
- if (an == q1ans3)
- {
- q1score = q1score + 2;
- q1t3._visible = true;
- } // end if
- an = roundit(q1an4);
- if (an == q1ans4)
- {
- q1score = q1score + 2;
- q1t4._visible = true;
- } // end if
- an = roundit(q1an5);
- if (an == q1ans5)
- {
- q1score = q1score + 2;
- q1t5._visible = true;
- } // end if
- an = roundit(q1an6);
- if (an == q1ans6)
- {
- q1score = q1score + 2;
- q1t6._visible = true;
- } // end if
- summary = "You have scored " + q1score + " out of " + q1marks + " on this question.";
- if (q1score == q1marks)
- {
- q1grade = true;
- q1completed._visible = true;
- } // end if
- save();
- // [Action in Frame 19]
- q1button.gotoAndStop(1);
- q2button.gotoAndStop(3);
- unloadMovieNum(10000);
- q1active = false;
- q2active = true;
- if (q2marked)
- {
- nextFrame ();
- }
- else
- {
- Selection.setFocus("box1");
- inputbox(8);
- } // end else if
- // [Action in Frame 20]
- showanswers(1, 8, 2);
- q2marked = true;
- unloadMovieNum(10000);
- q2score = 0;
- butlab2._alpha = 40;
- dynamicbox(8);
- an = roundit(q2an1);
- if (an == q2ans1)
- {
- q2score = q2score + 2;
- q2t1._visible = true;
- }
- else if (an == q2ans1 + 1 || an == q2ans1 - 1)
- {
- q2score = q2score + 1;
- } // end else if
- an = roundit(q2an2);
- if (an == q2ans2)
- {
- q2score = q2score + 3;
- q2t2._visible = true;
- }
- else if (an == q2ans2 + 1 || an == q2ans2 - 1)
- {
- q2score = q2score + 2;
- } // end else if
- an = roundit(q2an3);
- if (an == q2ans3)
- {
- q2score = q2score + 4;
- q2t3._visible = true;
- }
- else if (an == q2ans3 + 1 || an == q2ans3 - 1)
- {
- q2score = q2score + 3;
- } // end else if
- summary = "You have scored " + q2score + " out of " + q2marks + " on this question.";
- if (q2score == q2marks)
- {
- q2grade = true;
- q2completed._visible = true;
- } // end if
- save();
- // [Action in Frame 23]
- q1todayperc = Math.round(q1score / q1marks * 100);
- q2todayperc = Math.round(q2score / q2marks * 100);
- if (q1perc >= 40)
- {
- summtable.q1face.nextFrame();
- } // end if
- if (q1perc >= 70)
- {
- summtable.q1face.nextFrame();
- } // end if
- if (q2perc >= 40)
- {
- summtable.q2face.nextFrame();
- } // end if
- if (q2perc >= 70)
- {
- summtable.q2face.nextFrame();
- } // end if
- if (percentage >= 40)
- {
- summtable.ovface.nextFrame();
- } // end if
- if (percentage >= 70)
- {
- summtable.ovface.nextFrame();
- } // end if
- ++attempts;
- stop ();
- // [Action in Frame 24]
- q1todayperc = Math.round(q1score / q1marks * 100);
- q2todayperc = Math.round(q2score / q2marks * 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement