void Start() { AllPurposeGameObj.transform.position += move_pos_offscreen; SetTheLearningText(); // //so the objects of metrics are the same // mainScriptObj.rulesObject.playerMetricsObject = mainScriptObj.playerMetricsObject; timer = text_object.GetComponent<Text>(); hint = hintTextObj.GetComponent<Text>(); score_text = scoreTextObj.GetComponent<Text>(); time_indicator_text = timeIndicatorTextObj.GetComponent<Text>(); mainScriptObj = GameObject.Find("GameSystem").GetComponent<MainScript>(); //start the counter for the time in-game mainScriptObj.playerMetricsObject.timeMetricsObject.StartAndStopTimeCounterSinceBeginningOfGame(true); /*mainScriptObj.playerMetricsObject.timeMetricsObject.CheckAndStoreInputGameTimeLimit(0, 0, 3); mainScriptObj.playerMetricsObject.timeMetricsObject.CheckAndStoreInputGameTimeLimit(0, 0, 5);*/ //first activity if(!mainScriptObj.playerMetricsObject.gameActivitiesList.ContainsKey(quiz_activity_name)) { mainScriptObj.playerMetricsObject.gameActivitiesList.Add(quiz_activity_name,quiz_activityObj); } if(mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue(quiz_activity_name, out temp_activity_container)) { temp_activity_container.CheckAndStoreInputTimeThreshold(0, 0, 2); temp_activity_container.CheckAndStoreInputTimeThreshold(0, 0, 4); temp_activity_container.CheckAndStoreInputTimeThreshold(0, 0, 6); temp_activity_container.CheckAndStoreInputTimeThreshold(0, 0, 8); temp_activity_container.CheckAndStoreInputTimeThreshold(0, 0, 10); /*temp_activity_container.StoreInputLimitToNumberOfTriesToSolveThisTask(2); temp_activity_container.StoreInputLimitToNumberOfTriesToSolveThisTask(3); temp_activity_container.StoreInputLimitToNumberOfTriesToSolveThisTask(4);*/ ErrorMetrics temp_err_cont; /*temp_activity_container.EncouteredErrorsList.TryGetValue(temp_activity_container.errorRecognizeName , out temp_err_cont); temp_err_cont.StoreInputThresholdsToNumberOfErrors(1); temp_err_cont = null;*/ temp_activity_container.EncouteredErrorsList.TryGetValue(temp_activity_container.errorRecallName , out temp_err_cont); temp_err_cont.StoreInputThresholdsToNumberOfErrors(3); temp_err_cont.StoreInputThresholdsToNumberOfErrors(7); temp_err_cont = null; /*temp_activity_container.EncouteredErrorsList.TryGetValue(temp_activity_container.errorImplementName , out temp_err_cont); temp_err_cont.StoreInputThresholdsToNumberOfErrors(3); temp_err_cont = null;*/ } //second activity if(!mainScriptObj.playerMetricsObject.gameActivitiesList.ContainsKey(classification_activity_name)) { mainScriptObj.playerMetricsObject.gameActivitiesList.Add(classification_activity_name,classification_activityObj); } if(mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue (classification_activity_name, out temp_activity_container)) { temp_activity_container.CheckAndStoreInputTimeThreshold(0, 0, 3); temp_activity_container.CheckAndStoreInputTimeThreshold(0, 0, 5); temp_activity_container.CheckAndStoreInputTimeThreshold(0, 0, 7); ErrorMetrics temp_error_cont; temp_activity_container.EncouteredErrorsList.TryGetValue(temp_activity_container.errorClassifyName , out temp_error_cont); temp_error_cont.StoreInputThresholdsToNumberOfErrors(5); temp_error_cont = null; temp_activity_container.EncouteredErrorsList.TryGetValue(temp_activity_container.errorImplementName , out temp_error_cont); temp_error_cont.StoreInputThresholdsToNumberOfErrors(3); temp_error_cont = null; /*temp_learning_activity_container.StoreInputLimitToNumberOfTriesToSolveThisTask(2); temp_learning_activity_container.StoreInputLimitToNumberOfTriesToSolveThisTask(3); temp_learning_activity_container.StoreInputLimitToNumberOfTriesToSolveThisTask(4);*/ } timeIndicatorTextObj.transform.position += move_pos_offscreen; scoreTextObj.transform.position += move_pos_offscreen; Dropdown_Menu.transform.position += move_pos_offscreen; inputField2.transform.position += move_pos_offscreen; temp_activity_container=null; //disable the second input field for now inputField2.DeactivateInputField(); inputField2.interactable = false; //if (Input.GetKeyDown(KeyCode.Space)) start_button.onClick.AddListener(delegate { Dropdown_Menu.transform.position += move_pos_onscreen; timeIndicatorTextObj.transform.position += move_pos_onscreen; scoreTextObj.transform.position += move_pos_onscreen; AllPurposeGameObj.transform.position += move_pos_onscreen; score_text.text = ""; //move the reading material and GUI elements that are not needed start_button.transform.position += move_pos_offscreen; var slide = GameObject.Find("Scrollbar"); slide.transform.position += move_pos_offscreen; var panel = GameObject.Find("Panel"); panel.transform.position += move_pos_offscreen; var learning_text = GameObject.Find("LearningText"); learning_text.transform.position += move_pos_offscreen; //get a new question Dropdown_Menu.options.Clear(); QManagObj.NewQuestionForTheFirstActivity(ref the_question, ref Dropdown_Menu, mainScriptObj.the_score); //first task if (mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue(quiz_activity_name, out temp_activity_container) && temp_activity_container.activity_completed == false) { CheckForStartOfActivity(ref temp_activity_container, activity_timer_start); //temp_learning_activity_container=null; ongoing_learning_activity_name = quiz_activity_name; } if (ongoing_learning_activity_name == quiz_activity_name) { //Dropdown_Menu.captionText = Dropdown_Menu.captionText; //Dropdown_Menu.options.Clear(); //Dropdown_Menu.OnSelect(Dropdown_Menu.onValueChanged); Dropdown_Menu.onValueChanged.AddListener(delegate { if (Dropdown_Menu.options[Dropdown_Menu.value].text.ToString() != "Make your choice!") { new_points = 0; string temp_str = ""; //if the following int is 0, the answer is correct, if it is 1 error in recognizing happened //if it is 2 error in recall was made, and 3 is for error in implementing bool answer_flag = mainScriptObj.rulesObject.CheckCorrectnessOfAnswer( Dropdown_Menu.options[Dropdown_Menu.value].text, QManagObj.currentQuestion.correctAnswer, QManagObj.currentQuestion.questionScore, ref temp_str); /*int TempInt = Dropdown_Menu.value; Dropdown_Menu.value = Dropdown_Menu.value + 1; Dropdown_Menu.value = TempInt;*/ //Dropdown_Menu.options.Clear(); //Dropdown_Menu.value = 0; //Dropdown_Menu.value = 0; if (answer_flag) { //the player gets some points mainScriptObj.the_score += new_points; //update the diagnostic system about the score changes mainScriptObj.playerMetricsObject.CheckAndStoreInputScore(mainScriptObj.the_score); //and check the rules for the score mainScriptObj.CheckTheGameScoreAndItsRules(score_text); DebugInput(Dropdown_Menu.options[Dropdown_Menu.value].text); /*DebugInput(inputField.text); inputField.text = "";*/ //the_question += "Correct!"; } else {//incorrect answer //the player loses some points mainScriptObj.the_score -= new_points; //update the diagnostic system about the score changes mainScriptObj.playerMetricsObject.CheckAndStoreInputScore(mainScriptObj.the_score); //and check the rules for the score mainScriptObj.CheckTheGameScoreAndItsRules(score_text); DebugInput("WAAAAAAAAAAH!!!" + inputField.text); //mainScriptObj.CheckForErrors(); //check the type of the error //if it is 1 error in recognizing happened, ID: errorInRecognizing //if it is 2 error in recall was made, ID: errorInRecalling string error_information= mainScriptObj.playerMetricsObject.TrackAndStoreErrorForThisActivity (ongoing_learning_activity_name, "errorInRecalling"); Debug.LogError(error_information); mainScriptObj.rulesObject.CheckRulesForErrors(ongoing_learning_activity_name, ref would_be_hint); Debug.Log(would_be_hint); //ErrorMetrics temp_error_for_first; /*if (corectAnswerOrTypeOfError == 1) { temp_activity_container.EncouteredErrorsList .TryGetValue(temp_activity_container.errorRecognizeName, out temp_error_for_first); temp_error_for_first.ErrorMade(temp_activity_container.time_on_activity.Elapsed); string errorInfo = "ErrorInRecognizing timestamps: " + temp_error_for_first.error_time_stamps.Count + "# "; for (int i = 0; i < temp_error_for_first.error_time_stamps.Count; i++) { errorInfo += temp_error_for_first.error_time_stamps[i] + " "; } Debug.LogError(errorInfo); mainScriptObj.rulesObject.CheckRulesForErrors(ref temp_activity_container, ref would_be_hint); hint.text = would_be_hint; //string errorinfo = errore + " | " + temp_container.getnumberoferrors() + " timestamps: "; //for (int i = 0; i < temp_container.getnumberoferrors(); i++) //{ // errorinfo += temp_container.error_time_stamps.elementat(i) + " "; //} //debug.logerror(errorinfo); }*/ //if (corectAnswerOrTypeOfError == 2) //////{ ////// temp_activity_container.EncouteredErrorsList ////// .TryGetValue(temp_activity_container.errorRecallName, out temp_error_for_first); ////// temp_error_for_first.ErrorMade(temp_activity_container.time_on_activity.Elapsed); ////// string errorInfo = "ErrorInRecalling timestamps: " ////// + temp_error_for_first.error_time_stamps.Count + "# "; ////// for (int i = 0; i < temp_error_for_first.error_time_stamps.Count; i++) ////// { ////// errorInfo += temp_error_for_first.error_time_stamps[i] + " "; ////// } ////// Debug.LogError(errorInfo); ////// mainScriptObj.rulesObject.CheckRulesForErrors(ref temp_activity_container, ref would_be_hint); ////// hint.text = would_be_hint; //////} /*else if (corectAnswerOrTypeOfError == 3) { temp_activity_container.EncouteredErrorsList .TryGetValue(temp_activity_container.errorImplementName, out temp_error_for_first); temp_error_for_first.ErrorMade(temp_activity_container.time_on_activity.Elapsed); string errorInfo = "errorInImplementing timestamps: " + temp_error_for_first.error_time_stamps.Count + "# "; for (int i = 0; i < temp_error_for_first.error_time_stamps.Count; i++) { errorInfo += temp_error_for_first.error_time_stamps[i] + " "; } Debug.LogError(errorInfo); mainScriptObj.rulesObject.CheckRulesForErrors(ref temp_activity_container, ref would_be_hint); hint.text = would_be_hint; }*/ //inputField.text = ""; } //get a new question if (QManagObj.NewQuestionForTheFirstActivity(ref the_question, ref Dropdown_Menu, mainScriptObj.the_score)) { //reset the question var to empty //the_question = ""; //wait a bit and start the new activity /*Dropdown_Menu.options.Clear(); Dropdown_Menu.value = 0;*/ //move the dropdown to a place where it cannot be seen Vector3 temp = new Vector3(1000.0f, 0, 0); Dropdown_Menu.transform.position += temp; //move the first input field to a place where it cannot be seen //Vector3 temp = new Vector3(1000.0f, 0, 0); inputField.transform.position += temp; the_question = ""; the_question = "New activity will start soon! Please wait...\n\n\n\n\n"; if (mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue(quiz_activity_name, out temp_activity_container) && temp_activity_container.activity_completed == false)//if the first activity is not finished {//but the requirements are met CheckForStartOfActivity(ref temp_activity_container, activity_timer_stop);//end the first activity temp_activity_container = null;//and empty the container } //deactivate the process of getting input during the "transfer" //from one activity to the other inputField.DeactivateInputField(); inputField.interactable = false; //wait a bit StartCoroutine(WaitFunction()); } } }); /*inputField.onEndEdit.AddListener(delegate { new_points = 0; //if the following int is 0, the answer is correct, if it is 1 error in recognizing happened //if it is 2 error in recall was made, and 3 is for error in implementing int corectAnswerOrTypeOfError = QManagObj.CheckCorrectnessOfAnswer(inputField.text, ref new_points); if (corectAnswerOrTypeOfError == 0) { //the player gets some points mainScriptObj.the_score += new_points; //update the diagnostic system about the score changes mainScriptObj.playerMetricsObject.CheckAndStoreInputScore(mainScriptObj.the_score); //and check the rules for the score mainScriptObj.CheckTheGameScoreAndItsRules(); DebugInput(inputField.text); inputField.text = ""; } else {//incorrect answer //the player loses some points mainScriptObj.the_score -= new_points; //update the diagnostic system about the score changes mainScriptObj.playerMetricsObject.CheckAndStoreInputScore(mainScriptObj.the_score); //and check the rules for the score mainScriptObj.CheckTheGameScoreAndItsRules(); DebugInput("WAAAAAAAAAAH!!!" + inputField.text); //mainScriptObj.CheckForErrors(); //check the type of the error //if it is 1 error in recognizing happened, ID: errorInRecognizing //if it is 2 error in recall was made, ID: errorInRecalling ErrorMetrics temp_error_for_first; if (corectAnswerOrTypeOfError == 1) { temp_activity_container.EncouteredErrorsList .TryGetValue(temp_activity_container.errorRecognizeName, out temp_error_for_first); temp_error_for_first.ErrorMade(temp_activity_container.time_on_activity.Elapsed); string errorInfo = "ErrorInRecognizing timestamps: " + temp_error_for_first.error_time_stamps.Count + "# "; for (int i = 0; i < temp_error_for_first.error_time_stamps.Count; i++) { errorInfo += temp_error_for_first.error_time_stamps[i] + " "; } Debug.LogError(errorInfo); mainScriptObj.rulesObject.CheckRulesForErrors(ref temp_activity_container, ref would_be_hint); hint.text = would_be_hint; //string errorinfo = errore + " | " + temp_container.getnumberoferrors() + " timestamps: "; //for (int i = 0; i < temp_container.getnumberoferrors(); i++) //{ // errorinfo += temp_container.error_time_stamps.elementat(i) + " "; //} //debug.logerror(errorinfo); } else if (corectAnswerOrTypeOfError == 2) { temp_activity_container.EncouteredErrorsList .TryGetValue(temp_activity_container.errorRecallName, out temp_error_for_first); temp_error_for_first.ErrorMade(temp_activity_container.time_on_activity.Elapsed); string errorInfo = "ErrorInRecalling timestamps: " + temp_error_for_first.error_time_stamps.Count + "# "; for (int i = 0; i < temp_error_for_first.error_time_stamps.Count; i++) { errorInfo += temp_error_for_first.error_time_stamps[i] + " "; } Debug.LogError(errorInfo); mainScriptObj.rulesObject.CheckRulesForErrors(ref temp_activity_container, ref would_be_hint); hint.text = would_be_hint; } else if (corectAnswerOrTypeOfError == 3) { temp_activity_container.EncouteredErrorsList .TryGetValue(temp_activity_container.errorImplementName, out temp_error_for_first); temp_error_for_first.ErrorMade(temp_activity_container.time_on_activity.Elapsed); string errorInfo = "errorInImplementing timestamps: " + temp_error_for_first.error_time_stamps.Count + "# "; for (int i = 0; i < temp_error_for_first.error_time_stamps.Count; i++) { errorInfo += temp_error_for_first.error_time_stamps[i] + " "; } Debug.LogError(errorInfo); mainScriptObj.rulesObject.CheckRulesForErrors(ref temp_activity_container, ref would_be_hint); hint.text = would_be_hint; } inputField.text = ""; } //get a new question if (QManagObj.NewQuestionForTheFirstActivity(ref the_question, ref Dropdown_Menu)) { //reset the question var to empty //the_question = ""; //wait a bit and start the new activity //move the first input field to a place where it cannot be seen Vector3 temp = new Vector3(1000.0f, 0, 0); inputField.transform.position += temp; the_question = ""; the_question = "New activity will start soon! Please wait...\n\n\n\n\n"; if (mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue(quiz_activity_name, out temp_activity_container) && temp_activity_container.activity_completed == false)//if the first activity is not finished {//but the requirements are met CheckForStartOfActivity(ref temp_activity_container, activity_timer_stop);//end the first activity temp_activity_container = null;//and empty the container } //deactivate the process of getting input during the "transfer" //from one activity to the other inputField.DeactivateInputField(); inputField.interactable = false; //wait a bit StartCoroutine(WaitFunction()); } });*/ } }); /*else if (ongoing_learning_activity_name==classification_activity_name) { inputField2.onEndEdit.AddListener(delegate { DebugInput("Yaaaar!"); }); }*/ }
/*void PickOneLearningActivity(ref temp_learning_activity_container) { }*/ // void CheckRulesForActivityMetrics() // { // /* //is limit reached for the time since start // mainScriptObj.rulesObject.CompareCurrentGameTimeWithGameTimeLimit(); // //if(mainScriptObj.rulesObject.GetGameTimeLimitReached()) // if(mainScriptObj.rulesObject.game_time_limit_reached) // { // timer.text = "Game Over, man! Game Over!"; // mainScriptObj.rulesObject.game_time_limit_reached=false; // //return; // }*/ // // // if(!last_task_limit_reached) // { // //is limit reached for time-on-task // //!!!!!!!!HAVE A CHECK AROUND THIS SO IT CAN BE SKIPPED IF NOT NEEDED // if(mainScriptObj.playerMetricsObject.activityMetricsObject.current_task_time_limit_index+1<= // mainScriptObj.playerMetricsObject.activityMetricsObject.time_on_activity_thresholds.Count) // { // // mainScriptObj.rulesObject.CompareCurrentTaskTimeWithTaskTimeLimit(); // } // // // if (mainScriptObj.rulesObject.GetTaskTimeLimitReached()) // /*if (mainScriptObj.playerMetricsObject.activityMetricsObject.GetTask_time_limit_compared // (mainScriptObj.playerMetricsObject.activityMetricsObject.current_task_time_limit_index))*/ // { // // //mainScriptObj.rulesObject.task_time_limit_reached=false; // //return; // // //this might need to be moved; not appropriate here? // if(mainScriptObj.playerMetricsObject.activityMetricsObject.current_task_time_limit_index+1<= // mainScriptObj.playerMetricsObject.activityMetricsObject.time_on_activity_thresholds.Count) // { // if (mainScriptObj.playerMetricsObject.activityMetricsObject.GetTask_time_limit_compared // (mainScriptObj.playerMetricsObject.activityMetricsObject.current_task_time_limit_index)) // { // // hint.text = "Task Over, man! Task Over! #"+mainScriptObj. // playerMetricsObject.activityMetricsObject.current_task_time_limit_index; // // mainScriptObj.playerMetricsObject.activityMetricsObject.current_task_time_limit_index++; // } // // } // else // { // last_task_limit_reached=true; // } // } // } // } void CheckForStartOfActivity(ref ActivityMetrics temp_learning_activity_container, string activity_command) { //ActivityMetrics temp_container; //if (Input.GetKeyDown(KeyCode.T) == true) { /*if(mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue (learning_activity_name_A, out temp_learning_activity_container))*/ //if(temp_learning_activity_container!=null) { //if (current_activity_command=="" && Input.GetKeyDown(KeyCode.T) == true) if(activity_command==activity_timer_start) {//start the counting of time-on-activity //temp_learning_activity_container.IncrementNumberOfTriesToSolve(); temp_learning_activity_container.StartStopOrPauseTimeOnActivityCounter(activity_timer_start); //Debug.LogError(mainScriptObj.playerMetricsObject.activityMetricsObject.GetTimeOnTask()); //Debug.LogError(mainScriptObj.playerMetricsObject.activityMetricsObject.time_on_activity.Elapsed.ToString()); current_activity_command = activity_timer_start; } /*if(current_activity_command==activity_timer_start && temp_learning_activity_container.time_on_activity.IsRunning)*/ if (activity_command == activity_timer_pause && temp_learning_activity_container.time_on_activity.IsRunning)//if the activity is ongoing and the {//time counter is running //if (Input.GetKeyDown(KeyCode.P) == true) { current_activity_command = activity_timer_pause; temp_learning_activity_container.StartStopOrPauseTimeOnActivityCounter(activity_timer_pause); } } //if(current_activity_command==activity_timer_pause) if (activity_command == activity_timer_unpause) { //if(Input.GetKeyDown(KeyCode.U) == true) { temp_learning_activity_container.StartStopOrPauseTimeOnActivityCounter(activity_timer_unpause); current_activity_command = activity_timer_start; } } //if(Input.GetKeyDown(KeyCode.A) == true) if (activity_command == activity_timer_stop) {//stop the counting of time-on-activity current_activity_command = ""; temp_learning_activity_container.StartStopOrPauseTimeOnActivityCounter(activity_timer_stop); new_question=true; } } } }
void SecondActivity() { if (mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue(quiz_activity_name, out temp_activity_container) && temp_activity_container.activity_completed)//if the first activity is finished {//start preparing for the second one DebugInput("Chaos sighted!"); //CheckForStartOfActivity(ref temp_activity_container, activity_timer_stop);//end the first activity temp_activity_container = null;//empty the container //and extract the second activity mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue(classification_activity_name, out temp_activity_container); //temp_activity_container.StartStopOrPauseTimeOnActivityCounter(activity_timer_start); CheckForStartOfActivity(ref temp_activity_container, activity_timer_start); //temp_learning_activity_container=null; ongoing_learning_activity_name = classification_activity_name; //StartCoroutine(WaitFunction()); //System.Threading.Thread.Sleep(3000); //Invoke("WaitFunction", 5.0f); /*inputField.ActivateInputField(); inputField.interactable = true;*/ //enable the second input field inputField2.transform.position += move_pos_onscreen; inputField2.ActivateInputField(); inputField2.interactable = true; QManagObj.NewQuestionForTheSecondActivity(ref the_question, mainScriptObj.the_score); inputField2.onEndEdit.AddListener(delegate { new_points = 0; string temp_str = ""; //if the following int is 0, the answer is correct, if it is 1 error in recognizing happened //if it is 2 error in recall was made bool answer_flag = mainScriptObj.rulesObject.CheckCorrectnessOfAnswer( Dropdown_Menu.options[Dropdown_Menu.value].text, QManagObj.currentQuestion.correctAnswer, QManagObj.currentQuestion.questionScore, ref temp_str); if (answer_flag) { //the player gets some points mainScriptObj.the_score += new_points; //update the diagnostic system about the score changes mainScriptObj.playerMetricsObject.CheckAndStoreInputScore(mainScriptObj.the_score); //and check the rules for the score mainScriptObj.CheckTheGameScoreAndItsRules(score_text); DebugInput(inputField2.text); inputField2.text = ""; } else {//incorrect answers //if (corectAnswerOrTypeOfError == 1) { //the player loses some points mainScriptObj.the_score -= new_points; //update the diagnostic system about the score changes mainScriptObj.playerMetricsObject.CheckAndStoreInputScore(mainScriptObj.the_score); //and check the rules for the score mainScriptObj.CheckTheGameScoreAndItsRules(score_text); DebugInput("Red 'unz Go Fasta!!!!" + inputField2.text); //mainScriptObj.CheckForErrors(); //check the type of the error ////ErrorMetrics temp_error_for_second; ////temp_activity_container.EncouteredErrorsList.TryGetValue( //// temp_activity_container.errorClassifyName, out temp_error_for_second); ////temp_error_for_second.ErrorMade(temp_activity_container.time_on_activity.Elapsed); ////string errorInfo = "errorInClassifying timestamps: " + //// temp_error_for_second.error_time_stamps.Count + "# "; ////for (int i = 0; i < temp_error_for_second.error_time_stamps.Count; i++) ////{ //// errorInfo += temp_error_for_second.error_time_stamps[i] + " "; ////} ////Debug.LogError(errorInfo); string error_information= mainScriptObj.playerMetricsObject.TrackAndStoreErrorForThisActivity (ongoing_learning_activity_name, "errorInClassifying"); Debug.LogError(would_be_hint); mainScriptObj.rulesObject.CheckRulesForErrors(ongoing_learning_activity_name, ref would_be_hint); Debug.LogError(would_be_hint); //mainScriptObj.rulesObject.CheckRulesForErrors(ref temp_activity_container, ref would_be_hint); hint.text = would_be_hint; inputField2.text = ""; } /*else if(corectAnswerOrTypeOfError == 2) { //the player loses some points mainScriptObj.the_score -= new_points; //update the diagnostic system about the score changes mainScriptObj.playerMetricsObject.CheckAndStoreInputScore(mainScriptObj.the_score); //and check the rules for the score mainScriptObj.CheckTheGameScoreAndItsRules(); DebugInput("Red 'unz Go Fasta!!!!" + inputField2.text); //mainScriptObj.CheckForErrors(); //check the type of the error ////ErrorMetrics temp_error_for_second; ////temp_activity_container.EncouteredErrorsList.TryGetValue( //// temp_activity_container.errorImplementName, out temp_error_for_second); ////temp_error_for_second.ErrorMade(temp_activity_container.time_on_activity.Elapsed); ////string errorInfo = "errorInImplementing timestamps: " + //// temp_error_for_second.error_time_stamps.Count + "# "; ////for (int i = 0; i < temp_error_for_second.error_time_stamps.Count; i++) ////{ //// errorInfo += temp_error_for_second.error_time_stamps[i] + " "; ////} ////Debug.LogError(errorInfo); string error_information = mainScriptObj.playerMetricsObject.TrackAndStoreErrorForThisActivity (ongoing_learning_activity_name, "errorInClassifying"); Debug.LogError(would_be_hint); mainScriptObj.rulesObject.CheckRulesForErrors(ongoing_learning_activity_name, ref would_be_hint); Debug.LogError(would_be_hint); //mainScriptObj.rulesObject.CheckRulesForErrors(ref temp_activity_container, ref would_be_hint); hint.text = would_be_hint; inputField2.text = ""; }*/ } //get a new question if (QManagObj.NewQuestionForTheSecondActivity(ref the_question, mainScriptObj.the_score)) { if (mainScriptObj.playerMetricsObject.gameActivitiesList.TryGetValue(classification_activity_name, out temp_activity_container) && temp_activity_container.activity_completed == false)//if the second activity is not finished {//but the requirements are met CheckForStartOfActivity(ref temp_activity_container, activity_timer_stop);//end the second activity temp_activity_container = null;//and empty the container inputField2.DeactivateInputField(); inputField2.interactable = false; //stop the counting of time in-game mainScriptObj.playerMetricsObject.timeMetricsObject.StartAndStopTimeCounterSinceBeginningOfGame(false); //give the final output to the player the_question = " --- GAME OVER! THANK YOU FOR PLAYING! --- " + "\n\n\nYour final score is: " + mainScriptObj.the_score+". "; if (mainScriptObj.the_score>=150) { the_question += "PERFECT!!!"; } else if (mainScriptObj.the_score >= 140 && mainScriptObj.the_score<150) { the_question += "Almost perfect!"; } else if (mainScriptObj.the_score>=100 && mainScriptObj.the_score<140) { the_question += "Good."; } else if (mainScriptObj.the_score >= 50 && mainScriptObj.the_score < 100) { the_question += "Not bad."; } else if (mainScriptObj.the_score < 50) { the_question += "You really need to work on your knowledge about the geography of Europe."; } the_question += "\n\n\n\n"; mainScriptObj.logObj.WriteLog(); } } }); //end the game and show the score????? } }
public void CheckRulesForActivityMetrics(ref ActivityMetrics temp_activity_container, ref string would_be_hint) { string time_on_activity_threshold_ID = "timeOnActivityThreshold"; //compare the time time-on-activity with the time thresholds if (temp_activity_container.current_task_time_limit_index + 1 <= temp_activity_container.time_on_activity_thresholds.Count) { //CompareCurrentTaskTimeWithTaskTimeLimit(); //----------------- if (temp_activity_container.time_on_activity.Elapsed > temp_activity_container.time_on_activity_thresholds.ElementAt (temp_activity_container.current_task_time_limit_index) && temp_activity_container.time_on_activity_threshold_compared [temp_activity_container.current_task_time_limit_index] != true) { temp_activity_container.time_on_activity_threshold_compared[ temp_activity_container.current_task_time_limit_index] = true; } //------------- } if (temp_activity_container.current_task_time_limit_index + 1 <= temp_activity_container.time_on_activity_thresholds.Count) { if (temp_activity_container.time_on_activity_threshold_compared [temp_activity_container.current_task_time_limit_index]) { would_be_hint = "Task Over, man! Task Over! " + (temp_activity_container.current_task_time_limit_index + 1) + " out of " + temp_activity_container.time_on_activity_thresholds.Count; //send the indicator and its index to be stored or have its occurence incremented (if it already exists) indicatorsObject.StoreMainIndicator(time_on_activity_threshold_ID); //and check if an auxiliary indicator should be activated CheckThresholdsForMainIndicators(); temp_activity_container.current_task_time_limit_index++; } } /*//compare number of attempts limit int i = 0; foreach (var number_of_attempts_limit in temp_activity_container.limits_to_number_of_tries_to_solve) { if (number_of_attempts_limit == temp_activity_container.number_of_tries_to_solve) { if (!temp_activity_container.compared_limits_to_number_of_tries_to_solve[i]) { temp_activity_container.compared_limits_to_number_of_tries_to_solve[i] = true; //CheckRulesForHintMetrics(error.Key, ref would_be_hint); would_be_hint = "Task: " + ", number_of_attempts_limit: " + number_of_attempts_limit + ", number: " + temp_activity_container.number_of_tries_to_solve; } } i++; }*/ }