コード例 #1
0
        public IHttpActionResult Get(string moduleID, string languageID)
        {
            AuthenticatedUser user = authenticate.confirmToken();

            if (user.UserID != 0)
            {
                SurveyQueries query = new SurveyQueries();
                return(Ok(query.GetComments(moduleID, languageID)));
            }
            else
            {
                return(Unauthorized());
            }
        }
コード例 #2
0
        public IHttpActionResult Get(string content)
        {
            AuthenticatedUser user = authenticate.confirmToken();

            if (user.UserID != 0)
            {
                ObjectBuilder   builder         = new ObjectBuilder();
                SurveyQueries   query           = new SurveyQueries();
                CompletedSurvey completedSurvey = builder.BuildCompletedSurvey(content, user.UserID);
                query.PostAnswers(completedSurvey);

                return(Ok("success"));
            }
            else
            {
                return(Unauthorized());
            }
        }
コード例 #3
0
        public IHttpActionResult Post()
        {
            AuthenticatedUser user = authenticate.confirmToken();

            try
            {
                if (user.UserID != 0)
                {
                    ObjectBuilder listBuilder = new ObjectBuilder();
                    SurveyQueries query       = new SurveyQueries();
                    List <Answer> answers     = listBuilder.BuildAnswerList(HttpContext.Current.Request["answers"]);
                }
                else
                {
                    return(Unauthorized());
                }
                return(Ok("success"));
            }
            catch (Exception e)
            {
                return(InternalServerError(e));
            }
        }
コード例 #4
0
        public IHttpActionResult Get(string languageID)
        {
            SurveyQueries query = new SurveyQueries();

            return(Ok(query.GetQuestions(languageID)));
        }
コード例 #5
0
        public Dictionary <object, double> GetAverageRatingPerSubsection(string moduleID)
        {
            SurveyQueries query = new SurveyQueries();

            return(CalculateRating(query.GetCurrentSubsectionSurveyResults(moduleID)));
        }