Esempio n. 1
0
        public JSONWrappers.Question ToJSON()
        {
            JSONWrappers.Question jsonQuestion = new JSONWrappers.Question
            {
                Url      = PicturesDataBase.ConvertPathToUrl(Path),
                Type     = Type.ToString("G"),
                Severity = Severity.ToString("G")
            };

            return(jsonQuestion);
        }
Esempio n. 2
0
        public static List <JSONWrappers.Question> CreateTest(TestConfig config)
        {
            List <JSONWrappers.Question> questions = new List <JSONWrappers.Question>(config.TotalCount);

            foreach (string path in PicturesDataBase.SamplePictures(config))
            {
                Debug.Assert(File.Exists(path), $"Got invalid picture path: {path}.");
                Question question = new Question(path);
                questions.Add(question.ToJSON());
            }

            return(questions);
        }
Esempio n. 3
0
 public static Question FromJSON(JSONWrappers.Question jsonQuestion)
 {
     return(new Question(PicturesDataBase.ConvertUrlToPath(jsonQuestion.Url)));
 }