public virtual void SetCorrectState()
        {
            if (!this.IsAnswer)
            {
                this.AnswerState = G__AnswerState.ReadOnly;
                // Finished ... Nothing to check
                return;  // ***************************************ExitPoint
            }
            else
            {
                if (this._dblCurrentValue == null)
                {
                    this._answerState    = G__AnswerState.Empty;
                    this._solveAttempted = G__SolveAttempted.UnAttempted;
                }
                else
                {
                    this._solveAttempted = G__SolveAttempted.Attempted;

                    if (this._dblOriginalValue == this._dblCurrentValue)
                    {
                        this.AnswerState = G__AnswerState.Correct;
                    }
                    else
                    {
                        this.AnswerState = G__AnswerState.InCorrect;
                    }
                }
            }
        }
 private void Initialize()
 {
     this._strPrevValue     = "";
     this._strCurrentValue  = "";
     this._strOriginalValue = "";
     this._dblPrevValue     = null;
     this._dblCurrentValue  = null;
     this._dblOriginalValue = 0;
     // Set answer state - default
     this._solveAttempted = G__SolveAttempted.UnAttempted;
     this._answerState    = G__AnswerState.InCorrect;
     this._containerType  = G__ContainerType.Container;
     // Logic
     this._bIsAnswer                   = false;
     this._bIsInComplete               = false;
     this._bHasFractionParent          = false;
     this._bHasNumletParent            = false;
     this._bHasNumberParent            = false;
     this._bHasWorkSpaceParent         = false;
     this._bHasSelectedNumberText      = false;
     this._bHasSelectedOperatorText    = false;
     this._bAllowNextResponder         = true;
     this._bToStringReturnCurrentValue = this._numberAppSettings.GA__ToStringReturnsCurrentValue;
     this._bFreeForm                   = false;
     //this._bFreeFormMode = this._numberAppSettings.GA__FreeFromModeActive;
     // UI
     // Most objects from BaseContainer need to be drawn at ViewWillAppear
     // This can obviously be changed for individual controls at their .ctor
     this._applyUIWhere = G__ApplyUI.ViewWillAppear;
     this._myEventArgs  = new evtArgsBaseContainer();
 }
Exemple #3
0
        // Variables to define the "stste" of each numletset
        // Has it been attempted, is it wrong or right.
        // This will be used by the list to tell if they are completed, correct etc

        public LessonNumletSet()
        {
            this.lnsEquation     = "";
            this.lnsMethods      = "";
            this.lnsResult       = "";
            this._solveAttempted = G__SolveAttempted.UnAttempted;
            this.AnswerState     = G__AnswerState.InCorrect;

            // Results
            this.LessonDetailResults = new EntityLessonDetailResults();
            this.ControlsLoaded      = false;
            this.NumletsLoaded       = false;
        }
        public override G__AnswerState Solve()
        {
            G__AnswerState x = this.MyWorkSpaceParent.Solve();

            if (x == G__AnswerState.Correct) // Correct
            {
                this.btnSolveButton.AnimationCorrect();
            }
            if (x == G__AnswerState.InCorrect || x == G__AnswerState.PartCorrect) // Correct
            {
                this.btnSolveButton.AnimationFalse();
            }

            // Do we want to do anything if its empty??
            return(x);
        }
        public virtual G__AnswerState BinarySolve(G__AnswerState x, G__AnswerState y)
        {
            G__AnswerState z = G__AnswerState.Empty;

            // Check correct
            if ((x == G__AnswerState.Correct) && (y == G__AnswerState.Correct))
            {
                z = G__AnswerState.Correct;
            }

            // Check Part
            if ((x == G__AnswerState.InCorrect) && (y == G__AnswerState.Correct) ||
                (x == G__AnswerState.Correct) && (y == G__AnswerState.InCorrect) ||
                (x == G__AnswerState.PartCorrect) && (y == G__AnswerState.Correct) ||
                (x == G__AnswerState.Correct) && (y == G__AnswerState.PartCorrect) ||
                (x == G__AnswerState.Empty) && (y == G__AnswerState.Correct) ||
                (x == G__AnswerState.Correct) && (y == G__AnswerState.Empty) ||
                (x == G__AnswerState.PartCorrect) && (y == G__AnswerState.Empty) ||
                (x == G__AnswerState.Empty) && (y == G__AnswerState.PartCorrect) ||
                (x == G__AnswerState.PartCorrect) && (y == G__AnswerState.InCorrect) ||
                (x == G__AnswerState.PartCorrect) && (y == G__AnswerState.PartCorrect))
            {
                z = G__AnswerState.PartCorrect;
            }

            // Check Incorrect
            if ((x == G__AnswerState.InCorrect) && (y == G__AnswerState.Empty) ||
                (x == G__AnswerState.Empty) && (y == G__AnswerState.InCorrect) ||
                (x == G__AnswerState.InCorrect) && (y == G__AnswerState.InCorrect))
            {
                z = G__AnswerState.InCorrect;
            }

            // Empty
            if ((x == G__AnswerState.Empty) && (y == G__AnswerState.Empty))
            {
                z = G__AnswerState.Empty;
            }

            return(z);
        }