private void start() { copy.setSet("Memory"); UP = MAX / set.getCards().Count(); DOWN = UP / 5; grade = 0; score = this.FindByName <Label>("title"); num = this.FindByName <Label>("page"); card = this.FindByName <Button>("cardFace"); entry = this.FindByName <Entry>("answer"); enterBtn = this.FindByName <Button>("try"); nextBtn = this.FindByName <Button>("next"); fixBtn = this.FindByName <Button>("fix"); wrongBtn = this.FindByName <Button>("wrong"); correctLbl = this.FindByName <Label>("correct"); recordBtn = this.FindByName <Button>("record"); card.BackgroundColor = Color.DarkTurquoise; //entry.BackgroundColor = Color.White; fixBtn.IsVisible = false; //hide wrongBtn.IsVisible = false; //hide nextBtn.IsVisible = false; //hide left = 1; num.Text = left.ToString() + " / " + copy.getCards().Count().ToString(); current = set.getCards().First(); string output = ""; int i = 0; foreach (String point in current.getPoints()) { i++; output += i.ToString() + ") " + point + "\n"; } card.Text = output; if (audioOn == true) { CrossTextToSpeech.Dispose(); var text = card.Text; CrossTextToSpeech.Current.Speak(text); } }
private void start() { set.setSet("Match"); //cardFirst = set.getCards().First();//get first card label = this.FindByName <Label>("title"); grade = 0; UP = MAX / set.getCards().Count(); DOWN = UP / 5; label.Text = "Match Score: " + grade; buttonList = new List <Button>(); buttonList.Add(this.FindByName <Button>("topic1")); buttonList.Add(this.FindByName <Button>("topic2")); buttonList.Add(this.FindByName <Button>("topic3")); buttonList.Add(this.FindByName <Button>("topic4")); buttonList.Add(this.FindByName <Button>("point1")); buttonList.Add(this.FindByName <Button>("point2")); buttonList.Add(this.FindByName <Button>("point3")); buttonList.Add(this.FindByName <Button>("point4")); Shuffle <FlashCard> card = new Shuffle <FlashCard>(set.getCards()); setCopy = card.getList(); reload(); }
public Games(List <Student> users, CardSet list, bool audio) { InitializeComponent(); studentList = users; set = list; audioOn = audio; if (audioOn == true) { CrossTextToSpeech.Current.Speak("Games"); } findScores(); Shuffle <FlashCard> st = new Shuffle <FlashCard>(set.getCards()); set.setCards(st.getList()); int num = set.getCards().Count; foreach (FlashCard card in set.getCards()) { //shuffle each card point Shuffle <String> cd = new Shuffle <String>(card.getPoints()); card.setPoints(cd.getList()); } }
public Memory(List <Student> users, CardSet list, bool audio) { InitializeComponent(); studentList = users; set = list; audioOn = audio; String name = set.getSet(); List <FlashCard> myCards = new List <FlashCard>(); foreach (FlashCard card in list.getCards()) { myCards.Add(card); } copy = new CardSet(name, myCards); start(); }
private void start() { CrossTextToSpeech.Dispose(); int num = 20; //number of questions if (set.getCards().Count < num) { num = set.getCards().Count; } UP = MAX / num; DOWN = UP / 5; set.setSet("Test"); questionLbl = this.FindByName <Label>("question"); scoreLbl = this.FindByName <Label>("title"); buttonA = this.FindByName <Button>("a"); buttonB = this.FindByName <Button>("b"); buttonC = this.FindByName <Button>("c"); buttonD = this.FindByName <Button>("d"); buttonNext = this.FindByName <Button>("next"); grade = 0; count = 0; questions = new List <MultipleChoice>(); Random random = new Random(); int rnd; List <String> options = new List <String>(); foreach (FlashCard card in set.getCards()) { String ques = card.getTopic(); String point1, point2, point3, correct; rnd = random.Next(0, 4); //probability if ((card.getPoints().Count >= 3) && (rnd == 1)) //at least 3 points { Shuffle <String> allTrue = new Shuffle <String>(card.getPoints()); point1 = allTrue.getList()[0]; point2 = allTrue.getList()[1]; point3 = allTrue.getList()[2]; correct = "All are true"; questions.Add(new MultipleChoice(ques, point1, point2, point3, correct, card)); } else { correct = card.getPoints().First(); int rnd1 = random.Next(0, 10); if (rnd1 == 1)//chance for 'all are true' incorrect option { options.Add("All are true"); } while (options.Count < 3) { rnd = random.Next(set.getCards().Count - 1); if (set.getCards()[rnd] != card) { //if not looking at same card, choose one point as wrong answer if (!options.Contains(set.getCards()[rnd].getPoints().First())) { options.Add(set.getCards()[rnd].getPoints().First()); } } } //incorrect options questions.Add(new MultipleChoice(ques, options[0], options[1], options[2], correct, card)); while (options.Count > 0) { options.Remove(options.First()); } } } if (questions.Count > num) { Shuffle <MultipleChoice> ques = new Shuffle <MultipleChoice>(questions); questions = ques.getList(); while (questions.Count > num) { //only num number of questions questions.Remove(questions.First()); } } }