Example #1
0
 /// <summary>
 /// Dependent type names of this entity
 /// </summary>
 public void DeleteChildren(DatabaseEntities dbContext)
 {
     foreach (var x in AssessmentQuestions.ToList())
     {
         x.DeleteFull(dbContext);
     }
 }
Example #2
0
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (AssessmentQuestions.Any())
            {
                dependentObjects.Add(typeof(AssessmentQuestion).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
Example #3
0
        public IList <AssessmentQuestions> GetAssessments()
        {
            var assessmentQuestions = new List <AssessmentQuestions>();
            var competencies        = _context.CompetencyAndPerformance.ToList();

            foreach (var comp in competencies)
            {
                var questions          = _context.AssessmentTestQuestions.Where(q => q.CAndPId == comp.CAndPId).ToList();
                var assessmentQuestion = new AssessmentQuestions
                {
                    CAndPId                  = comp.CAndPId,
                    Name                     = comp.Name,
                    Description              = comp.Description,
                    IsCompetency             = comp.IsCompetency,
                    AssessmentTestsQuestions = questions
                };
                assessmentQuestions.Add(assessmentQuestion);
            }
            return(assessmentQuestions);
        }
Example #4
0
 public AssessmentQuestion GetNext()
 {
     return(AssessmentQuestions.Where(x => !x.Answered).OrderBy(x => x.Order).FirstOrDefault());
 }
Example #5
0
        public void CreateQuestion()
        {
            //if(prop.getProperty("AssessmentTest").trim().Equals("false"))
            //throw new SkipException("create Assessment skipped");
            try
            {
                IJavaScriptExecutor js = (IJavaScriptExecutor)driver;

                AssessmentQuestions questions = new AssessmentQuestions(driver);

                //TimeUnit.SECONDS.sleep(3);
                questions.NewQuestion().Click();

                AddQuestion addQuestion = new AddQuestion(driver);

                //TimeUnit.SECONDS.sleep(5); // Data load will get time
                addQuestion.ModuleName(prop.getProperty("moduleName"));
                //TimeUnit.SECONDS.sleep(2);
                addQuestion.AddQuestionText(prop.getProperty("addQuestionText"));
                js.ExecuteScript("document.getElementById('txtOption-1').scrollIntoView();");

                addQuestion.Option1Data().SendKeys(prop.getProperty("option1Data"));
                js.ExecuteScript("document.getElementById('txtOption-2').scrollIntoView();");

                addQuestion.Option2Data().SendKeys(prop.getProperty("option2Data"));
                js.ExecuteScript("document.getElementById('txtOption-3').scrollIntoView();");

                addQuestion.Option3Data().SendKeys(prop.getProperty("option3Data"));
                js.ExecuteScript("document.getElementById('txtOption-4').scrollIntoView();");

                addQuestion.Option4Data().SendKeys(prop.getProperty("option4Data"));

                if (prop.getProperty("option1RDButton").Equals("1"))
                {
                    addQuestion.Option1RDButton().Click();
                }

                if (prop.getProperty("option2RDButton").Equals("1"))
                {
                    addQuestion.Option2RDButton().Click();
                }

                if (prop.getProperty("option3RDButton").Equals("1"))
                {
                    addQuestion.Option3RDButton().Click();
                }

                if (prop.getProperty("option4RDButton").Equals("1"))
                {
                    addQuestion.Option4RDButton().Click();
                }

                addQuestion.Weightage().SendKeys(prop.getProperty("weightage"));
                addQuestion.SaveQuestion().Click();
                //logger.debug("Question is created..");

                //			Next to publish
                questions.NextToPublish().Click();
            }
            catch (Exception e)
            {
                //logger.error(e.getMessage());
                screenShotObj.GetScreenshot(driver, "AddQuestion");
            }
        }
 public List <AssessmentQuestion> GetActiveQuestions()
 {
     return(AssessmentQuestions.Where(x => !x.IsArchived()).ToList());
 }
Example #7
0
 /// <summary>
 /// Does this object have any dependent objects? (If it does have dependent objects, these would need to be deleted before this object could be deleted.)
 /// </summary>
 /// <returns></returns>
 public bool HasDependentObjects()
 {
     return(AssessmentQuestions.Any());
 }
Example #8
0
        //[Test]
        public void createQuestion()
        {
            if (prop.getProperty("quizTest").Trim().Equals("false"))
            {
                //throw new SkipException("Create Quiz skipped");
                try
                {
                    IJavaScriptExecutor js = (IJavaScriptExecutor)driver;

                    AssessmentQuestions questions = new AssessmentQuestions(driver);
                    _test = _extent.StartTest("AddQuestion");
                    // TimeUnit.SECONDS.sleep(3);
                    questions.NewQuestion().Click();

                    AddQuestion addQuestion = new AddQuestion(driver);

                    // TimeUnit.SECONDS.sleep(3);
                    //			addQuestion.moduleName("1_introduction");
                    //TimeUnit.SECONDS.sleep(1);
                    addQuestion.AddQuestionText(prop.getProperty("addQuestionText"));
                    js.ExecuteScript("document.getElementById('txtOption-1').scrollIntoView();");
                    addQuestion.Option1Data().SendKeys(prop.getProperty("option1Data"));
                    js.ExecuteScript("document.getElementById('txtOption-2').scrollIntoView();");
                    addQuestion.Option2Data().SendKeys(prop.getProperty("option2Data"));
                    js.ExecuteScript("document.getElementById('txtOption-3').scrollIntoView();");
                    addQuestion.Option3Data().SendKeys(prop.getProperty("option3Data"));
                    js.ExecuteScript("document.getElementById('txtOption-4').scrollIntoView();");
                    addQuestion.Option4Data().SendKeys(prop.getProperty("option4Data"));

                    //TimeUnit.SECONDS.sleep(1);
                    if (prop.getProperty("option1RDButton").Equals("1"))
                    {
                        addQuestion.Option1RDButton().Click();
                    }

                    if (prop.getProperty("option2RDButton").Equals("1"))
                    {
                        addQuestion.Option2RDButton().Click();
                    }

                    if (prop.getProperty("option3RDButton").Equals("1"))
                    {
                        addQuestion.Option3RDButton().Click();
                    }

                    if (prop.getProperty("option4RDButton").Equals("1"))
                    {
                        addQuestion.Option4RDButton().Click();
                    }

                    //TimeUnit.SECONDS.sleep(1);
                    addQuestion.Weightage().SendKeys(prop.getProperty("weightage"));
                    addQuestion.SaveQuestion().Click();
                    //logger.Debug("Question is created..");

                    //			Next to publish
                    questions.NextToPublish().Click();
                    _test.Log(LogStatus.Pass, "Assert Pass as condition is true");
                    _extent.EndTest(_test);
                }
                catch (Exception e)
                {
                    //logger.Error(e.Message);
                    screenShotObj.GetScreenshot(driver, "AddQuestion");
                }
            }
        }