Example #1
0
        public TaskDetailResponse GetTask([FromUri] TaskDetailRequest request)
        {
            // var request = new TaskDetailRequest() { Id = id, Token = token };

            var response = apiService.GetTaskDetails(request);

            return(response);
        }
Example #2
0
        public TaskDetailResponse GetTask(int id)
        {
            var request = new TaskDetailRequest()
            {
                Id = id
            };
            var response = service.GetTaskDetails(request);

            Clients.Caller.hello(response);
            return(response);
        }
Example #3
0
 public TaskDetailResponse GetTaskDetails(TaskDetailRequest request)
 {
     throw new NotImplementedException();
 }
        public TaskDetailResponse GetTaskDetails(TaskDetailRequest request)
        {
            var response = new TaskDetailResponse()
            {
                ErrorCode = ErrorCode.None,
                Success   = true,
                Task      =
                    new Task()
                {
                    Id          = 1,
                    Description = "First Task",
                    Items       = new List <Item>()
                    {
                        new Item()
                        {
                            Id       = 1,
                            TagName  = "AddToTen",
                            Question = new Question()
                            {
                                Id              = 1,
                                QuestionText    = "4 + 3 =",
                                QuestionContent = null,
                                Answers         = new List <Answer>()
                                {
                                    new Answer()
                                    {
                                        Id = 1, Text = "5"
                                    },
                                    new Answer()
                                    {
                                        Id = 2, Text = "6"
                                    },
                                    new Answer()
                                    {
                                        Id = 3, Text = "7", IsCorrect = true
                                    },
                                    new Answer()
                                    {
                                        Id = 4, Text = "8"
                                    },
                                },
                                CorrectAnswer = "7",
                                QuestionType  = EnumQuestionTypes.SingleSelectionFourAnswers
                            },
                        },
                        new Item()
                        {
                            Id       = 2,
                            TagName  = "AddToTen",
                            Question = new Question()
                            {
                                Id              = 2,
                                QuestionText    = "4 + 4 =",
                                QuestionContent = null,
                                Answers         = new List <Answer>()
                                {
                                    new Answer()
                                    {
                                        Id = 5, Text = "4"
                                    },
                                    new Answer()
                                    {
                                        Id = 6, Text = "6"
                                    },
                                    new Answer()
                                    {
                                        Id = 7, Text = "8", IsCorrect = true
                                    },
                                    new Answer()
                                    {
                                        Id = 8, Text = "10"
                                    },
                                },
                                CorrectAnswer = "8",
                                QuestionType  = EnumQuestionTypes.SingleSelectionFourAnswers
                            },
                        },
                        new Item()
                        {
                            Id       = 3,
                            TagName  = "AddToTen",
                            Question = new Question()
                            {
                                Id              = 3,
                                QuestionText    = "2 + 3 =",
                                QuestionContent = null,
                                Answers         = new List <Answer>()
                                {
                                    new Answer()
                                    {
                                        Id = 7, Text = "5", IsCorrect = true
                                    },
                                    new Answer()
                                    {
                                        Id = 5, Text = "7"
                                    },
                                    new Answer()
                                    {
                                        Id = 6, Text = "6"
                                    },

                                    new Answer()
                                    {
                                        Id = 8, Text = "10"
                                    },
                                },
                                CorrectAnswer = "5",
                                QuestionType  = EnumQuestionTypes.SingleSelection
                            },
                        },
                        new Item()
                        {
                            Id       = 4,
                            TagName  = "AddToTen",
                            Question = new Question()
                            {
                                Id              = 4,
                                QuestionText    = "4 + 6 =",
                                QuestionContent = null,
                                Answers         = new List <Answer>()
                                {
                                    new Answer()
                                    {
                                        Id = 5, Text = "4"
                                    },
                                    new Answer()
                                    {
                                        Id = 6, Text = "6"
                                    },
                                    new Answer()
                                    {
                                        Id = 7, Text = "8"
                                    },
                                    new Answer()
                                    {
                                        Id = 8, Text = "10", IsCorrect = true
                                    },
                                },
                                CorrectAnswer = "10",
                                QuestionType  = EnumQuestionTypes.SingleSelection
                            },
                        },
                        new Item()
                        {
                            Id       = 5,
                            TagName  = "AddToTen",
                            Question = new Question()
                            {
                                Id              = 5,
                                QuestionText    = "7 + 3 =",
                                QuestionContent = null,
                                Answers         = null,
                                CorrectAnswer   = "10",
                                QuestionType    = EnumQuestionTypes.SingleSelection
                            },
                        },
                    },
                    TotalQuestions     = 5,
                    GoalOfTotalCorrect = 5,
                    GoalSecondsSpend   = 35
                }
            };

            return(response);
        }