Exemplo n.º 1
0
        public void GetByAssesmentID_AssesmentFound_EvaluationHasName()
        {
            Assesment   a  = new Assesment(DEFAULT_ASSESMENT_ID);
            AssesmentTO to = a.GetInfo();

            Assert.AreEqual(true, !String.IsNullOrEmpty(to.Evaluation.Name));
        }
Exemplo n.º 2
0
        private AssesmentResult CalculateAssementResult(Assesment assesment)
        {
            var assesmentResult = new AssesmentResult();
            var mark            = 0;

            if (assesment.ActualMark != null && assesment.ActualMark != "")
            {
                mark = Convert.ToInt32(assesment.ActualMark);
            }
            else if (assesment.PredictedMark != null && assesment.PredictedMark != "")
            {
                mark = Convert.ToInt32(assesment.PredictedMark);
            }

            if (mark > 30)
            {
                assesmentResult.ResultStatus = GPRTCommon.Result.Status.PASS;
            }
            else
            {
                assesmentResult.ResultStatus = GPRTCommon.Result.Status.FAIL;
            }

            assesmentResult.Assesment = assesment;
            return(assesmentResult);
        }
Exemplo n.º 3
0
        public void GetByID_AssesmentFound_IdIsValid()
        {
            Assesment   a  = new Assesment(DEFAULT_ID);
            AssesmentTO to = a.GetInfo();

            Assert.AreEqual(true, !String.IsNullOrEmpty(to.Evaluation.Name));
        }
Exemplo n.º 4
0
        public void GetByID_AssesmentNotFound_ObjectIsNull()
        {
            Assesment   a  = new Assesment(0);
            AssesmentTO to = a.GetInfo();

            Assert.AreEqual(null, to);
        }
Exemplo n.º 5
0
        public void Start_AssesmentStartedSuccessfully_SuccessfulResult()
        {
            Assesment a = new Assesment(DEFAULT_ID);
            AssesmentStartOperationState state = a.Start();

            Assert.AreEqual(AssesmentStartOperationState.Successful, state);
        }
Exemplo n.º 6
0
        public void GetContext_AssesmentJustStarted_InitialDataSectionIs1()
        {
            Assesment          a       = new Assesment(DEFAULT_ID);
            AssesmentContextTO context = a.GetCurrentContext();

            Assert.AreEqual(1, context.SectionIndex);
        }
Exemplo n.º 7
0
        public void GetByAssesmentID_AssesmentFound_DefaultIdIsRight()
        {
            Assesment   a  = new Assesment(DEFAULT_ASSESMENT_ID);
            AssesmentTO to = a.GetInfo();

            Assert.AreEqual(1, to.ID);
        }
Exemplo n.º 8
0
    private void Awake()
    {
        // Make this object persistence across all levels
        DontDestroyOnLoad(gameObject);

        // Check the presence assessment related objects (from start level)
        if (GameObject.Find("Assessment") == null ||
            GameObject.Find("Assessment").GetComponent<AssessmentManager>() == null)
        {
            Debug.LogError("No assessment object found");
            return;
        }

        mAssesmentManager = GameObject.Find("Assessment").GetComponent<AssessmentManager>();

        mFeedbackAssessor = gameObject.GetComponent<FeedbackAssessor>();

        mAssesment = new Assesment();
        LoadQuizForLevel();

        mWindowHeight = (3 * Screen.height) / 4;
        mWindowWidth = Screen.width / 2;

        mWindowSize = new Rect(0, (Screen.height / 4), mWindowWidth, mWindowHeight);
        mFeedbackWindowSize = new Rect(0, (Screen.height / 4), mWindowWidth, mWindowHeight / 4);
    }
Exemplo n.º 9
0
        public void GetByAssesmentID_AssesmentDoesNotExist_ElementIsNull()
        {
            Assesment   a  = new Assesment("xxx");
            AssesmentTO to = a.GetInfo();

            Assert.IsNull(to);
        }
Exemplo n.º 10
0
        public void Start_AssesmentNotFound_NotFoundResult()
        {
            Assesment a = new Assesment(0);
            AssesmentStartOperationState state = a.Start();

            Assert.AreEqual(AssesmentStartOperationState.AssementNotFound, state);
        }
Exemplo n.º 11
0
        public ActionResult GetContext()
        {
            Assesment assesment = Session[SESSION_ASSESMENT_OBJECT] != null ? (Assesment)Session[SESSION_ASSESMENT_OBJECT] : null;

            if (assesment == null)
            {
                return(Json(new { }, JsonRequestBehavior.AllowGet));
            }

            AssesmentContextTO ctx = assesment.GetCurrentContext();

            var questions =
                (from c in ctx.CurrentSectionQuestions
                 select new
            {
                Answers =
                    (from a in c.Answers
                     select new { AnswerId = a.AnswerId, Text = a.Text }),
                QuestionId = c.QuestionId,
                Text = c.Text,
                Type = c.Type
            });

            return(Json(new  {
                SectionIndex = ctx.SectionIndex,
                QuestionIndex = ctx.QuestionIndex,
                MinutesLeft = ctx.MinutesLeft,
                CurrentSectionQuestions = questions
            }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 12
0
        public void GetByAssesmentID_AssesmentFound_ElementIsNotNull()
        {
            Assesment   a  = new Assesment(DEFAULT_ASSESMENT_ID);
            AssesmentTO to = a.GetInfo();

            Assert.IsNotNull(to);
        }
Exemplo n.º 13
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,studentId,TraineeId,date,quality,quantity,work_habits,communication,attitude,professionalism,leadership,LabDayId")] Assesment assesment)
        {
            if (id != assesment.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(assesment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AssesmentExists(assesment.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LabDayId"]  = new SelectList(_context.Set <LabDay>(), "ID", "ID", assesment.LabDayId);
            ViewData["studentId"] = new SelectList(_context.Users, "Id", "Id", assesment.studentId);
            ViewData["TraineeId"] = new SelectList(_context.Users, "Id", "Id", assesment.TraineeId);
            return(View(assesment));
        }
Exemplo n.º 14
0
        public void AnswerQuestion_ResponseIsNotValid_AnswerQuestionInvalidResponse()
        {
            Assesment a = new Assesment(DEFAULT_ID);
            AssesmentAnswerQuestionResult result = a.AnswerQuestion(0);

            Assert.AreEqual(AssesmentAnswerQuestionResult.InvalidResponse, result);
        }
Exemplo n.º 15
0
        public void AnswerQuestion_ResponseIsValid_AnswerIsWrong()
        {
            int       responseIndex = 2;
            Assesment a             = new Assesment(DEFAULT_ID);
            AssesmentAnswerQuestionResult result = a.AnswerQuestion(responseIndex);

            Assert.IsFalse(a.ResponseWasRight());
        }
Exemplo n.º 16
0
        public void AnswerQuestion_ResponseIsValid_AnswerIsSuccessful()
        {
            int       responseIndex = 1;
            Assesment a             = new Assesment(DEFAULT_ID);
            AssesmentAnswerQuestionResult result = a.AnswerQuestion(responseIndex);

            Assert.AreEqual(true, a.ResponseWasRight());
        }
Exemplo n.º 17
0
 public void ResetAssesment()
 {
     if (doCleanUp)
     {
         Assesment a = new Assesment(DEFAULT_ID);
         a.Restart();
     }
 }
Exemplo n.º 18
0
        public void Start_ByAssesmentIdAlreadyStarted_AlreadyStartedResult()
        {
            doCleanUp = true;
            Assesment a = new Assesment(DEFAULT_ASSESMENT_ID);
            AssesmentStartOperationState state = a.Start();

            Assert.AreEqual(AssesmentStartOperationState.AlreadyStarted, state);
        }
Exemplo n.º 19
0
        public Assesment ConvertToModel()
        {
            int       percent     = Int32.Parse(Percentage.Trim('%'));
            Assesment returnValue = new Assesment(this.Code, this.Title, percent, this.ReleaseDate, this.DueDate, this.Graded, this.GradedDate, this.Grade, this.Available);

            returnValue.AssesmentID = this.AssesmentID;
            returnValue.UnitID      = this.UnitID;
            return(returnValue);
        }
Exemplo n.º 20
0
        public void UpdateLeftTime_TimeRunOut_MinutesLeftStillZero()
        {
            Assesment a = new Assesment(DEFAULT_ID);

            a.Start();
            a.UpdateLeftTime();
            AssesmentContextTO context = a.GetCurrentContext();

            Assert.AreEqual(true, context.MinutesLeft >= 0);
        }
        public ActionResult GetContext()
        {
            Assesment assesment = Session[SESSION_ASSESMENT_OBJECT] != null ? (Assesment)Session[SESSION_ASSESMENT_OBJECT] : null;

            if (assesment == null)
            {
                return(Json(new { }, JsonRequestBehavior.AllowGet));
            }

            return(Json(assesment.GetCurrentContext(), JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 22
0
        public Assesment GetAssesment()
        {
            var assesment = new Assesment();

            assesment.ID_sub      = SubId;
            assesment.Attempt     = Attempt;
            assesment.Аssessments = Mark;
            assesment.ID_student  = StudentId;

            return(assesment);
        }
Exemplo n.º 23
0
        //
        // GET: /Assesment/

        public ActionResult Index()
        {
            string assesmentID = Request.QueryString[QUERY_STRING_ID] != null ? Request.QueryString[QUERY_STRING_ID].ToString() : null;

            if (!String.IsNullOrEmpty(assesmentID))
            {
                Assesment assesment = new Assesment(assesmentID);
                Session[SESSION_ASSESMENT_OBJECT] = assesment;
            }

            return(CheckAndRoute());
        }
Exemplo n.º 24
0
        public ActionResult UpdateLeftTime()
        {
            Assesment assesment = Session[SESSION_ASSESMENT_OBJECT] != null ? (Assesment)Session[SESSION_ASSESMENT_OBJECT] : null;

            if (assesment == null)
            {
                return(Json(new { }, JsonRequestBehavior.AllowGet));
            }

            assesment.UpdateLeftTime();

            return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 25
0
        public ActionResult Start()
        {
            Assesment assesment = Session[SESSION_ASSESMENT_OBJECT] != null ? (Assesment)Session[SESSION_ASSESMENT_OBJECT] : null;

            if (assesment == null)
            {
                return(Json(new { }, JsonRequestBehavior.AllowGet));
            }

            AssesmentStartOperationState state = assesment.Start();

            return(Json(new { result = state.ToString() }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 26
0
        public void Throw_Exception_When_Database_Is_Null()
        {
            Assesment assesment = new Assesment();

            assesment.Name           = "Test";
            assesment.SourcePlatform = "OnPrem";
            assesment.Status         = "Completed";
            assesment.TargetPlatform = "Azure Managed Instance";
            //assesment.Databases = new List<Database>();
            assesment.ServerInstances = new List <ServerInstance>();
            Assert.Throws <InvalidDataException>
                (() => GeneratorFacade.Generate(assesment));
        }
Exemplo n.º 27
0
        public async Task <IActionResult> Create([Bind("ID,studentId,TraineeId,date,quality,quantity,work_habits,communication,attitude,professionalism,leadership,LabDayId")] Assesment assesment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(assesment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LabDayId"]  = new SelectList(_context.Set <LabDay>(), "ID", "ID", assesment.LabDayId);
            ViewData["studentId"] = new SelectList(_context.Users, "Id", "Id", assesment.studentId);
            ViewData["TraineeId"] = new SelectList(_context.Users, "Id", "Id", assesment.TraineeId);
            return(View(assesment));
        }
Exemplo n.º 28
0
        public void Works_Properly_When_Valid_Input_Is_Given()
        {
            Assesment assesment = new Assesment();

            assesment.Name            = "Test";
            assesment.SourcePlatform  = "OnPrem";
            assesment.Status          = "Completed";
            assesment.TargetPlatform  = "Azure Managed Instance";
            assesment.Databases       = new List <Database>();
            assesment.ServerInstances = new List <ServerInstance>();
            var table = GeneratorFacade.Generate(assesment);

            Assert.NotNull(table);
        }
Exemplo n.º 29
0
        public void End_AssesmentDoneStatusRemains_StatusDoesNotChange()
        {
            Assesment a = new Assesment(DEFAULT_ID);

            if (a.GetInfo().Status == AssesmentStatus.Done)
            {
                a.End();
                Assert.AreEqual(AssesmentStatus.Done, a.GetInfo().Status);
            }
            else
            {
                Assert.IsTrue(true);
            }
        }
Exemplo n.º 30
0
        private static void Add(Assesment assesment, Database db,
                                List <object[]> root)
        {
            var recomList = db.AssessmentRecommendations;

            if (!recomList.Any())
            {
                root.Add(new object[] { assesment, db });
                return;
            }

            foreach (var rec in recomList)
            {
                Add(assesment, db, rec, root);
            }
        }
Exemplo n.º 31
0
        private AssesmentResult CalculateAssementResult(Assesment assesment)
        {
            var assesmentResult = new AssesmentResult();

            if (Convert.ToInt32(assesment.ActualMark) > 30)
            {
                assesmentResult.ResultStatus = GPRTCommon.Result.Status.PASS;
            }
            else
            {
                assesmentResult.ResultStatus = GPRTCommon.Result.Status.FAIL;
            }

            assesmentResult.Assesment = assesment;
            return(assesmentResult);
        }