public ProblemAndAnswer(MathGateProblem problem) { this.Description = problem.Description; this.CorrectAnswer = problem.CorrectAnswer; this.PrecisionRequired = problem.PrecisionRequired; this.proposedAnswer = ""; }
private MathGate[] findMathGates() { CoolIt_Service.MathGate[] rawMathGates = webService.GetMathGates(); MathGate[] answer = new MathGate[rawMathGates.Length]; for (int i = 0; i < rawMathGates.Length; i++) { CoolIt_Service.MathGate rawGate = rawMathGates[i]; MathGateProblem[] problems = new MathGateProblem[rawGate.Problems.Length]; for (int j = 0; j < rawGate.Problems.Length; j++) { CoolIt_Service.MathGateProblem rawProblem = rawGate.Problems[j]; problems[j] = new MathGateProblem(rawProblem.Description, rawProblem.CorrectAnswer, rawProblem.PrecisionRequired); } CAPABILITY cap; switch (rawGate.Capability) { case DesktopClient.CoolIt_Service.CAPABILITY.CP_VS_HEAT_LEAK_GRAPH: cap = CAPABILITY.CP_VS_HEAT_LEAK_GRAPH; break; default: throw new Exception("Unexpteded capability found"); } answer[i] = new MathGate(rawGate.Name, rawGate.ID, problems, cap); } return(answer); }