Ejemplo n.º 1
0
        public void Get_diagnostic_assessment_should_return_diagnostic_assessment()
        {
            // Given
            const int customisationId = 5148;
            const int candidateId     = 95318;
            const int sectionId       = 115;

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

            // Then
            var expectedDiagnosticAssessment = new DiagnosticAssessment(
                "Level 2 - Microsoft Excel 2010",
                null,
                "Using Formulas",
                "Using formulas",
                4,
                7,
                10,
                "https://www.dls.nhs.uk/tracking/MOST/Excel10Core/Assess/L2_Excel_2010_Diag_4.dcr",
                true,
                "https://www.dls.nhs.uk/tracking/MOST/Excel10Core/Assess/L2_Excel_2010_Post_4.dcr",
                false,
                false,
                DateTime.Parse("2014-01-07 15:18:51.033"),
                0,
                85,
                85,
                0,
                383,
                null,
                false,
                true,
                "",
                false
                );

            expectedDiagnosticAssessment.Tutorials.AddRange(
                new[]
            {
                new DiagnosticTutorial("Create and edit simple formulas", 383),
                new DiagnosticTutorial("Understand and enforce simple precedence in formulas", 384),
                new DiagnosticTutorial("Nest parentheses in formulas", 385),
                new DiagnosticTutorial("Use relative and absolute cell references", 386),
                new DiagnosticTutorial("Refer to other worksheets", 387),
                new DiagnosticTutorial("Link other workbooks", 388)
            }
                );
            result.Should().BeEquivalentTo(expectedDiagnosticAssessment);
        }
Ejemplo n.º 2
0
        public void Get_diagnostic_assessment_should_return_diagnostic_assessment_if_not_enrolled()
        {
            // Given
            const int customisationId = 18438;
            const int candidateId     = 83744;
            const int sectionId       = 993;

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

            // Then
            var expectedDiagnosticAssessment = new DiagnosticAssessment(
                "5 Jan Test",
                null,
                "New",
                "Working with Microsoft Office applications",
                0,
                0,
                13,
                "https://www.dls.nhs.uk/CMS/CMSContent/Course120/Diagnostic/01-Diag-Working-with-Microsoft-Office-applications/itspplayer.html",
                true,
                "https://www.dls.nhs.uk/CMS/CMSContent/Course120/PLAssess/01-PLA-Working-with-Microsoft-Office-applications/itspplayer.html",
                true,
                false,
                null,
                0,
                0,
                85,
                100,
                4340,
                994,
                true,
                true,
                null,
                false
                );

            expectedDiagnosticAssessment.Tutorials.AddRange(
                new[]
            {
                new DiagnosticTutorial("Introduction to applications", 4340),
                new DiagnosticTutorial("Common screen elements", 4341),
                new DiagnosticTutorial("Using ribbon tabs", 4342),
                new DiagnosticTutorial("Getting help", 4343)
            }
                );
            result.Should().BeEquivalentTo(expectedDiagnosticAssessment);
        }
     public DiagnosticAssessmentViewModel(DiagnosticAssessment diagnosticAssessment, int customisationId, int sectionId)
     {
         CourseTitle              = diagnosticAssessment.CourseTitle;
         CourseDescription        = diagnosticAssessment.CourseDescription;
         SectionName              = diagnosticAssessment.SectionName;
         DiagnosticAssessmentPath = diagnosticAssessment.DiagnosticAssessmentPath;
         CanSelectTutorials       = diagnosticAssessment.CanSelectTutorials && diagnosticAssessment.Tutorials.Any();
         AttemptsInformation      = diagnosticAssessment.DiagnosticAttempts switch
         {
             0 => "Not attempted",
             1 => $"{diagnosticAssessment.SectionScore}/{diagnosticAssessment.MaxSectionScore} " +
             $"- {diagnosticAssessment.DiagnosticAttempts} attempt",
             _ => $"{diagnosticAssessment.SectionScore}/{diagnosticAssessment.MaxSectionScore} " +
             $"- {diagnosticAssessment.DiagnosticAttempts} attempts"
         };
         HasPostLearningAssessment =
             diagnosticAssessment.PostLearningAssessmentPath != null && diagnosticAssessment.IsAssessed;
         NextTutorialId                 = diagnosticAssessment.NextTutorialId;
         NextSectionId                  = diagnosticAssessment.NextSectionId;
         CustomisationId                = customisationId;
         SectionId                      = sectionId;
         Tutorials                      = diagnosticAssessment.Tutorials;
         OnlyItemInOnlySection          = !diagnosticAssessment.OtherItemsInSectionExist && !diagnosticAssessment.OtherSectionsExist;
         OnlyItemInThisSection          = !diagnosticAssessment.OtherItemsInSectionExist;
         ShowCompletionSummary          = OnlyItemInOnlySection && diagnosticAssessment.IncludeCertification;
         CompletionSummaryCardViewModel = new CompletionSummaryCardViewModel(
             customisationId,
             diagnosticAssessment.Completed,
             diagnosticAssessment.MaxPostLearningAssessmentAttempts,
             diagnosticAssessment.IsAssessed,
             diagnosticAssessment.PostLearningAssessmentPassThreshold,
             diagnosticAssessment.DiagnosticAssessmentCompletionThreshold,
             diagnosticAssessment.TutorialsCompletionThreshold
             );
         DiagnosticStartButtonAdditionalStyling = diagnosticAssessment.DiagnosticAttempts > 0 ? "nhsuk-button--secondary" : "";
         DiagnosticStartButtonText = diagnosticAssessment.DiagnosticAttempts > 0 ? "Restart assessment" : "Start assessment";
         ShowNextButton            = diagnosticAssessment.DiagnosticAttempts > 0 && !OnlyItemInOnlySection;
     }
 }