/// <summary> /// Creates a problem set useing the passed in values /// !!Assumes data has been validated! /// </summary> /// <param name="txtOperands">The textboxes with the operands ranges in them</param> /// <param name="Operation">The Operation for the problem set</param> /// <param name="numProblems">The number of problems in the problem set</param> /// <param name="numAttempts">The number of attempts before the problem is counted wrong</param> /// <param name="goal">The goal to pass the problem set value 0.0 - 1.0</param> /// <param name="isValid">A list of bools to add isValid tags too</param> /// <returns>The created problemSet or null</returns> private ProblemSet ConstructProblemSet()//TextBox[] txtOperands, Operation Operation, int numProblems, int numAttempts, Double goal, List<bool> isValid) { OperandsRange range1 = new OperandsRange(); OperandsRange range2 = new OperandsRange(); List <OperandsRange> operandsRange = new List <OperandsRange>(); range1.rangeMin = int.Parse(txtFirstOperandRangeMin.Text); range1.rangeMax = int.Parse(txtFirstOperandRangeMax.Text); range2.rangeMin = int.Parse(txtSecondOperandRangeMin.Text); range2.rangeMax = int.Parse(txtSecondOperandRangeMax.Text); operandsRange.Add(range1); operandsRange.Add(range2); return(new ProblemSet(Guid.NewGuid().ToString(), txtName.Text, GetOperation(), operandsRange, uint.Parse(txtNumberOfProblems.Text), (uint)ddlAttemptsPerProblem.TabIndex, double.Parse(txtGoal.Text), cbxAdditionAllowNegative.Checked, cbxSubtractionAllowNegativeAnswers.Checked, cbxDivisionWholeNumberAnswers.Checked )); }
/// <summary> /// Creates a problem set useing the passed in values /// !!Assumes data has been validated! /// </summary> /// <param name="txtOperands">The textboxes with the operands ranges in them</param> /// <param name="Operation">The Operation for the problem set</param> /// <param name="numProblems">The number of problems in the problem set</param> /// <param name="numAttempts">The number of attempts before the problem is counted wrong</param> /// <param name="goal">The goal to pass the problem set value 0.0 - 1.0</param> /// <param name="isValid">A list of bools to add isValid tags too</param> /// <returns>The created problemSet or null</returns> private ProblemSet ConstructProblemSet()//TextBox[] txtOperands, Operation Operation, int numProblems, int numAttempts, Double goal, List<bool> isValid) { OperandsRange range1 = new OperandsRange(); OperandsRange range2 = new OperandsRange(); List<OperandsRange> operandsRange = new List<OperandsRange>(); range1.rangeMin = int.Parse(txtFirstOperandRangeMin.Text); range1.rangeMax = int.Parse(txtFirstOperandRangeMax.Text); range2.rangeMin = int.Parse(txtSecondOperandRangeMin.Text); range2.rangeMax = int.Parse(txtSecondOperandRangeMax.Text); operandsRange.Add(range1); operandsRange.Add(range2); return new ProblemSet(Guid.NewGuid().ToString(), txtName.Text, GetOperation(), operandsRange, uint.Parse(txtNumberOfProblems.Text), (uint)ddlAttemptsPerProblem.TabIndex, double.Parse(txtGoal.Text), cbxAdditionAllowNegative.Checked, cbxSubtractionAllowNegativeAnswers.Checked, cbxDivisionWholeNumberAnswers.Checked ); }