/// <summary>
        /// 9 April 2014
        /// Jonathan Sanborn
        ///
        /// Constructor for an Assignment Session
        /// </summary>
        /// <param name="mmControl">The Control Object</param>
        /// <param name="assign">The Assignment for this session</param>
        public AssignmentSession(MMControl mmControl, ref Assignment assign)
        {
            init();
            MMControl           = mmControl;
            assignment          = assign;
            problemSetGenerator = new ProblemSetGenerator(assignment.ProblemSet);
            assignmentAttempt   = new AssignmentAttempt();
            problemList         = problemSetGenerator.GetProblemList;

            attemptsRemaining = (int)Assignment.ProblemSet.NumberOfAttempts;
            currentProblem    = problemList.First();
            problemList.Remove(CurrentProblem);
        }
        /// <summary>
        /// 9 April 2014
        /// Jonathan Sanborn
        /// 
        /// Constructor for an Assignment Session
        /// </summary>
        /// <param name="mmControl">The Control Object</param>
        /// <param name="assign">The Assignment for this session</param>
        public AssignmentSession(MMControl mmControl, ref Assignment assign)
        {
            init();
            MMControl = mmControl;
            assignment = assign;
            problemSetGenerator = new ProblemSetGenerator(assignment.ProblemSet);
            assignmentAttempt = new AssignmentAttempt();
            problemList = problemSetGenerator.GetProblemList;

            attemptsRemaining = (int)Assignment.ProblemSet.NumberOfAttempts;
            currentProblem = problemList.First();
            problemList.Remove(CurrentProblem);
        }
Пример #3
0
        /// <summary> 
        /// Be handed control by CtrlStudnt object
        /// </summary>
        /// <author> Jeff Bunce </author>
        internal void TakeControl()
        {
            assignedDrill = loggedInStudent.Assignments.Where(w => !w.IsCompleted).First();

            problemSetGenerator = new ProblemSetGenerator(assignedDrill.ProblemSet);
            problemSet = assignedDrill.ProblemSet;
            problemList = problemSetGenerator.GetProblemList;
            attemptsRemaining = (int)assignedDrill.ProblemSet.NumberOfAttempts;
            currentProblem = problemList.First();
            problemList.Remove(CurrentProblem);
            ProblemNumber = 1;
            ProblemsCorrect = 0;
            ProblemsIncorrect = 0;
            sessionRunning = false;

            

            switch (problemSet.Operation.ToString())
            {
                case "Addition":
                    operationIndex = 1;
                    break;
                case "Subtraction":
                    operationIndex = 2;
                    break;
                case "Multiplication":
                    operationIndex = 3;
                    break;
                case "Division":
                    operationIndex = 4;
                    break;
                default:
                    operationIndex = 0;
                    break;
            }

            studentDrillForm.DisplayProblem(problemSet.NumberOfProblems.ToString(), (problemNumber).ToString(), operationIndex,
                currentProblem.Operand1.ToString(), currentProblem.Operand2.ToString());
            studentDrillForm.DisplayFeedback(String.Empty); // feedback given upon giving an answer

            studentDrillForm.ShowDialog();
        }