Beispiel #1
0
        private async Task <IActionResult> ReturnSignpostingRecommendedLearningView(
            int selfAssessmentId,
            int candidateId,
            int page,
            string?searchString
            )
        {
            var assessment = selfAssessmentService.GetSelfAssessmentForCandidateById(candidateId, selfAssessmentId) !;

            var(recommendedResources, apiIsAccessible) =
                await recommendedLearningService.GetRecommendedLearningForSelfAssessment(selfAssessmentId, candidateId);

            var searchSortPaginationOptions = new SearchSortFilterAndPaginateOptions(
                new SearchOptions(searchString),
                new SortOptions(nameof(RecommendedResource.RecommendationScore), GenericSortingHelper.Descending),
                null,
                new PaginationOptions(page)
                );

            var result = searchSortFilterPaginateService.SearchFilterSortAndPaginate(
                recommendedResources,
                searchSortPaginationOptions
                );

            var model = new RecommendedLearningViewModel(
                assessment,
                result,
                apiIsAccessible
                );

            return(View("RecommendedLearning", model));
        }
Beispiel #2
0
        private async Task <IActionResult> ReturnSignpostingRecommendedLearningView(
            int selfAssessmentId,
            int candidateId
            )
        {
            var assessment           = selfAssessmentService.GetSelfAssessmentForCandidateById(candidateId, selfAssessmentId) !;
            var recommendedResources =
                await recommendedLearningService.GetRecommendedLearningForSelfAssessment(selfAssessmentId, candidateId);

            var model = new RecommendedLearningViewModel(assessment, recommendedResources);

            return(View("RecommendedLearning", model));
        }