public void Init(Quizz q, Action <Quizz, int> onQuizzClick, int quizzOder = 0) { quidID = quizzOder; quiz = q; _OnQuizzClick = onQuizzClick; int num = 0; for (int i = 0; i < root.childCount; i++) { BoxWorld bx = root.GetChild(i).GetComponent <BoxWorld>(); int startto = q.startFrom + q.keyword.Length; if (i >= q.startFrom && i < startto) { bx.Init(q.keyword[num].ToString(), false, false, false, GotoQuiz, quidID, num); if (i == q.keyhightlight) { bx.Init(q.keyword[num].ToString(), false, false, true, GotoQuiz, quidID, num); } num++; } else { bx.Init("", true, false, false, GotoQuiz, quidID, -1); } if (q.keySetStart == i || q.keysetEnd == i) { bx.Init("", false, true, false, GotoQuiz, quidID, -1); } } }
public void ResetAns() { for (int i = 0; i < ans.transform.childCount; i++) // vì ở đây không có dấu sao hàng cuối { BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>(); b.Unmapkey(); b._isSelect = true; b.HideLastItem(); } }
public bool GetFillButton(int idButton) { QuizzItem q = UIQuiz.instance.listQuizzItem[currentSelectQuizz]; for (int i = 0; i < q.transform.childCount; i++) { BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>(); if (b.keyMaping == idButton) { return(true); } } return(false); }
void OnFillText(int idButton, string letter) { for (int i = 0; i < ans.transform.childCount; i++) // vì ở đây không có dấu sao hàng cuối { BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>(); b.HideLastItem(); if (b.keyMaping == -1 && b.idButton >= 0) { b.ShowLastItem(); b.OnMapingKey(idButton, letter); return; } } }
public void UnSetLetter(string letter, int idButton) { for (int i = 0; i < ans.transform.childCount; i++) { BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>(); b.HideLastItem(); if (idButton == b.keyMaping) { b.ShowLastItem(); // b.OnUnMapingKey(idButton, letter); b.Unmapkey(); } } }
public void OnUnFillText(int currentQuiz, int keyAnsID, string text) { if (listQuizzItem.Count > 0) { QuizzItem q = listQuizzItem[currentQuiz]; for (int i = 0; i < q.transform.childCount - 1; i++) { BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>(); b.HideLastItem(); if (keyAnsID == b.keyMaping) { b.Unmapkey(); b.ShowLastItem(); } } } else { Debug.Log("null data"); } }
public bool CheckFullAnswer() { bool rs = true; for (int i = 0; i < ans.transform.childCount; i++) { BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>(); if (b.idButton >= 0) { if (!string.IsNullOrEmpty(b.txtLableNomal.text)) { rs = true; } else { rs = false; break; } } } return(rs); }
bool CheckFinishRound2() { bool rs = true; for (int i = 0; i < ans.transform.childCount; i++) { BoxWorld b = ans.transform.GetChild(i).GetComponent <BoxWorld>(); if (b.idButton >= 0) { if (b.txtLableNomal.text == b.rightAnser) { rs = true; } else { rs = false; break; } } } return(rs); }
public bool CheckFullAnswer() { bool rs = true; QuizzItem q = UIQuiz.instance.listQuizzItem[currentSelectQuizz]; for (int i = 0; i < q.transform.childCount; i++) { BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>(); if (b.idButton >= 0) { if (!string.IsNullOrEmpty(b.txtLableNomal.text)) { rs = true; } else { rs = false; break; } } } return(rs); }
public void OnFillText(int currentQuiz, int keyAnsID, string text) { if (listQuizzItem.Count > 0) { QuizzItem q = listQuizzItem[currentQuiz]; for (int i = 0; i < q.transform.childCount - 1; i++) { BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>(); b.HideLastItem(); if (b.keyMaping == -1 && b.idButton >= 0) { b.OnMapingKey(keyAnsID, text); b.ShowLastItem(); return; } } QuizzDetail.instance.listGenerate[currentQuiz].currentSelectItem = QuizzDetail.instance.listGenerate[currentQuiz].currentSelectItem + 1; } else { Debug.Log("null data"); } }
bool CheckLevelIsFinished() { bool rs = true; QuizzItem q = UIQuiz.instance.listQuizzItem[currentSelectQuizz]; for (int i = 0; i < q.transform.childCount; i++) { BoxWorld b = q.transform.GetChild(i).GetComponent <BoxWorld>(); if (b.idButton >= 0) { // char a = listGenerate[currentSelectQuizz].keyword[b.idButton]; if (b.txtLableNomal.text == b.rightAnser) { rs = true; } else { rs = false; break; } } } return(rs); }