private void Form1_Load(object sender, EventArgs e) { testButton.Enabled = false; //Load itemPairs that was selected in test selection form if (currentTest.CustomTest == 1) { itemPairList = ItemPair.getCustomItemPair(currentTest.TestID); } else { UserTestLogic.getItemPair(currentTest.TestID, itemPairList); } // Get Item Pairs and populate groupbox populateGroupBox(itemPairList, itemPairListIndex); // Load denominator for Progress Bar denominatorChange(itemPairList.Count); }
// Changes the radio buttons based content in array public List <Item> populateRadio(ItemPair itemPair) { // Randomizes where the item pairs are assigned to the userChoice Radio boxes: Kevin Khlom Sprint 2 List <Item> itemToAssign = new List <Item>(); // Function that randomizes the pairings UserTestLogic.itemToAssign(itemPair, itemToAssign, currentTest); //Gets the test type and sets the text/images accordingly int i = 0; string errorString = "Error getting test type: "; if (TestList.getTestType(ref testType, currentTest.TestID, ref errorString)) { if (testType == "T") { // // userChoiceOne // this.userChoiceOne.Location = new System.Drawing.Point(61, 49); // // userChoiceTwo // this.userChoiceTwo.Location = new System.Drawing.Point(165, 49); // // userChoiceThree // this.userChoiceThree.Location = new System.Drawing.Point(269, 49); // // testButton // this.testButton.Location = new System.Drawing.Point(214, 275); // // directionLabel // this.directionLabel.Location = new System.Drawing.Point(150, 96); // // finishedLabel // this.finishedLabel.Location = new System.Drawing.Point(54, 44); // // testProgressBar // this.testProgressBar.Location = new System.Drawing.Point(197, 372); // // numeratorLabel // this.numeratorLabel.Location = new System.Drawing.Point(416, 372); // // slashLabel // this.slashLabel.Location = new System.Drawing.Point(433, 372); // // denominatorLabel // this.denominatorLabel.Location = new System.Drawing.Point(449, 372); // // itemGroupBox // this.itemGroupBox.Location = new System.Drawing.Point(79, 142); this.itemGroupBox.Size = new System.Drawing.Size(440, 100); // // UserTest // this.ClientSize = new System.Drawing.Size(600, 426); } foreach (Control control in itemGroupBox.Controls) { if (control is RadioButton) { control.Width = 300; ((RadioButton)control).BackColor = Color.Transparent; if (currentTest.TestType == "T") { control.Text = itemToAssign[i].Name; } else if (currentTest.TestType == "I") { if (itemToAssign[i].ItemImage != null) { ((RadioButton)control).TextImageRelation = TextImageRelation.TextAboveImage; ((RadioButton)control).Image = itemToAssign[i].getImage(); } else { ((RadioButton)control).Image = Properties.Resources.Undecided; } } else if (currentTest.TestType == "TI") { if (itemToAssign[i].ItemImage != null) { ((RadioButton)control).TextImageRelation = TextImageRelation.TextAboveImage; ((RadioButton)control).Image = itemToAssign[i].getImage(); } else { ((RadioButton)control).Image = Properties.Resources.Undecided; } control.Text = itemToAssign[i].Name; } } i++; } } return(itemToAssign); }