示例#1
0
 public List <Feedback> GetFeedBacksAssignedToUser(string userid)
 {
     //return SampleData.FeedbackList().Where(x => x.assigned == userid && x.status == "pending")?.ToList();
     return(_feedbackClientHelper.GetData(
                FilterDefinitionHandler.FilterFeedbacksByUserAndStatus(userid)
                , _feedbackCollection));
 }
示例#2
0
 public long GetLastAddedFeedbackReply()
 {
     //return SampleData.FeedbackList().OrderByDescending(x => x.id).FirstOrDefault()?.id ?? 0;
     return(_feedbackReplyClientHelper.GetDataBySorting(FilterDefinition <FeedbackReply> .Empty,
                                                        FilterDefinitionHandler.SortFeedBackReply(), _feedbackReplyCollection).FirstOrDefault()
            ?.id ?? 0);
 }
示例#3
0
 public FeedbackReply GetFeedbackReplyForQuestion(long questionId)
 {
     // return SampleData.FeedbackReplies().Where(r => r.feedbackid == questionId)?.FirstOrDefault();
     return(_feedbackReplyClientHelper.GetData(
                FilterDefinitionHandler.FilterFeedBackReply(questionId),
                _feedbackReplyCollection).FirstOrDefault());
 }
示例#4
0
        public BlindSpotQuizAttempts GetLatestAttemptByUser(string user)
        {
            var userAttempts = _blindSpotAttemptsMongoHelper.GetData(
                FilterDefinitionHandler.FilterBlindSpotQuizByUserId(user)
                , _blindSpotAttemptCollection);

            return(userAttempts.Where(att => att.attemptcount == userAttempts?.Max(x => x.attemptcount))?.FirstOrDefault());
        }
        public List <ReflectionToolQuizAttempt> GetReflectionToolAttempts(string userid, int attemptCount)
        {
            var result = _reflectionQuizAttemptsClientHelper.GetData(
                FilterDefinitionHandler.FilterReflectionByUserAndAttemptCount(userid, attemptCount)
                , _reflectionQuizAttemptsCollection);

            return(result);
        }
示例#6
0
        public List <UserDetails> GetUserDetailsByRole(string role)
        {
            var result = _userDetails.GetUserDataById(FilterDefinitionHandler.FilterUserDetailsByRole(role), _userDetailsCollection);

            if (result != null && result.Any())
            {
                return(result);
            }


            return(new List <UserDetails>());
        }
        public int GetAttemptCountForStoryTellingForImpactQuiz(string userid)
        {
            var result = _storyTellingForImpactQuizAttempts.GetData(FilterDefinitionHandler.FilterStoryTellingForImpactQuizByUserId(userid),
                                                                    _storyTellingForImpactAttemptQuizCollection)?.OrderByDescending(x => x.attemptcount);

            if (result != null && result.Any())
            {
                return(result.FirstOrDefault().attemptcount);
            }


            return(0);
        }
        public int GetAttemptCountForCuriousQuiz(string userid)
        {
            var result = _curiousQuizAttempts.GetData(FilterDefinitionHandler.FilterCuriosityByUserId(userid),
                                                      _curiousQuizAttemptCollection)?.OrderByDescending(x => x.attemptcount);

            if (result != null && result.Any())
            {
                return(result.FirstOrDefault().attemptcount);
            }


            return(0);
        }
        public int GetAttemptCountForGrowthMindsetQuiz(string userid)
        {
            var result = _growthMindsetQuizAttempts.GetData(FilterDefinitionHandler.FilterGrowthMindsetByUserId(userid),
                                                            _growthMindsetQuizAttemptCollection).OrderByDescending(x => x.attemptcount);

            if (result != null && result.Any())
            {
                return(result.FirstOrDefault().attemptcount);
            }


            return(0);
        }
        public int GetAttemptCountForReflectionToolQuiz(string userid)
        {
            var result = _reflectionQuizAttemptsClientHelper.GetData(FilterDefinitionHandler.FilterReflectionToolQuizByUserId(userid),
                                                                     _reflectionQuizAttemptsCollection)?.OrderByDescending(x => x.attemptcount);

            if (result.Any())
            {
                return(result.FirstOrDefault().attemptcount);
            }


            return(0);
        }
示例#11
0
        public List <UserDetails> GetUserDetailsById(string userId)
        {
            var result = _userDetails.GetUserDataById(FilterDefinitionHandler.FilterUserDetailsByUserId(userId), _userDetailsCollection);

            if (result == null || result.Count == 0)
            {
                result = _userDetails.GetUserDataById(FilterDefinitionHandler.FilterUserDetailsByEmailId(userId),
                                                      _userDetailsCollection);
            }

            if (result != null && result.Any())
            {
                return(result);
            }


            return(new List <UserDetails>());
        }
示例#12
0
        public List <Feedback> GetAllPendingFeedbacks()
        {
            //return SampleData.FeedbackList().Where(x => x.status == "pending" && x.type == "feedback").ToList();
            var feedbackList = _feedbackClientHelper.GetData(FilterDefinitionHandler.FilterFeedbacksByTypeAndStatus(),
                                                             _feedbackCollection);

            var replyList = _feedbackReplyClientHelper.GetData(FilterDefinitionHandler.FilterFeedBackReply(0),
                                                               _feedbackReplyCollection);

            if (replyList != null && replyList.Any())
            {
                foreach (var reply in replyList)
                {
                    Feedback feedback = new Feedback
                    {
                        question        = reply.feedback,
                        createtimestamp = reply.createtimestamp
                    };
                    feedbackList.Add(feedback);
                }
            }

            return(feedbackList);
        }
示例#13
0
 public void AddOrUpdateFeedbackFromAdmin(List <Feedback> feedbacks)
 {
     _feedbackClientHelper.DeleteMany(FilterDefinitionHandler.FilterFeedbacksByPendingStatus(), _feedbackCollection);
     _feedbackClientHelper.InsertMany(feedbacks, _feedbackCollection);
 }
示例#14
0
 public void DeleteFeedback(long id)
 {
     _feedbackClientHelper.DeleteOne(FilterDefinitionHandler.FilterFeedBackById(id), _feedbackCollection);
 }
示例#15
0
 public void UpdateFeedbackAssigned(Feedback feedback)
 {
     _feedbackClientHelper.UpdateOne(FilterDefinitionHandler.UpdateFeedbacksByAssignedAndTime(feedback.assigned),
                                     FilterDefinitionHandler.FilterFeedBackById(feedback.id), _feedbackCollection);
 }
示例#16
0
 public List <Feedback> GetFeedbackRequestsByUser(string userid)
 {
     //return SampleData.FeedbackList().Where(x => x.userid == userid)?.ToList();
     return(_feedbackClientHelper.GetData(FilterDefinitionHandler.FilterFeedBackByUser(userid),
                                          _feedbackCollection));
 }
 public int GetContinuousLearningSomewhatCount()
 {
     return(_continuousLearningQuizAttempts.GetData(
                FilterDefinitionHandler.FilterContinuousLearningBySomewhat(),
                _continuousLearningQuizAttemptCollection).Count);
 }
 public int GetContinuousLearningNoCount(string userid)
 {
     return(_continuousLearningQuizAttempts.GetData(
                FilterDefinitionHandler.FilterContinuousLearningByUseridAndNo(userid),
                _continuousLearningQuizAttemptCollection).Count);
 }
 public int GetMakingTimeQuizScoreOfUser(string userid, int attemptCount)
 {
     return(_makingTimeForMeQuizAttempts.GetData(
                FilterDefinitionHandler.FilterMakingTimeByUseridAndAttemptCount(userid, attemptCount),
                _makingTimeForMeAttemptCollection).Sum(x => x.score));
 }
 public int GetCultureObservationQuizScoreOfUser(string userid, int attemptCount)
 {
     return(_cultureObservationToolQuizAttempts.GetData(
                FilterDefinitionHandler.FilterCultureObservationByUseridAndAttemptCount(userid, attemptCount),
                _cultureObservationQuizAttemptCollection).Sum(x => x.score));
 }
 public int GetGrowthMindsetQuizScoreOfUser(string userid, int attemptCount)
 {
     return(_growthMindsetQuizAttempts.GetData(
                FilterDefinitionHandler.FilterGrowthMindsetByUseridAndAttemptCount(userid, attemptCount),
                _growthMindsetQuizAttemptCollection).Sum(x => x.score));
 }
        public int GetAttemptedQuizCountByUser(string userid)
        {
            var attempted = 0;



            if (_curiousQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterCuriosityByUserId(userid),
                                                      _curiousQuizAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_growthMindsetQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterGrowthMindsetByUserId(userid),
                                                            _growthMindsetQuizAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_makingTimeForMeQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterMakingTimeQuizByUserId(userid),
                                                              _makingTimeForMeAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_cultureObservationToolQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterCultureObservationQuizByUserId(userid),
                                                                     _cultureObservationQuizAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_blindSpotQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterBlindSpotQuizByUserId(userid),
                                                        _blindSpotQuizAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_continuousLearningQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterContinuousLearningQuizByUserId(userid),
                                                                 _continuousLearningQuizAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_learningMythsQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterLearningMythsQuizByUserId(userid),
                                                            _learningMythsQuizAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_productivityZoneQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterProductivityZoneQuizByUserId(userid),
                                                               _productivityZoneQuizAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_reflectionToolQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterReflectionToolQuizByUserId(userid),
                                                             _reflectionToolQuizAttemptCollection) > 0)
            {
                attempted += 1;
            }

            if (_storyTellingForImpactQuizAttempts.GetDocumentCount(FilterDefinitionHandler.FilterStoryTellingForImpactQuizByUserId(userid),
                                                                    _storyTellingForImpactAttemptQuizCollection) > 0)
            {
                attempted += 1;
            }


            return(attempted);
        }
示例#23
0
 public void UpdateBlindSpotCoWorkerResponse(BlindSpotCoWorkerReply response)
 {
     _blindSpotCoWorkerMongoHelper.UpdateOne(UpdateDefinitionHandler.UpdateCoWorkerResponse(response.selectedadjectives),
                                             FilterDefinitionHandler.FilterCoWorkerResponsesByReplyId(response.id), _blindSpotCoWorkerResponseCollection);
 }
示例#24
0
 public void UpdateFeedbackStatus(long id)
 {
     _feedbackClientHelper.UpdateOne(FilterDefinitionHandler.UpdateFeedBackStatus(id),
                                     FilterDefinitionHandler.FilterFeedBackById(id), _feedbackCollection);
 }
示例#25
0
 public List <BlindSpotCoWorkerReply> GetCoWorkerResponsesByAttempt(long attemptId)
 {
     return(_blindSpotCoWorkerMongoHelper.GetData(
                FilterDefinitionHandler.FilterCoWorkerResponsesByAttemptId(attemptId),
                _blindSpotCoWorkerResponseCollection));
 }