Exemplo n.º 1
0
        public void Show(Action <string> onRoomSelected)
        {
            QuestionReader = new QuestionReader();

            ShowGameObject();

            _setRoomScreen.Show(roomName =>
            {
                _selectedRoom = roomName;

                onRoomSelected(roomName);
            });
        }
Exemplo n.º 2
0
 public QuestionOrchestrator(QuestionService questionService,
                             CategoryService categoryService,
                             TestService testService,
                             IQuestionServiceMapper questionMapper,
                             QuestionReader questionReader,
                             IUserContext userContext)
 {
     this.questionService = questionService;
     this.categoryService = categoryService;
     this.testService     = testService;
     this.questionMapper  = questionMapper;
     this.questionReader  = questionReader;
     this.userContext     = userContext;
 }
Exemplo n.º 3
0
 static void Main(string[] args)
 {
     try
     {
         QuestionReader         reader    = new QuestionReader(@"C:\Projects\answers.json");
         IEnumerable <Question> questions = reader.GetInputData();
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.Message);
     }
     finally
     {
         Console.Write("Нажмите любую клавишу для завершения");
         Console.ReadKey(true);
     }
 }
Exemplo n.º 4
0
    /// <summary>
    /// Assign the right mode for the interview
    /// </summary>
    /// <param name="op">Whether the question should be asked by the audience or not.</param>
    public void AssignReader(bool op)
    {
        SpeechEngine.SetLanguage(Locale.English);

        if (op)
        {
            _reader += VoiceReader;

            SpeechEngine.SetVoice(SpeechEngine.AvaillableVoices.First(voice => voice.Name.Equals("en-gb-x-rjs-network")));
        }
        else
        {
            _reader += AudienceReader;
            TheaterManager.Instance.ActivateColliders();
        }

        questionCanvas.SetActive(false);
        interviewCanvas.SetActive(true);
    }
Exemplo n.º 5
0
        public List <QuestionReader> ReadQuestions(string path)
        {
            var result        = new List <QuestionReader>();
            var book          = new Workbook(path);
            var sheets        = book.Sheets;
            var questionSheet = sheets.FirstOrDefault(x => x.Name == "Переформулировка");

            if (questionSheet is Worksheet worksheet)
            {
                var cells = worksheet.GetCells();

                for (var i = 0; i < cells.Count; i++)
                {
                    var questionId          = int.Parse(cells[i].Value);
                    var condition           = cells[i + 1].Value.Replace("'", "''");
                    var firstOption         = cells[i + 2].Value.Replace("'", "''");
                    var firstAnswersPercent = (int)double.Parse(cells[i + 3].Value.Replace('.', ','));
                    var tags                 = (cells[i + 4].Value).Split(',').Select(x => x.Trim().ToUpper().Replace("'", "''")).ToList();
                    var secondOption         = cells[i + 7].Value.Replace("'", "''");
                    var secondAnswersPercent = (int)double.Parse(cells[i + 8].Value.Replace('.', ','));
                    var question             = new QuestionReader
                    {
                        QuestionId          = questionId,
                        Condition           = condition,
                        FirstOption         = firstOption,
                        FirstAnswersPercent = firstAnswersPercent,
                        Tags                 = tags,
                        SecondOption         = secondOption,
                        SecondAnswersPercent = secondAnswersPercent
                    };
                    result.Add(question);
                    i = i + 9;
                }
            }
            return(result);
        }