//WelshSkillsListUI welshSkillListUI; public void InitialiseMe(string engVocab, string cymVocab, string readTally, string writeTally) { base.InitialiseMe(engVocab, cymVocab); extraInfo = transform.Find("ExtraInformation"); //welshSkillListUI = FindObjectOfType<WelshSkillsListUI>(); readProgressSlider = extraInfo.Find("ReadProgressSlider").GetComponent <Slider>(); writeProgressSlider = extraInfo.Find("WriteProgressSlider").GetComponent <Slider>(); readProgressLbl = extraInfo.Find("ReadProgressLbl").GetComponent <Text>(); writeProgressLbl = extraInfo.Find("WriteProgressLbl").GetComponent <Text>(); int readTallyInt = int.Parse(readTally); int writeTallyInt = int.Parse(writeTally); int readThreshold; int writeThreshold; string readProficiencyString; string writeProficiencyString; ReadProficienciesHandler readProficienciesHandler = new ReadProficienciesHandler(engVocab, cymVocab); readProficienciesHandler.GetProficiencyDetailsFromTally(readTallyInt, out readProficiencyString, out readThreshold); WriteProficienciesHandler writeProficienciesHandler = new WriteProficienciesHandler(engVocab, cymVocab); writeProficienciesHandler.GetProficiencyDetailsFromTally(writeTallyInt, out writeProficiencyString, out writeThreshold); readProgressSlider.maxValue = readThreshold; writeProgressSlider.maxValue = writeThreshold; readProgressSlider.value = readTallyInt; writeProgressSlider.value = writeTallyInt; readProgressLbl.text = readProficiencyString; writeProgressLbl.text = writeProficiencyString; }
private void SetProficiencyDetailsFromTally(int tally, string eng, string cym, out string proficiencyName, out int threshold, DialogueTestDataController.TestType testType) { proficiencyName = ""; threshold = 0; if (testType == DialogueTestDataController.TestType.read) { ReadProficienciesHandler readProficiencyHandler = new ReadProficienciesHandler(eng, cym); readProficiencyHandler.GetProficiencyDetailsFromTally(tally, out proficiencyName, out threshold); } else if (testType == DialogueTestDataController.TestType.write) { WriteProficienciesHandler writeProficiencyHandler = new WriteProficienciesHandler(eng, cym); writeProficiencyHandler.GetProficiencyDetailsFromTally(tally, out proficiencyName, out threshold); } }
private void UpdateWriteSkillPoints() { WriteProficienciesHandler profienciesHandler = new WriteProficienciesHandler(vocab[0], vocab[1]); string writeTallyProficiency; int threshold; profienciesHandler.GetProficiencyDetailsFromTally(writeTally, out writeTallyProficiency, out threshold); int writeProficiencyAcquired = DbCommands.GetCountFromTable( "AcquiredVocabWriteSkills", "EnglishText = " + DbCommands.GetParameterNameFromValue(vocab[0]) + " AND WelshText = " + DbCommands.GetParameterNameFromValue(vocab[1]) + " AND ProficiencyNames = " + DbCommands.GetParameterNameFromValue(writeTallyProficiency) + " AND SaveIDs = 0", vocab[0], vocab[1], writeTallyProficiency ); if (writeProficiencyAcquired < 1) { if (writeTally >= threshold) { DbCommands.InsertTupleToTable("AcquiredVocabWriteSkills", vocab[0], vocab[1], writeTallyProficiency, "0"); skillPointsGainedTotal++; vocabSkillIncremented = true; if (highestTallyPossible > writeTally) { DbCommands.UpdateTableField("DiscoveredVocab", "WriteCorrectTallies", "0", "SaveIDs = 0 " + "AND EnglishText = " + DbCommands.GetParameterNameFromValue(vocab[0]) + " " + "AND WelshText = " + DbCommands.GetParameterNameFromValue(vocab[1]), vocab[0], vocab[1]); } } } }