Ejemplo n.º 1
0
        //utilisé pour savoir si la note du test est au moyenne ou pas
        public double?CaclculateAverageOfTest(int Idtest)
        {
            t_evaluationtest test          = GetEvaluationTest(Idtest);
            double?          allQuestcoeff = 0;


            double?MaxNoteOfTest = 0;

            foreach (t_criteria question in test.t_criteria)
            {
                allQuestcoeff += question.Cr_coefficient;
                foreach (t_possibleresponse respon in question.t_possibleresponse)
                {
                    if (respon.isRight == 1)
                    {
                        MaxNoteOfTest += respon.Pr_score * question.Cr_coefficient;
                    }
                }
            }

            double?e = MaxNoteOfTest / allQuestcoeff;

            double?AverageNoteOfTest = e / 2;

            return(AverageNoteOfTest);
        }
Ejemplo n.º 2
0
        public t_evaluationtest GetEvaluationTest(int idTest)
        {
            t_evaluationtest test = _context.t_evaluationtest.Include("t_criteria")
                                    .Include("t_criteria.t_possibleresponse")
                                    .Where(e => e.ET_ID == idTest)
                                    .FirstOrDefault();

            return(test);
        }