Exemple #1
0
        /// <summary>
        /// Process received answers from client and sending the result back
        /// </summary>
        /// <param name="client"></param>
        /// <param name="data"></param>
        private static void ProcessAnswers(TcpClient client, object data)
        {
            _csv = new CsvImport(_exampath);
            var filename = _server.GetExamFileName(client);
            var list     = _csv.GetExercises(filename);
            var erh      = new ExerciseResultHelper();
            var result   = erh.ProcessResult((List <DefaultAnswer>)data, list);
            var examlog  = new ExamLog
            {
                ConsoleOutput = true
            };

            examlog.AppendToLog(_server.GetIpFromClient(client), erh.ExistingAnswers, erh.CorrectAnswers);
            _server.SendPacket(client, result);
        }