home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2007-03-19 | 67.8 KB | 1,539 lines
class com.argosy.ui.QuestionViewer extends com.argosy.ui.LabelViewer { var current_question; var question_holder; var check_button; var feedback_tf; var feedback_icon; var button_holder; var xml_loader; var question_array; var base_url; var questionMode; var summary_alert; var isTimedExam; var activity_timer; var uiPanel; var summary_mc; var load_bar; var instructions_tf; var caption_tf; var location_tf; var image_holder; var image_loader; var mask; var onEnterFrame; var bg; var back_button; var next_button; static var label_style; static var color_array = [null,11653866,7983018,8243956,10003677,3983555,48851]; var isComplete = false; var activity_time_limit = 1; var image_loaded = false; var uiPanelWidth = 220; var showAllOutlines = false; var showAllLabels = false; var showRollOvers = true; function QuestionViewer() { super(); } function recordAnswer() { switch(this.current_question.type) { case "fill_in": var _loc4_ = false; for(var _loc3_ in this.current_question.answers) { if(this.trimSpaces(this.current_question.user_input).toLowerCase() == this.trimSpaces(this.current_question.answers[_loc3_]).toLowerCase()) { _loc4_ = true; } } break; case "multi_choice": _loc4_ = false; if(this.current_question.selection.correct == "true") { _loc4_ = true; } break; case "true_false": _loc4_ = false; if(this.current_question.user_input == this.current_question.answer) { _loc4_ = true; } break; case "matching": _loc4_ = true; this.current_question.correct_count = 0; this.current_question.question_count = this.question_holder.questions.length; var _loc3_ = 0; while(_loc3_ < this.question_holder.questions.length) { if(this.current_question.user_input[_loc3_].answer == this.current_question.user_input[_loc3_].user_input || this.current_question.user_input[_loc3_].answer.toUpperCase() == this.current_question.user_input[_loc3_].user_input.toUpperCase()) { this.current_question.user_input[_loc3_].isCorrect = true; this.current_question.correct_count = this.current_question.correct_count + 1; } else { this.current_question.user_input[_loc3_].isCorrect = false; _loc4_ = false; } _loc3_ = _loc3_ + 1; } break; case "flag": case "pin": _loc4_ = true; this.current_question.correct_count = 0; this.current_question.question_count = this.question_holder.flags.length; if(this.current_question.user_input == undefined) { _loc4_ = false; } else { _loc3_ = 0; while(_loc3_ < this.question_holder.flags.length) { if(this.current_question.user_input[_loc3_].correct == this.current_question.user_input[_loc3_].user) { this.current_question.correct_count = this.current_question.correct_count + 1; } else { _loc4_ = false; } _loc3_ = _loc3_ + 1; } } } this.current_question.isCorrect = _loc4_; this.current_question.isGraded = true; _global.setTimeout(this,"recordImage",100); } function recordImage() { if(this.image_loaded) { if(this.current_question.image == undefined) { this.current_question.image = new flash.display.BitmapData(this.width,this.height); } this.current_question.image.draw(this); } else { _global.setTimeout(this,"recordImage",100); } } function checkAnswer() { this.recordFlagData(); this.check_button.enabled = false; this.check_button._alpha = 50; this.current_question.locked = true; this.revealAnswer(); _global.setTimeout(this,"recordImage",10); } function restoreFeedback() { this.check_button.enabled = false; this.check_button._alpha = 50; var _loc2_ = this.current_question.isCorrect; } function revealAnswer() { if(this.current_question.locked) { this.check_button.enabled = false; this.check_button._alpha = 50; } else { this.check_button.enabled = true; this.check_button._alpha = 100; } var _loc3_ = this.current_question.isCorrect; switch(this.current_question.type) { case "fill_in": this.question_holder.input_tf.type = "dynamic"; if(_loc3_) { this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>"; this.feedback_icon.gotoAndStop("correct"); } else { this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong><br/><location>The correct answer is:<br/></location><right>" + this.current_question.answers[0] + "</right></p>"; this.feedback_icon.gotoAndStop("incorrect"); } break; case "multi_choice": for(var _loc2_ in this.current_question.options) { this.current_question.options[_loc2_].mc.enabled = false; if(this.current_question.options[_loc2_].correct == "true") { this.current_question.options[_loc2_].mc.radio_button.gotoAndStop("correct"); } } if(_loc3_) { this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>"; this.current_question.selection.mc.feedback.gotoAndStop("correct"); } else { this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong><br/><location>The correct answer is:<br/></location><right>" + this.current_question.answer_text + "</right></p>"; this.current_question.selection.mc.feedback.gotoAndStop("incorrect"); this.current_question.selection.mc.radio_button.gotoAndStop("incorrect"); } break; case "true_false": this.question_holder.true_button.enabled = false; this.question_holder.false_button.enabled = false; var _loc4_ = this.current_question.answer.split(""); _loc4_[0] = _loc4_[0].toUpperCase(); var _loc5_ = _loc4_.join(""); if(_loc3_) { this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>"; this.feedback_icon.gotoAndStop("correct"); } else { this.feedback_tf._y = this.check_button._y + this.check_button._height + 10; this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong><br/><location>The correct answer is:<br/></location><right>" + _loc5_ + "</right></p>"; } break; case "matching": var _loc2_ = 0; while(_loc2_ < this.question_holder.questions.length) { this.question_holder.questions[_loc2_].input_tf.textEnabled = false; _loc2_ = _loc2_ + 1; } _loc2_ = 0; while(_loc2_ < this.question_holder.questions.length) { if(this.current_question.user_input[_loc2_].isCorrect) { this.question_holder.questions[_loc2_].feedback.gotoAndStop("correct"); this.question_holder.questions[_loc2_].feedback_tf.htmlText = "<p></p>"; } else { this.question_holder.questions[_loc2_].feedback.gotoAndStop("incorrect"); this.question_holder.questions[_loc2_].feedback_tf.htmlText = "<p><wrong>" + this.current_question.user_input[_loc2_].answer + "</wrong></p>"; _loc3_ = false; } _loc2_ = _loc2_ + 1; } if(_loc3_) { this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>"; } else { this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong></p>"; } break; case "flag": case "pin": _loc2_ = 0; while(_loc2_ < this.question_holder.flags.length) { this.question_holder.flags[_loc2_].enabled = false; this.question_holder.flags[_loc2_].dragDummy.enabled = false; _loc2_ = _loc2_ + 1; } if(this.current_question.user_input != undefined) { _loc2_ = 0; while(_loc2_ < this.question_holder.flags.length) { if(this.current_question.user_input[_loc2_].correct == this.current_question.user_input[_loc2_].user) { this.question_holder.flags[_loc2_].feedback.gotoAndStop("correct"); this.question_holder.correct_count = this.question_holder.correct_count + 1; } else { this.question_holder.flags[_loc2_].feedback.gotoAndStop("incorrect"); _loc3_ = false; } _loc2_ = _loc2_ + 1; } } else { _loc2_ = 0; while(_loc2_ < this.question_holder.flags.length) { this.question_holder.flags[_loc2_].feedback.gotoAndStop("incorrect"); _loc2_ = _loc2_ + 1; } _loc3_ = false; } this.showCorrectFlags(); if(_loc3_) { this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>"; } else { this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong><br/><location>Correct placement is now shown.</location></p>"; } } this.current_question.isCorrect = _loc3_; if(this.feedback_icon._currentframe == 1 || this.feedback_icon == undefined) { while(this.feedback_tf._y + this.feedback_tf._height + 10 >= this.button_holder._y && this.feedback_tf._y > this.check_button._y + this.check_button._height + 5) { this.feedback_tf._y -= 1; } } else { while(this.feedback_tf._y + this.feedback_tf._height + 10 >= this.button_holder._y && this.feedback_tf._y > this.feedback_icon._y + this.feedback_icon._height + 5) { this.feedback_tf._y -= 1; } } } function loadContent(url) { this.xml_loader.load(url); } function xml_loaded(success) { if(success == false || this.xml_loader.status != 0) { trace("XML Loaded: " + success + " XML Parse Error: " + this.xml_loader.status); } else { this.question_array = []; this.base_url = this.xml_loader.firstChild.attributes.base_url; this.questionMode = this.xml_loader.firstChild.attributes.type; var _loc3_ = 0; while(_loc3_ < this.xml_loader.firstChild.childNodes.length) { if(this.xml_loader.firstChild.childNodes[_loc3_].nodeName == "question") { var _loc2_ = new Object(); _loc2_.id = this.xml_loader.firstChild.childNodes[_loc3_].attributes.id; _loc2_.type = this.xml_loader.firstChild.childNodes[_loc3_].attributes.type; _loc2_.index = this.question_array.length; _loc2_.isCorrect = null; _loc2_.isGraded = false; _loc2_.locked = false; _loc2_.memory = false; _loc2_.summary = ""; switch(_loc2_.type) { case "fill_in": this.createFillinQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]); break; case "multi_choice": this.createMultiChoiceQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]); break; case "true_false": this.createTrueFalseQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]); break; case "flag": case "pin": this.createFlagQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]); break; case "matching": this.createMatchingQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]); } this.question_array.push(_loc2_); } _loc3_ = _loc3_ + 1; } } this.activity_time_limit = this.question_array.length * 40 / 60; this.startActivity(); } function startActivity(timer_flag) { this.isComplete = false; if(this.questionMode == "Lab Practical") { if(timer_flag == undefined) { this.summary_alert.setContent("Timed Exam","Do you want to activate the timer for the lab practical? Doing so will limit how much time you can spend on each question. ","YES","NO",this,"startActivity"); } else { this.isTimedExam = timer_flag; if(this.isTimedExam) { this.activity_timer.start_timer(this.activity_time_limit); } else { this.activity_timer.clear_timer(); } this.loadQuestion(this.question_array[0]); } } else { this.activity_timer.clear_timer(); this.loadQuestion(this.question_array[0]); } this.uiPanel._visible = true; } function reset() { this.summary_mc.clearContent(); for(var _loc2_ in this.question_array) { this.question_array[_loc2_].user_input = null; this.question_array[_loc2_].selection = null; this.question_array[_loc2_].question_count = null; this.question_array[_loc2_].correct_count = null; this.question_array[_loc2_].isCorrect = null; this.question_array[_loc2_].isGraded = false; this.question_array[_loc2_].locked = false; this.question_array[_loc2_].memory = false; this.question_array[_loc2_].summary = ""; delete this.question_array[_loc2_].image; } this.startActivity(); } function createMatchingQuestion(new_question, node) { new_question.user_input = []; new_question.questions = []; var _loc7_ = 0; while(_loc7_ < node.childNodes.length) { var _loc1_ = node.childNodes[_loc7_]; switch(_loc1_.nodeName) { case "image": new_question.image_id = _loc1_.attributes.image_id; new_question.image_url = _loc1_.attributes.image_url; new_question.hotspot_array = []; var _loc2_ = 0; while(_loc2_ < _loc1_.childNodes.length) { if(_loc1_.childNodes[_loc2_].nodeName == "caption") { new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue; } else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot") { var _loc3_ = new com.argosy.ui.LabelHotSpot(); _loc3_.showAllOutlines = true; _loc3_.showRollOvers = false; _loc3_.showAllLabels = true; _loc3_.id = _loc1_.childNodes[_loc2_].attributes.id; _loc3_.color = _loc1_.childNodes[_loc2_].attributes.color; _loc3_.audio = _loc1_.childNodes[_loc2_].attributes.audio; _loc3_.type = _loc1_.childNodes[_loc2_].attributes.type; _loc3_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue; new_question.hotspot_array.push(_loc3_); } _loc2_ = _loc2_ + 1; } break; case "topinstructions": new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>"; break; case "instructions": new_question.instructions = _loc1_.firstChild.nodeValue; break; case "statement": var _loc6_ = new Object(); var _loc5_ = 0; while(_loc5_ < _loc1_.childNodes.length) { if(_loc1_.childNodes[_loc5_].nodeName == "matchtext") { _loc6_.id = _loc1_.childNodes[_loc5_].attributes.id; _loc6_.question_text = _loc1_.childNodes[_loc5_].firstChild.nodeValue; } else if(_loc1_.childNodes[_loc5_].nodeName == "answer") { _loc6_.answer_text = _loc1_.childNodes[_loc5_].firstChild.nodeValue; } _loc5_ = _loc5_ + 1; } new_question.questions.push(_loc6_); break; case "feedback": new_question.feedback = {}; for(var _loc9_ in _loc1_.childNodes) { new_question.feedback[_loc1_.childNodes[_loc9_].nodeName] = _loc1_.childNodes[_loc9_].firstChild.nodeValue; if(new_question.feedback[_loc1_.childNodes[_loc9_].nodeName].toLowerCase() == "correct.") { new_question.feedback[_loc1_.childNodes[_loc9_].nodeName] = "Correct"; } else if(new_question.feedback[_loc1_.childNodes[_loc9_].nodeName].toLowerCase() == "incorrect.") { new_question.feedback[_loc1_.childNodes[_loc9_].nodeName] = "Incorrect"; } } } _loc7_ = _loc7_ + 1; } } function createTrueFalseQuestion(new_question, node) { var _loc5_ = 0; while(_loc5_ < node.childNodes.length) { var _loc1_ = node.childNodes[_loc5_]; new_question.user_input = ""; switch(_loc1_.nodeName) { case "image": new_question.image_id = _loc1_.attributes.image_id; new_question.image_url = _loc1_.attributes.image_url; new_question.hotspot_array = []; var _loc2_ = 0; while(_loc2_ < _loc1_.childNodes.length) { if(_loc1_.childNodes[_loc2_].nodeName == "caption") { new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue; } else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot") { var _loc4_ = new com.argosy.ui.LabelHotSpot(); _loc4_.showAllOutlines = true; _loc4_.showRollOvers = false; _loc4_.showAllLabels = true; _loc4_.id = _loc1_.childNodes[_loc2_].attributes.id; _loc4_.color = _loc1_.childNodes[_loc2_].attributes.color; _loc4_.audio = _loc1_.childNodes[_loc2_].attributes.audio; _loc4_.type = _loc1_.childNodes[_loc2_].attributes.type; _loc4_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue; new_question.hotspot_array.push(_loc4_); } _loc2_ = _loc2_ + 1; } break; case "topinstructions": new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>"; break; case "instructions": new_question.instructions = _loc1_.firstChild.nodeValue; break; case "answer": case "answers": new_question.answer = _loc1_.attributes.correct; break; case "feedback": new_question.feedback = {}; for(var _loc7_ in _loc1_.childNodes) { new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = _loc1_.childNodes[_loc7_].firstChild.nodeValue; if(new_question.feedback[_loc1_.childNodes[_loc7_].nodeName].toLowerCase() == "correct.") { new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = "Correct"; } else if(new_question.feedback[_loc1_.childNodes[_loc7_].nodeName].toLowerCase() == "incorrect.") { new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = "Incorrect"; } } break; } _loc5_ = _loc5_ + 1; } } function createFillinQuestion(new_question, node) { var _loc6_ = 0; while(_loc6_ < node.childNodes.length) { var _loc1_ = node.childNodes[_loc6_]; new_question.user_input = ""; switch(_loc1_.nodeName) { case "image": new_question.image_id = _loc1_.attributes.image_id; new_question.image_url = _loc1_.attributes.image_url; new_question.hotspot_array = []; var _loc2_ = 0; while(_loc2_ < _loc1_.childNodes.length) { if(_loc1_.childNodes[_loc2_].nodeName == "caption") { new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue; } else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot") { var _loc4_ = new com.argosy.ui.LabelHotSpot(); _loc4_.showAllOutlines = true; _loc4_.showRollOvers = false; _loc4_.showAllLabels = true; _loc4_.id = _loc1_.childNodes[_loc2_].attributes.id; _loc4_.color = _loc1_.childNodes[_loc2_].attributes.color; _loc4_.audio = _loc1_.childNodes[_loc2_].attributes.audio; _loc4_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue; _loc4_.type = _loc1_.childNodes[_loc2_].attributes.type; new_question.hotspot_array.push(_loc4_); } _loc2_ = _loc2_ + 1; } break; case "topinstructions": new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>"; break; case "instructions": new_question.instructions = _loc1_.firstChild.nodeValue; break; case "answers": new_question.answers = []; var _loc5_ = 0; while(_loc5_ < _loc1_.childNodes.length) { new_question.answers.push(_loc1_.childNodes[_loc5_].firstChild.nodeValue); _loc5_ = _loc5_ + 1; } break; case "feedback": new_question.feedback = {}; for(var _loc8_ in _loc1_.childNodes) { new_question.feedback[_loc1_.childNodes[_loc8_].nodeName] = _loc1_.childNodes[_loc8_].firstChild.nodeValue; if(new_question.feedback[_loc1_.childNodes[_loc8_].nodeName].toLowerCase() == "correct.") { new_question.feedback[_loc1_.childNodes[_loc8_].nodeName] = "Correct"; } else if(new_question.feedback[_loc1_.childNodes[_loc8_].nodeName].toLowerCase() == "incorrect.") { new_question.feedback[_loc1_.childNodes[_loc8_].nodeName] = "Incorrect"; } } } _loc6_ = _loc6_ + 1; } } function createMultiChoiceQuestion(new_question, node) { var _loc9_ = 0; while(_loc9_ < node.childNodes.length) { var _loc1_ = node.childNodes[_loc9_]; switch(_loc1_.nodeName) { case "image": new_question.image_id = _loc1_.attributes.image_id; new_question.image_url = _loc1_.attributes.image_url; new_question.hotspot_array = []; var _loc2_ = 0; while(_loc2_ < _loc1_.childNodes.length) { if(_loc1_.childNodes[_loc2_].nodeName == "caption") { new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue; } else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot") { var _loc4_ = new com.argosy.ui.LabelHotSpot(); _loc4_.showAllOutlines = true; _loc4_.showRollOvers = false; _loc4_.showAllLabels = true; _loc4_.id = _loc1_.childNodes[_loc2_].attributes.id; _loc4_.color = _loc1_.childNodes[_loc2_].attributes.color; _loc4_.audio = _loc1_.childNodes[_loc2_].attributes.audio; _loc4_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue; _loc4_.type = _loc1_.childNodes[_loc2_].attributes.type; new_question.hotspot_array.push(_loc4_); } _loc2_ = _loc2_ + 1; } break; case "topinstructions": new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>"; break; case "instructions": new_question.instructions = _loc1_.firstChild.nodeValue; break; case "options": new_question.options = []; var _loc8_ = 0; while(_loc8_ < _loc1_.childNodes.length) { var _loc6_ = _loc1_.childNodes[_loc8_]; var _loc7_ = {}; _loc7_.id = _loc6_.attributes.id; _loc7_.correct = _loc6_.attributes.correct; var _loc5_ = 0; while(_loc5_ < _loc6_.childNodes.length) { switch(_loc6_.childNodes[_loc5_].nodeName) { case "label": _loc7_.label = _loc6_.childNodes[_loc5_].firstChild.nodeValue; break; case "feedback": _loc7_.feedback = _loc6_.childNodes[_loc5_].firstChild.nodeValue; } _loc5_ = _loc5_ + 1; } new_question.options.push(_loc7_); _loc8_ = _loc8_ + 1; } break; case "feedback": new_question.feedback = {}; for(var _loc11_ in _loc1_.childNodes) { new_question.feedback[_loc1_.childNodes[_loc11_].nodeName] = _loc1_.childNodes[_loc11_].firstChild.nodeValue; if(new_question.feedback[_loc1_.childNodes[_loc11_].nodeName].toLowerCase() == "correct.") { new_question.feedback[_loc1_.childNodes[_loc11_].nodeName] = "Correct"; } else if(new_question.feedback[_loc1_.childNodes[_loc11_].nodeName].toLowerCase() == "incorrect.") { new_question.feedback[_loc1_.childNodes[_loc11_].nodeName] = "Incorrect"; } } } _loc9_ = _loc9_ + 1; } } function createFlagQuestion(new_question, node) { var _loc5_ = 0; while(_loc5_ < node.childNodes.length) { var _loc1_ = node.childNodes[_loc5_]; switch(_loc1_.nodeName) { case "image": new_question.image_id = _loc1_.attributes.image_id; new_question.image_url = _loc1_.attributes.image_url; new_question.hotspot_array = []; var _loc2_ = 0; while(_loc2_ < _loc1_.childNodes.length) { if(_loc1_.childNodes[_loc2_].nodeName == "caption") { new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue; } else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot") { var _loc3_ = new com.argosy.ui.LabelHotSpot(); _loc3_.showAllOutlines = false; _loc3_.showRollOvers = false; _loc3_.showAllLabels = false; _loc3_.id = _loc1_.childNodes[_loc2_].attributes.id; _loc3_.color = _loc1_.childNodes[_loc2_].attributes.color; _loc3_.audio = _loc1_.childNodes[_loc2_].attributes.audio; _loc3_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue; _loc3_.type = _loc1_.childNodes[_loc2_].attributes.type; new_question.hotspot_array.push(_loc3_); } _loc2_ = _loc2_ + 1; } new_question.hotspot_array.sort(function(a, b) { return Math.round(Math.random() * 100 - 50); } ); break; case "topinstructions": new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>"; break; case "instructions": new_question.instructions = _loc1_.firstChild.nodeValue; break; case "feedback": new_question.feedback = {}; for(var _loc7_ in _loc1_.childNodes) { new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = _loc1_.childNodes[_loc7_].firstChild.nodeValue; if(new_question.feedback[_loc1_.childNodes[_loc7_].nodeName].toLowerCase() == "correct.") { new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = "Correct"; } else if(new_question.feedback[_loc1_.childNodes[_loc7_].nodeName].toLowerCase() == "incorrect.") { new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = "Incorrect"; } } } _loc5_ = _loc5_ + 1; } } function loadNextNumber() { if(this.questionMode == "Lab Practical") { } this.loadQuestionNumber(this.current_question.index + 1); } function loadLastNumber() { if(this.questionMode == "Lab Practical") { } this.loadQuestionNumber(this.current_question.index - 1); } function loadQuestionNumber(image_num) { if(image_num < 0) { image_num = this.question_array.length - 1; this.loadQuestion(this.question_array[image_num]); } else if(image_num >= this.question_array.length) { if(this.questionMode == "Lab Practical") { this.summary_alert.setContent("Activity Complete","You have completed this activity.<br/><br/>To submit your answers for grading and see a summary of your answers with feedback, click the \"GRADE\" button.<br/><br/>If you’re taking this exam online and your instructor is using an electronic gradebook, your score will be recorded.<br/><br/>To continue working on this activity, click the \"CANCEL\" button.","GRADE","CANCEL",this,"buildSummary"); } else { this.summary_alert.setContent("Activity Complete","You have completed this activity.<br/><br/>To see a summary of your answers with feedback and, if you choose, retake the quiz, click the \"SUBMIT\" button.<br/><br/>To continue working on this activity, click the \"CANCEL\" button.","SUBMIT","CANCEL",this,"buildSummary"); } } else { this.loadQuestion(this.question_array[image_num]); } } function submitScores(selection) { if(!selection) { return undefined; } this.stop_timer(); com.argosy.PALReporting.setData("PLACEHOLDER",new Date(),this.question_array,this.activity_timer.get_elapsed_time(),this.activity_timer.get_elapsed_time() + this.activity_timer.get_duration_time()); var results = new LoadVars(); results.onLoad = mx.utils.Delegate.create(this,function(success) { if(success && results.response == "SUCCESS") { this.summary_alert.setContent("Grades Sent","Server Response:" + results.response + " Submitted on:" + results.timestamp + " Click the \"OK\" button to see the results","OK",null,this,"buildSummary"); } else { this.summary_alert.setContent("Error Sending Grades","Server Response:" + results.response + " Do you want to retry?","YES","NO",this,"retrySubmitScores"); } } ); com.argosy.PALReporting.sendData(results); } function retrySubmitScores(selection) { if(!selection) { this.buildSummary(true); return undefined; } this.stop_timer(); com.argosy.PALReporting.setData("PLACEHOLDER",new Date(),this.question_array,this.activity_timer.get_elapsed_time(),this.activity_timer.get_elapsed_time() + this.activity_timer.get_duration_time()); var results = new LoadVars(); results.onLoad = mx.utils.Delegate.create(this,function(success) { if(success && results.response == "SUCCESS") { this.summary_alert.setContent("Grades Sent","Server Response:" + results.response + " Submitted on:" + results.timestamp + " Click the \"OK\" button to see the results","OK",null,this,"buildSummary"); } else { this.summary_alert.setContent("Error Sending Grades"," Do you want to retry?","YES","NO",this,"retrySubmitScores"); } } ); com.argosy.PALReporting.sendData(results); } function quiz_time_up(evt) { this.summary_alert.setContent("Time Up!","You have run out of time for this activity.<br/><br/>To submit your answers for grading and see a summary of your answers with feedback, click the \"GRADE\" button.<br/><br/>If you\'re taking this exam online and your instructor is using an electronic gradebook, your score will be recorded.<br/><br/>To discard your answers, click the \"CANCEL\" button.","GRADE","CANCEL",this,"timerExpiration"); } function timerExpiration(flag) { if(flag) { this.buildSummary(true); } else { this.buildSummary(true); } } function stop_timer() { this.activity_timer.stop_timer(); } function buildSummary(flag) { if(flag == false) { if(this.questionMode == "Lab Practical" && this.isTimedExam) { } this.loadQuestion(this.question_array[0]); } else { this.load_bar._visible = false; this.stop_timer(); this.loadQuestion(null); this.check_button.enabled = false; this.check_button._alpha = 0; this.instructions_tf.htmlText = ""; this.caption_tf.htmlText = ""; this.location_tf.htmlText = ""; this.button_holder._visible = false; this.summary_mc.setContent(this.questionMode,this.question_array); this.uiPanel._visible = false; this.isComplete = true; } } function proccess_blank_tag(str) { str = str.split("<blank/>").join("____________"); str = str.split("<blank_small/>").join("________"); str = str.split("<blank_medium/>").join("____________"); str = str.split("<blank_large/>").join("________________"); return str; } function loadQuestion(question_obj) { this.button_holder._visible = true; this.current_question = question_obj; this.question_holder.removeMovieClip(); this.question_holder = this.uiPanel.createEmptyMovieClip("question_holder",this.uiPanel.getNextHighestDepth()); if(question_obj.topinstructions != undefined && question_obj.topinstructions != "<p><instruction></instruction></p>" && question_obj.topinstructions != "") { this.instructions_tf.htmlText = this.proccess_blank_tag(question_obj.topinstructions); this.question_holder._y = this.instructions_tf._y + this.instructions_tf._height; } else { this.instructions_tf.htmlText = ""; this.question_holder._y = this.instructions_tf._y; } this.question_holder.instructions_tf = this._createTextField(this.question_holder,"instructions_tf",1,0,0,this.uiPanelWidth,20,com.argosy.ui.QuestionViewer.label_style,""); this.question_holder.instructions_tf.multiline = true; this.question_holder.instructions_tf.wordWrap = true; this.question_holder.instructions_tf.autoSize = true; if(question_obj.instructions != undefined) { this.question_holder.instructions_tf.htmlText = "<p><question>" + this.proccess_blank_tag(question_obj.instructions) + "</question></p>"; } switch(question_obj.type) { case "fill_in": this.buildFillIn(question_obj); break; case "multi_choice": this.buildMultiChoice(question_obj); break; case "true_false": this.buildTrueFalse(question_obj); break; case "flag": case "pin": this.buildFlag(question_obj); break; case "matching": this.buildMatching(question_obj); } this.image_holder = this.createEmptyMovieClip("image_holder",100); this.image_holder._x = this.uiPanelWidth + 5; this.image_holder._y = 5; this.image_loaded = false; if(this.current_question.image_url != undefined) { this.image_loader.loadClip(this.base_url + this.current_question.image_url,this.image_holder); } this.image_holder.setMask(this.mask); this.image_holder._visible = false; this.location_tf.htmlText = "<p><location>Question " + (question_obj.index + 1) + " out of " + this.question_array.length + "</location></p>"; this.layout(); if(!question_obj.locked) { } question_obj.memory = true; } function buildMatching(question_obj) { this.check_button._visible = true; this.check_button.enabled = true; this.check_button._alpha = 100; this.question_holder.question = question_obj; this.question_holder.questions = []; var _loc3_ = 0; while(_loc3_ < question_obj.questions.length) { var _loc5_ = this.question_holder.getNextHighestDepth(); var _loc2_ = this.question_holder.createEmptyMovieClip("question_" + (_loc3_ + 1),_loc5_); _loc2_.index = this.question_holder.questions.length; _loc2_.feedback_tf = this._createTextField(_loc2_,"feedback_tf",2,0,0,20,20,com.argosy.ui.QuestionViewer.label_style); _loc2_.feedback_tf.htmlText = "<p></p>"; _loc2_.feedback = _loc2_.attachMovie("feedback_icon","feedback",1,{_width:20,_height:20}); _loc2_.feedback._x = 20; _loc2_.input_tf = _loc2_.attachMovie("InputField","feedback",3); _loc2_.input_tf.setLimit(1,"0123456789A-Za-z"); _loc2_.input_tf._x = 42; _loc2_.input_tf.width = _loc2_.input_tf.height = 20; _loc2_.label_tf = this._createTextField(_loc2_,"label_tf",4,64,0,this.uiPanelWidth - 64,20,com.argosy.ui.QuestionViewer.label_style); _loc2_.label_tf.multiline = true; _loc2_.label_tf.wordWrap = true; _loc2_.label_tf.autoSize = true; _loc2_.label_tf.htmlText = "<p><option>" + question_obj.questions[_loc3_].question_text + "</option></p>"; _loc2_.answer_text = question_obj.questions[_loc3_].answer_text; this.question_holder.questions.push(_loc2_); _loc3_ = _loc3_ + 1; } _loc3_ = 0; while(_loc3_ < this.question_holder.questions.length) { this.question_holder.questions[_loc3_]._x = 0; this.question_holder.questions[_loc3_]._y = _loc3_ <= 0 ? this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height : this.question_holder.questions[_loc3_ - 1]._y + this.question_holder.questions[_loc3_ - 1]._height + 10; if(question_obj.locked) { this.question_holder.questions[_loc3_].input_tf.input_tf.textEnabled = false; } else { this.question_holder.questions[_loc3_].input_tf.addEventListener("textChanged",this,"recordMatchingData"); } if(question_obj.memory && question_obj.user_input[_loc3_].user_input != undefined) { this.question_holder.questions[_loc3_].input_tf.text = question_obj.user_input[_loc3_].user_input; } _loc3_ = _loc3_ + 1; } this.recordMatchingData(); } function recordMatchingData(evt) { if(this.current_question.user_input == undefined) { this.current_question.user_input = []; } var _loc2_ = 0; while(_loc2_ < this.question_holder.questions.length) { this.current_question.user_input[_loc2_] = {user_input:this.question_holder.questions[_loc2_].input_tf.text,answer:this.current_question.questions[_loc2_].answer_text}; _loc2_ = _loc2_ + 1; } this.recordAnswer(); } function buildFlag(question_obj) { this.check_button._visible = true; this.check_button.enabled = true; this.check_button._alpha = 100; this.question_holder.flags = []; var _loc3_ = 0; while(_loc3_ < question_obj.hotspot_array.length) { var _loc5_ = this.question_holder.getNextHighestDepth(); var _loc2_ = this.question_holder.createEmptyMovieClip("flag_" + (_loc3_ + 1),_loc5_); _loc2_.index = this.question_holder.flags.length; _loc2_.hotspot = null; _loc2_.feedback = _loc2_.attachMovie("feedback_icon","feedback",1,{_width:20,_height:20}); if(question_obj.type == "flag") { _loc2_.flag = _loc2_.attachMovie("flag_mc","flag",2); } else if(question_obj.type == "pin") { _loc2_.flag = _loc2_.attachMovie("Pin_down","flag",2); } _loc2_.flag._x = _loc2_.feedback._x + _loc2_.feedback._width + 10; _loc2_.flag._y = _loc2_.flag._height / 2; _loc2_.flag.tf.embedFonts = true; _loc2_.flag.tf.styleSheet = com.argosy.ui.QuestionViewer.label_style; _loc2_.flag.tf.htmlText = "<p><flag>" + (_loc3_ + 1) + "</flag></p>"; _loc2_.label_tf = this._createTextField(_loc2_,"label_tf",3,_loc2_.flag._x + _loc2_.flag._width,0,this.uiPanelWidth - (_loc2_.flag._x + _loc2_.flag._width),20,com.argosy.ui.QuestionViewer.label_style); _loc2_.label_tf.multiline = true; _loc2_.label_tf.wordWrap = true; _loc2_.label_tf.autoSize = true; _loc2_.label_tf.htmlText = "<p><option>" + question_obj.hotspot_array[_loc3_].label + "</option></p>"; this.question_holder.flags.push(_loc2_); _loc3_ = _loc3_ + 1; } _loc3_ = 0; while(_loc3_ < this.question_holder.flags.length) { this.question_holder.flags[_loc3_]._x = 0; this.question_holder.flags[_loc3_]._y = _loc3_ <= 0 ? this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height : this.question_holder.flags[_loc3_ - 1]._y + this.question_holder.flags[_loc3_ - 1]._height; if(question_obj.locked) { this.question_holder.flags[_loc3_].enabled = false; } else { this.question_holder.flags[_loc3_].onPress = ascb.util.Proxy.create(this,this.dragFlag,question_obj,this.question_holder.flags[_loc3_]); this.question_holder.flags[_loc3_].onRelease = this.question_holder.flags[_loc3_].onReleaseOutside = ascb.util.Proxy.create(this,this.releaseFlag,question_obj,this.question_holder.flags[_loc3_]); } _loc3_ = _loc3_ + 1; } } function replaceFlags() { trace("••replaceFlags••"); if(this.current_question.locked) { this.showCorrectFlags(); } else { for(var _loc2_ in this.question_holder.flags) { if(this.current_question.user_input[_loc2_].userHS != undefined) { this.createFlag(this.current_question,this.question_holder.flags[_loc2_]); this.question_holder.flags[_loc2_].hotspot = this.current_question.user_input[_loc2_].userHS.graphic; this.question_holder.flags[_loc2_].dragDummy._x = this.image_holder._x + this.question_holder.flags[_loc2_].hotspot._x + this.question_holder.flags[_loc2_].hotspot.snap_point._x - this.question_holder._x; this.question_holder.flags[_loc2_].dragDummy._y = this.image_holder._y + this.question_holder.flags[_loc2_].hotspot._y + this.question_holder.flags[_loc2_].hotspot.snap_point._y - this.question_holder._y; } } } } function showCorrectFlags() { this.current_question.locked = true; var _loc2_ = 0; while(_loc2_ < this.question_holder.flags.length) { var _loc3_ = this.current_question.hotspot_array[_loc2_].graphic; this.createFlag(this.current_question,this.question_holder.flags[_loc2_]); this.question_holder.flags[_loc2_].hotspot = _loc3_; this.question_holder.flags[_loc2_].dragDummy._x = this.image_holder._x + _loc3_._x + _loc3_.snap_point._x - this.question_holder._x; this.question_holder.flags[_loc2_].dragDummy._y = this.image_holder._y + _loc3_._y + _loc3_.snap_point._y - this.question_holder._y; this.question_holder.flags[_loc2_].dragDummy.bg.gotoAndStop("right"); this.question_holder.flags[_loc2_].dragDummy.enabled = false; _loc2_ = _loc2_ + 1; } } function testFlags(mc) { this.question_holder.flag_hit_test = null; for(var _loc4_ in this.current_question.hotspot_array) { var _loc2_ = this.current_question.hotspot_array[_loc4_].showHitTestOutline(mc); if(_loc2_ != null && this.question_holder.flag_hit_test == null) { this.question_holder.flag_hit_test = _loc2_; } else { this.current_question.hotspot_array[_loc4_].showHitTestOutline(null); } } } function dragFlag(question_obj, flag) { this.createFlag(question_obj,flag); flag.dragDummy._x = this.question_holder._xmouse; flag.dragDummy._y = this.question_holder._ymouse; flag.dragDummy.startDrag(true); this.onEnterFrame = ascb.util.Proxy.create(this,this.testFlags,flag.dragDummy); } function redragFlag(question_obj, flag) { flag.hotspot = null; flag.dragDummy.startDrag(true); this.onEnterFrame = ascb.util.Proxy.create(this,this.testFlags,flag.dragDummy); } function releaseFlag(question_obj, flag) { flag.dragDummy.stopDrag(); this.onEnterFrame = null; var _loc2_ = this.question_holder.flag_hit_test; if(_loc2_ == null) { flag.hotspot = null; flag.dragDummy.removeMovieClip(); } else { this.free_hotspot(_loc2_); flag.hotspot = _loc2_; flag.dragDummy._x = this.image_holder._x + _loc2_._x + _loc2_.snap_point._x - this.question_holder._x; flag.dragDummy._y = this.image_holder._y + _loc2_._y + _loc2_.snap_point._y - this.question_holder._y; } this.testFlags(null); this.recordFlagData(); } function recordFlagData() { if(this.current_question.user_input == undefined) { this.current_question.user_input = []; } var _loc2_ = 0; while(_loc2_ < this.question_holder.flags.length) { this.current_question.user_input[_loc2_] = {hs:this.current_question.hotspot_array[_loc2_],correct:this.current_question.hotspot_array[_loc2_].id,user:this.question_holder.flags[_loc2_].hotspot.myObject.id,userHS:this.question_holder.flags[_loc2_].hotspot.myObject}; _loc2_ = _loc2_ + 1; } this.recordAnswer(); } function createFlag(question_obj, flag) { flag.dragDummy.removeMovieClip(); flag.hotspot = null; var _loc3_ = 200 + flag.index; if(question_obj.type == "flag") { flag.dragDummy = this.question_holder.attachMovie("flag_down","drag_flag_" + _loc3_,_loc3_); } else if(question_obj.type == "pin") { flag.dragDummy = this.question_holder.attachMovie("Pin_down","drag_flag_" + _loc3_,_loc3_); flag.dragDummy.gotoAndStop("up"); } flag.dragDummy.tf.embedFonts = true; flag.dragDummy.tf.styleSheet = com.argosy.ui.QuestionViewer.label_style; flag.dragDummy.tf.htmlText = flag.flag.tf.htmlText; flag.dragDummy.onPress = ascb.util.Proxy.create(this,this.redragFlag,question_obj,flag); flag.dragDummy.onRelease = flag.dragDummy.onReleaseOutside = ascb.util.Proxy.create(this,this.releaseFlag,question_obj,flag); } function free_hotspot(hs) { for(var _loc3_ in this.question_holder.flags) { if(this.question_holder.flags[_loc3_].hotspot == hs) { this.question_holder.flags[_loc3_].dragDummy.removeMovieClip(); this.question_holder.flags[_loc3_].hotspot = null; } } } function buildTrueFalse(question_obj) { this.check_button._visible = true; this.check_button.enabled = true; this.check_button._alpha = 100; this.question_holder.true_false_button = this.question_holder.attachMovie("true_false_button","true_false_button",this.question_holder.getNextHighestDepth()); this.question_holder.true_button = this.question_holder.true_false_button.true_button; this.question_holder.false_button = this.question_holder.true_false_button.false_button; if(!question_obj.locked) { this.question_holder.true_button.onPress = ascb.util.Proxy.create(this,this.selectTrueFalse,question_obj,"true"); this.question_holder.false_button.onPress = ascb.util.Proxy.create(this,this.selectTrueFalse,question_obj,"false"); } else { this.question_holder.true_button.enabled = false; this.question_holder.false_button.enabled = false; } this.question_holder.true_button._y = this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height + 10 + this.question_holder.true_button._height / 2; this.question_holder.false_button._y = this.question_holder.true_button._y; this.question_holder.true_button._x = this.question_holder._width / 2 - this.question_holder.true_button._width; this.question_holder.false_button._x = this.question_holder._width / 2 + this.question_holder.false_button._width / 2; if(question_obj.memory) { if(question_obj.user_input == "true") { this.question_holder.true_button._alpha = 100; this.question_holder.false_button._alpha = 50; } else if(question_obj.user_input == "false") { this.question_holder.true_button._alpha = 50; this.question_holder.false_button._alpha = 100; } else { this.question_holder.true_button._alpha = 100; this.question_holder.false_button._alpha = 100; } } else { this.question_holder.true_button._alpha = 100; this.question_holder.false_button._alpha = 100; } this.recordAnswer(); } function selectTrueFalse(question_obj, option) { question_obj.user_input = option; if(option == "true") { this.question_holder.true_button._alpha = 100; this.question_holder.false_button._alpha = 50; } else { this.question_holder.true_button._alpha = 50; this.question_holder.false_button._alpha = 100; } this.recordAnswer(); } function buildFillIn(question_obj) { this.question_holder.label_tf = this._createTextField(this.question_holder,"label_tf",this.question_holder.getNextHighestDepth(),10,this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height + 10,this.uiPanelWidth - 20,24,com.argosy.ui.QuestionViewer.label_style); this.question_holder.label_tf.htmlText = "<p><misc_text>Answer:</misc_text></p>"; this.question_holder.input_tf = this.question_holder.attachMovie("InputField","input_tf",this.question_holder.getNextHighestDepth()); this.question_holder.input_tf._x = 10; this.question_holder.input_tf._y = this.question_holder.label_tf._y + this.question_holder.label_tf._height; this.question_holder.input_tf.width = this.uiPanelWidth - 20; this.question_holder.input_tf.height = 24; Selection.setFocus(this.question_holder.input_tf.text_tf); this.question_holder.input_tf.addEventListener("textChanged",this,"fill_in_change"); if(question_obj.memory && question_obj.user_input != undefined) { this.question_holder.input_tf.text = question_obj.user_input; if(question_obj.locked) { this.question_holder.input_tf.type = "dynamic"; } } this.recordAnswer(); } function fill_in_change(evt) { this.current_question.user_input = evt.target.text.toLowerCase(); this.recordAnswer(); } function buildMultiChoice(question_obj) { this.check_button._visible = true; this.check_button.enabled = true; this.check_button._alpha = 100; var _loc3_ = 0; while(_loc3_ < question_obj.options.length) { var _loc5_ = this.question_holder.getNextHighestDepth(); var _loc4_ = this.question_holder.createEmptyMovieClip("option_" + (_loc3_ + 1),_loc5_); _loc4_.option_text = question_obj.options[_loc3_].label; _loc4_.feedback = _loc4_.attachMovie("feedback_icon","feedback",1,{_width:20,_height:20}); _loc4_.attachMovie("radio_button","radio_button",2,{_x:20}); _loc4_.tf = this._createTextField(_loc4_,"tf",3,40,0,this.uiPanelWidth - 40,20,com.argosy.ui.QuestionViewer.label_style,""); _loc4_.tf.multiline = _loc4_.tf.wordWrap = _loc4_.tf.autoSize = true; _loc4_.tf.htmlText = "<p><option>" + question_obj.options[_loc3_].label + "</option></p>"; question_obj.options[_loc3_].mc = _loc4_; if(question_obj.options[_loc3_].correct == "true") { question_obj.answer_text = _loc4_.option_text; } if(_loc3_ == 0) { question_obj.options[_loc3_].mc._y = this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height + 10; } else { question_obj.options[_loc3_].mc._y = question_obj.options[_loc3_ - 1].mc._y + question_obj.options[_loc3_ - 1].mc._height + 10; } question_obj.options[_loc3_].mc.onPress = ascb.util.Proxy.create(this,this.selectMultiChoice,question_obj,question_obj.options[_loc3_]); if(question_obj.memory && question_obj.user_input != undefined) { if(_loc4_.option_text == question_obj.user_input) { question_obj.selection = question_obj.options[_loc3_]; question_obj.options[_loc3_].mc.radio_button.gotoAndStop("on"); } } if(question_obj.locked) { question_obj.options[_loc3_].mc.enabled = false; } _loc3_ = _loc3_ + 1; } this.recordAnswer(); } function selectMultiChoice(question_obj, option) { question_obj.user_input = option.mc.option_text; question_obj.selection = option; for(var _loc3_ in question_obj.options) { question_obj.options[_loc3_].mc.radio_button.gotoAndStop("off"); } question_obj.selection.mc.radio_button.gotoAndStop("on"); this.recordAnswer(); } function findHotSpots(mc) { trace("findHotSpots"); for(var _loc3_ in mc) { mc[_loc3_]._visible = false; } for(_loc3_ in this.current_question.hotspot_array) { this.current_question.hotspot_array[_loc3_].graphic = this.image_holder["hs_" + this.current_question.hotspot_array[_loc3_].id]; this.current_question.hotspot_array[_loc3_].graphic._visible = true; } trace(this.current_question.type); if(this.current_question.type == "flag" || this.current_question.type == "pin") { this.replaceFlags(); } this.image_holder._visible = true; this.image_loaded = true; } function init() { this.xml_loader = new XML(); this.xml_loader.ignoreWhite = true; this.xml_loader.onLoad = ascb.util.Proxy.create(this,this.xml_loaded); this.image_loader = new MovieClipLoader(); this.image_loader.addListener(this); if(com.argosy.ui.QuestionViewer.label_style == undefined) { com.argosy.ui.QuestionViewer.label_style = new TextField.StyleSheet(); com.argosy.ui.QuestionViewer.label_style.setStyle("p",{display:"inline",fontFamily:"Frutiger Bold",fontSize:"12",color:"#999999",textAlign:"left",textDecoration:"none",kerning:"true",letterSpacing:"0"}); com.argosy.ui.QuestionViewer.label_style.setStyle("caption",{display:"inline",fontSize:"14",color:"#999999",textAlign:"right"}); com.argosy.ui.QuestionViewer.label_style.setStyle("instruction",{display:"inline",fontFamily:"Frutiger",fontSize:"12",color:"#000000",textAlign:"left",marginLeft:"10",marginRight:"10"}); com.argosy.ui.QuestionViewer.label_style.setStyle("option",{display:"inline",fontFamily:"Frutiger",fontSize:"12",color:"#333333",textAlign:"left",marginRight:"2"}); com.argosy.ui.QuestionViewer.label_style.setStyle("question",{display:"inline",fontFamily:"Frutiger",fontSize:"12",color:"#000000",textAlign:"left",marginLeft:"10",marginRight:"10"}); com.argosy.ui.QuestionViewer.label_style.setStyle("location",{display:"inline",fontSize:"9",color:"#000000",textAlign:"center"}); com.argosy.ui.QuestionViewer.label_style.setStyle("right",{display:"inline",fontSize:"12",color:"#009900",textAlign:"center"}); com.argosy.ui.QuestionViewer.label_style.setStyle("wrong",{display:"inline",fontSize:"12",color:"#990000",textAlign:"center"}); com.argosy.ui.QuestionViewer.label_style.setStyle("misc_text",{display:"inline",fontSize:"12",color:"#000000",textAlign:"left"}); com.argosy.ui.QuestionViewer.label_style.setStyle("flag",{display:"inline",fontSize:"12",color:"#FFFFFF",textAlign:"center"}); com.argosy.ui.QuestionViewer.label_style.setStyle("summary",{display:"inline",fontFamily:"Frutiger",fontSize:"12",color:"#000000",textAlign:"left",textDecoration:"none",kerning:"true",letterSpacing:"0"}); com.argosy.ui.QuestionViewer.label_style.setStyle("summary_right",{display:"inline",fontFamily:"Frutiger Bold",fontSize:"12",color:"#009900",textAlign:"left"}); com.argosy.ui.QuestionViewer.label_style.setStyle("summary_wrong",{display:"inline",fontFamily:"Frutiger Bold",fontSize:"12",color:"#990000",textAlign:"left"}); com.argosy.ui.QuestionViewer.label_style.setStyle("summary_title",{display:"inline",fontFamily:"Frutiger Bold",fontSize:"18",color:"#1F3A70",textAlign:"left"}); } super.init(); } function createChildren() { this.bg = this.createEmptyMovieClip("bg",1); this.mask = this.createEmptyMovieClip("mask",2000); this.caption_tf = this._createTextField(this,"caption_tf",200,this.uiPanelWidth,10,this.width - this.uiPanelWidth - 10,20,com.argosy.ui.QuestionViewer.label_style,""); this.uiPanel = this.createEmptyMovieClip("uiPanel",200); this.button_holder = this.uiPanel.createEmptyMovieClip("button_holder",1); this.back_button = this.button_holder.attachMovie("back_button","back_button",1); this.next_button = this.button_holder.attachMovie("next_button","next_button",2); this.location_tf = this._createTextField(this.button_holder,"location_tf",3,0,10,this.uiPanelWidth,20,com.argosy.ui.QuestionViewer.label_style,""); this.instructions_tf = this._createTextField(this.uiPanel,"instructions_tf",3,0,10,this.uiPanelWidth,10,com.argosy.ui.QuestionViewer.label_style,""); this.instructions_tf.multiline = true; this.instructions_tf.wordWrap = true; this.instructions_tf.autoSize = true; this.feedback_tf = this._createTextField(this.uiPanel,"feedback_tf",4,0,10,this.uiPanelWidth,10,com.argosy.ui.QuestionViewer.label_style,""); this.feedback_tf.multiline = true; this.feedback_tf.wordWrap = true; this.feedback_tf.autoSize = true; this.check_button = this.uiPanel.attachMovie("check_button","check_button",5); this.check_button._visible = false; this.feedback_icon = this.uiPanel.attachMovie("feedback_icon","feedback_icon",6); this.next_button.onRelease = ascb.util.Proxy.create(this,this.loadNextNumber); this.back_button.onRelease = ascb.util.Proxy.create(this,this.loadLastNumber); this.check_button.onRelease = ascb.util.Proxy.create(this,this.checkAnswer); this.load_bar = this.attachMovie("LoadBar","load_bar",400); this.activity_timer = this.attachMovie("ActivityTimer","activity_timer",this.getNextHighestDepth()); this.activity_timer.addEventListener("time_up",this,"quiz_time_up"); this.summary_mc = this.attachMovie("SummaryViewer","summary_mc",this.getNextHighestDepth()); this.summary_mc.addEventListener("reset_activity",this,"reset"); this.summary_alert = this.attachMovie("AlertBox","summary_alert",this.getNextHighestDepth()); this.layout(); } function layout() { this.bg.clear(); this.bg.beginFill(16777215,100); this.bg.lineTo(this.width,0); this.bg.lineTo(this.width,this.height); this.bg.lineTo(0,this.height); this.bg.lineTo(0,0); this.bg.endFill(); this.mask.clear(); this.mask.beginFill(16711680,0); this.mask.moveTo(this.uiPanelWidth,0); this.mask.lineTo(this.width,0); this.mask.lineTo(this.width,this.height); this.mask.lineTo(this.uiPanelWidth,this.height); this.mask.lineTo(this.uiPanelWidth,0); this.mask.endFill(); this.uiPanel.clear(); var _loc2_ = new flash.geom.Matrix(); _loc2_.createGradientBox(this.uiPanelWidth,this.height,1.5707963267948966,0,0); this.uiPanel.beginGradientFill("linear",[14409183,10856103],[100,100],[0,255],_loc2_,"pad"); com.drawing.drawUtil.drawRect(this.uiPanel,0,0,this.uiPanelWidth,this.height,0); this.uiPanel.endFill(); this.uiPanel.lineStyle(2,16777215,0,false,"normal","square","miter",8); this.uiPanel.moveTo(this.uiPanelWidth - 1,0); this.uiPanel.lineTo(this.uiPanelWidth - 1,this.height); this.uiPanel.lineStyle(0,6710886,100); com.drawing.drawUtil.drawRect(this.uiPanel,0,0,this.uiPanelWidth,this.height,0); this.summary_mc._x = 0; this.summary_mc._y = 0; this.summary_mc.width = this.width; this.summary_mc.height = this.height; this.back_button._x = this.back_button._width; this.next_button._x = this.back_button._x + this.back_button._width + 20; this.location_tf._y = this.next_button._y + this.next_button._height; this.location_tf._width = this.next_button._x + this.next_button._width; this.button_holder._y = this.height - this.button_holder._height + 10; this.button_holder._x = this.uiPanelWidth / 2 - this.button_holder._width / 2; if(this.questionMode == "Lab Practical") { this.check_button._visible = false; this.feedback_icon._visible = false; this.feedback_tf._visible = false; } else if(this.questionMode == "Self Study") { this.check_button._visible = true; this.feedback_icon._visible = true; this.feedback_tf._visible = true; } this.check_button._x = this.uiPanelWidth / 2; this.check_button._y = this.question_holder._y + this.question_holder._height + this.check_button._height / 2 + 10; this.feedback_icon.gotoAndStop("blank"); if(this.current_question.type == "flag" || this.current_question.type == "pin" || this.current_question.type == "multi_choice" || this.current_question.type == "matching") { this.feedback_tf._y = this.check_button._y + this.check_button._height + 10; this.feedback_tf.htmlText = ""; } else { this.feedback_icon._x = this.uiPanelWidth / 2 - this.feedback_icon._width / 2; this.feedback_icon._y = this.check_button._y + this.check_button._height + 10; this.feedback_tf._y = this.feedback_icon._y + this.feedback_icon._height + 10; this.feedback_tf.htmlText = ""; } this.load_bar._x = this.uiPanelWidth + (this.width - this.uiPanelWidth) / 2 - this.load_bar.width / 2; this.load_bar._y = this.height / 2 - this.load_bar.height / 2; this.activity_timer._x = this.uiPanel._x; this.activity_timer._y = this.uiPanel._y + this.uiPanel._height; } function onLoadInit(target_mc) { this.image_holder.setMask(this.mask); this.findHotSpots(target_mc); if(this.current_question.locked) { this.revealAnswer(); } } function onLoadStart(target_mc) { } function onLoadError(target_mc, errorCode) { trace("onLoadError: " + errorCode); } function onLoadProgress(target_mc, loadedBytes, totalBytes) { this.load_bar.text = "Loading Image"; this.load_bar.percent = loadedBytes / totalBytes; } function onLoadComplete(target_mc) { } }