Example #1
0
        public void Get_diagnostic_content_should_not_return_tutorials_where_diagAssess_is_zero()
        {
            // Given
            const int customisationId = 14416;
            const int sectionId       = 214;

            // When
            var result = diagnosticAssessmentDataService.GetDiagnosticContent(customisationId, sectionId);

            // Then
            var expectedDiagnosticContent = new DiagnosticContent(
                "Entry Level - Win 7, Office 2010",
                "ESR",
                "Switching on and off",
                "https://www.dls.nhs.uk/tracking/entrylevel/win7/Assess/ELW7_0.03_Diag.dcr",
                true,
                85,
                1
                );

            expectedDiagnosticContent.Tutorials.AddRange(
                new[] { 909, 910, 913, 914, 915, 916 }
                );
            result.Should().BeEquivalentTo(expectedDiagnosticContent);
        }
Example #2
0
        public void Get_diagnostic_content_should_not_return_archived_tutorials()
        {
            // Given
            const int customisationId = 14212;
            const int sectionId       = 249;

            // When
            var result = diagnosticAssessmentDataService.GetDiagnosticContent(customisationId, sectionId);

            // Then
            var expectedDiagnosticContent = new DiagnosticContent(
                "Combined Office Course",
                "Word, Excel, and Outlook",
                "Working with tables",
                "https://www.dls.nhs.uk/tracking/RFM/L1_Word10/Assess/L1_2.06_Diag.dcr",
                true,
                85,
                4
                );

            expectedDiagnosticContent.Tutorials.AddRange(
                new[] { 1141, 1139, 1140 }
                );
            result.Should().BeEquivalentTo(expectedDiagnosticContent);
        }
Example #3
0
        public void Get_diagnostic_content_should_return_diagnostic_content()
        {
            // Given
            const int customisationId = 16588;
            const int sectionId       = 172;

            // When
            var result = diagnosticAssessmentDataService.GetDiagnosticContent(customisationId, sectionId);

            // Then
            var expectedDiagnosticContent = new DiagnosticContent(
                "Level 1 - Microsoft Word 2010",
                "Beginner",
                "Proofing and printing",
                "https://www.dls.nhs.uk/tracking/RFM/L1_Word10/Assess/L1_2.03_Diag.dcr",
                true,
                85,
                2
                );

            expectedDiagnosticContent.Tutorials.AddRange(
                new[] { 733, 734, 735, 736 }
                );
            result.Should().BeEquivalentTo(expectedDiagnosticContent);
        }
Example #4
0
        public DiagnosticContentViewModel(
            IConfiguration config,
            DiagnosticContent diagnosticContent,
            List <int> selectedTutorials,
            int customisationId,
            int centreId,
            int sectionId,
            int progressId,
            int candidateId
            )
        {
            CustomisationId = customisationId;
            SectionId       = sectionId;
            SectionName     = diagnosticContent.SectionName;
            CourseTitle     = diagnosticContent.CourseTitle;

            var tutorials = diagnosticContent.CanSelectTutorials
                ? selectedTutorials
                : diagnosticContent.Tutorials;

            ContentSource = ContentViewerHelper.IsScormPath(diagnosticContent.DiagnosticAssessmentPath)
                ? ContentViewerHelper.GetScormAssessmentSource(
                OldSystemEndpointHelper.GetScormPlayerUrl(config),
                centreId,
                customisationId,
                candidateId,
                sectionId,
                diagnosticContent.Version,
                diagnosticContent.DiagnosticAssessmentPath,
                type)
                : ContentViewerHelper.GetHtmlAssessmentSource(
                diagnosticContent.DiagnosticAssessmentPath,
                centreId,
                customisationId,
                candidateId,
                sectionId,
                diagnosticContent.Version,
                progressId,
                type,
                OldSystemEndpointHelper.GetTrackingUrl(config),
                tutorials,
                diagnosticContent.PassThreshold);
        }
Example #5
0
        public virtual ArmOperation StartJfr(WaitUntil waitUntil, DiagnosticContent content, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(content, nameof(content));

            using var scope = _appDeploymentResourceDeploymentsClientDiagnostics.CreateScope("AppDeploymentResource.StartJfr");
            scope.Start();
            try
            {
                var response  = _appDeploymentResourceDeploymentsRestClient.StartJfr(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken);
                var operation = new AppPlatformArmOperation(_appDeploymentResourceDeploymentsClientDiagnostics, Pipeline, _appDeploymentResourceDeploymentsRestClient.CreateStartJfrRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation);
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletionResponse(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }