Exemplo n.º 1
0
        public IEnumerable <Question> ReadQuestions()
        {
            QuestionResponseFiles questionResponseFiles = GetQuestionResponseScanFiles();

            //return QuestionReader.Read(questionResponseFiles.QuestionFiles, _questionRegexValuesList, questionResponseFiles.BaseDirectory);
            //return new QuestionReader { _regexList = regexList }._Read(files, baseDirectory);
            return(new QuestionReader {
                RegexList = _questionRegexValuesList, MaxLinesPerQuestion = _maxLinesPerQuestion, MaxLinesPerChoice = _maxLinesPerChoice,
                TraceUnknowValue = _traceUnknowValue
            }.Read(questionResponseFiles.QuestionFiles, questionResponseFiles.BaseDirectory));
        }
Exemplo n.º 2
0
        //public QuestionsManager(string baseDirectory, string directory, RegexValuesList questionRegexValuesList, RegexValuesList responseRegexValuesList)
        //{
        //    _baseDirectory = baseDirectory;
        //    _directory = zPath.Combine(baseDirectory, directory);
        //    _filename = zPath.GetFileName(directory);
        //    _questionRegexValuesList = questionRegexValuesList;
        //    _responseRegexValuesList = responseRegexValuesList;
        //}

        public void SetDirectory(string directory)
        {
            if (directory != null && !zPath.IsPathRooted(directory))
            {
                directory = zPath.Combine(_baseDirectory, directory);
            }
            _directory             = directory;
            _filename              = null;
            _questionResponseFiles = null;
            _scanFiles             = null;
            _questions             = null;
            _responses             = null;
        }
Exemplo n.º 3
0
 // string directory, string filename, string baseDirectory
 public QuestionResponseFiles GetQuestionResponseScanFiles()
 {
     if (_questionResponseFiles == null)
     {
         _questionResponseFiles = new QuestionResponseFiles();
         _questionResponseFiles.BaseDirectory = _baseDirectory;
         // directory, filename
         string[] files = GetScanFiles().ToArray();
         _questionResponseFiles.QuestionFiles = new string[files.Length - 1];
         Array.Copy(files, _questionResponseFiles.QuestionFiles, files.Length - 1);
         _questionResponseFiles.ResponseFile = files[files.Length - 1];
     }
     return(_questionResponseFiles);
 }
Exemplo n.º 4
0
        //private IEnumerable<Response> GetResponses()
        //{
        //    return ResponseReader.Read(GetQuestionResponseScanFiles().ResponseFile, _responseRegexValuesList);
        //}

        public IEnumerable <Response> ReadResponses()
        {
            QuestionResponseFiles questionResponseFiles = GetQuestionResponseScanFiles();

            return(ResponseReader.Read(questionResponseFiles.ResponseFile, _responseRegexValuesList, questionResponseFiles.BaseDirectory));
        }