public void GetByAssesmentID_AssesmentFound_EvaluationHasName() { Assesment a = new Assesment(DEFAULT_ASSESMENT_ID); AssesmentTO to = a.GetInfo(); Assert.AreEqual(true, !String.IsNullOrEmpty(to.Evaluation.Name)); }
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); }
public void GetByID_AssesmentFound_IdIsValid() { Assesment a = new Assesment(DEFAULT_ID); AssesmentTO to = a.GetInfo(); Assert.AreEqual(true, !String.IsNullOrEmpty(to.Evaluation.Name)); }
public void GetByID_AssesmentNotFound_ObjectIsNull() { Assesment a = new Assesment(0); AssesmentTO to = a.GetInfo(); Assert.AreEqual(null, to); }
public void Start_AssesmentStartedSuccessfully_SuccessfulResult() { Assesment a = new Assesment(DEFAULT_ID); AssesmentStartOperationState state = a.Start(); Assert.AreEqual(AssesmentStartOperationState.Successful, state); }
public void GetContext_AssesmentJustStarted_InitialDataSectionIs1() { Assesment a = new Assesment(DEFAULT_ID); AssesmentContextTO context = a.GetCurrentContext(); Assert.AreEqual(1, context.SectionIndex); }
public void GetByAssesmentID_AssesmentFound_DefaultIdIsRight() { Assesment a = new Assesment(DEFAULT_ASSESMENT_ID); AssesmentTO to = a.GetInfo(); Assert.AreEqual(1, to.ID); }
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); }
public void GetByAssesmentID_AssesmentDoesNotExist_ElementIsNull() { Assesment a = new Assesment("xxx"); AssesmentTO to = a.GetInfo(); Assert.IsNull(to); }
public void Start_AssesmentNotFound_NotFoundResult() { Assesment a = new Assesment(0); AssesmentStartOperationState state = a.Start(); Assert.AreEqual(AssesmentStartOperationState.AssementNotFound, state); }
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)); }
public void GetByAssesmentID_AssesmentFound_ElementIsNotNull() { Assesment a = new Assesment(DEFAULT_ASSESMENT_ID); AssesmentTO to = a.GetInfo(); Assert.IsNotNull(to); }
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)); }
public void AnswerQuestion_ResponseIsNotValid_AnswerQuestionInvalidResponse() { Assesment a = new Assesment(DEFAULT_ID); AssesmentAnswerQuestionResult result = a.AnswerQuestion(0); Assert.AreEqual(AssesmentAnswerQuestionResult.InvalidResponse, result); }
public void AnswerQuestion_ResponseIsValid_AnswerIsWrong() { int responseIndex = 2; Assesment a = new Assesment(DEFAULT_ID); AssesmentAnswerQuestionResult result = a.AnswerQuestion(responseIndex); Assert.IsFalse(a.ResponseWasRight()); }
public void AnswerQuestion_ResponseIsValid_AnswerIsSuccessful() { int responseIndex = 1; Assesment a = new Assesment(DEFAULT_ID); AssesmentAnswerQuestionResult result = a.AnswerQuestion(responseIndex); Assert.AreEqual(true, a.ResponseWasRight()); }
public void ResetAssesment() { if (doCleanUp) { Assesment a = new Assesment(DEFAULT_ID); a.Restart(); } }
public void Start_ByAssesmentIdAlreadyStarted_AlreadyStartedResult() { doCleanUp = true; Assesment a = new Assesment(DEFAULT_ASSESMENT_ID); AssesmentStartOperationState state = a.Start(); Assert.AreEqual(AssesmentStartOperationState.AlreadyStarted, state); }
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); }
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)); }
public Assesment GetAssesment() { var assesment = new Assesment(); assesment.ID_sub = SubId; assesment.Attempt = Attempt; assesment.Аssessments = Mark; assesment.ID_student = StudentId; return(assesment); }
// // 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()); }
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)); }
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)); }
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)); }
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)); }
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); }
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); } }
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); } }
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); }