예제 #1
0
        public async Task CalculatePercentileTest()
        {
            var test = CreateTest("Mathematics");
            await _testRepository.CreateTestAsync(test, "5");

            var testAttendee = CreateTestAttendee(test.Id);
            await _testConductRepository.RegisterTestAttendeesAsync(testAttendee);

            var percentile = await _reportRepository.CalculatePercentileAsync(testAttendee.Id, test.Id);

            Assert.Equal(testAttendee.Report.Percentile, percentile);
        }
예제 #2
0
 public async Task <IActionResult> GetStudentPercentile([FromRoute] int attendeeId, [FromRoute] int testId)
 {
     return(Ok(await _reportRepository.CalculatePercentileAsync(attendeeId, testId)));
 }