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()); } }
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()); } }
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)); } }
public IHttpActionResult Get(string languageID) { SurveyQueries query = new SurveyQueries(); return(Ok(query.GetQuestions(languageID))); }
public Dictionary <object, double> GetAverageRatingPerSubsection(string moduleID) { SurveyQueries query = new SurveyQueries(); return(CalculateRating(query.GetCurrentSubsectionSurveyResults(moduleID))); }