@@ -2,12 +2,18 @@ import { Chapter, Variant } from 'js-slang/dist/types';
22import { mockStudents } from 'src/commons/mocks/UserMocks' ;
33import {
44 paginationToBackendParams ,
5- ungradedToBackendParams
5+ unpublishedToBackendParams
66} from 'src/features/grading/GradingUtils' ;
77
88import { GradingOverviews , GradingQuery } from '../../../../features/grading/GradingTypes' ;
99import { TeamFormationOverview } from '../../../../features/teamFormation/TeamFormationTypes' ;
10- import { Assessment , AssessmentOverview } from '../../../assessment/AssessmentTypes' ;
10+ import {
11+ Assessment ,
12+ AssessmentConfiguration ,
13+ AssessmentOverview ,
14+ AssessmentStatuses ,
15+ ProgressStatuses
16+ } from '../../../assessment/AssessmentTypes' ;
1117import { Notification } from '../../../notificationBadge/NotificationBadgeTypes' ;
1218import { GameState , Role , Story } from '../../ApplicationTypes' ;
1319import {
@@ -172,7 +178,7 @@ test('fetchGradingOverviews generates correct default action object', () => {
172178 type : FETCH_GRADING_OVERVIEWS ,
173179 payload : {
174180 filterToGroup : true ,
175- gradedFilter : ungradedToBackendParams ( false ) ,
181+ publishedFilter : unpublishedToBackendParams ( false ) ,
176182 pageParams : paginationToBackendParams ( 0 , 10 ) ,
177183 filterParams : { }
178184 }
@@ -181,15 +187,15 @@ test('fetchGradingOverviews generates correct default action object', () => {
181187
182188test ( 'fetchGradingOverviews generates correct action object' , ( ) => {
183189 const filterToGroup = false ;
184- const gradedFilter = ungradedToBackendParams ( true ) ;
190+ const publishedFilter = unpublishedToBackendParams ( true ) ;
185191 const pageParams = { offset : 123 , pageSize : 456 } ;
186192 const filterParams = { abc : 'xxx' , def : 'yyy' } ;
187- const action = fetchGradingOverviews ( filterToGroup , gradedFilter , pageParams , filterParams ) ;
193+ const action = fetchGradingOverviews ( filterToGroup , publishedFilter , pageParams , filterParams ) ;
188194 expect ( action ) . toEqual ( {
189195 type : FETCH_GRADING_OVERVIEWS ,
190196 payload : {
191197 filterToGroup : filterToGroup ,
192- gradedFilter : gradedFilter ,
198+ publishedFilter : publishedFilter ,
193199 pageParams : pageParams ,
194200 filterParams : filterParams
195201 }
@@ -328,11 +334,12 @@ test('setCourseRegistration generates correct action object', () => {
328334} ) ;
329335
330336test ( 'setAssessmentConfigurations generates correct action object' , ( ) => {
331- const assesmentConfigurations = [
337+ const assesmentConfigurations : AssessmentConfiguration [ ] = [
332338 {
333339 assessmentConfigId : 1 ,
334340 type : 'Mission1' ,
335341 isManuallyGraded : true ,
342+ isGradingAutoPublished : false ,
336343 displayInDashboard : true ,
337344 hasTokenCounter : false ,
338345 hasVotingFeatures : false ,
@@ -343,6 +350,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
343350 assessmentConfigId : 2 ,
344351 type : 'Mission2' ,
345352 isManuallyGraded : true ,
353+ isGradingAutoPublished : false ,
346354 displayInDashboard : true ,
347355 hasTokenCounter : false ,
348356 hasVotingFeatures : false ,
@@ -353,6 +361,7 @@ test('setAssessmentConfigurations generates correct action object', () => {
353361 assessmentConfigId : 3 ,
354362 type : 'Mission3' ,
355363 isManuallyGraded : true ,
364+ isGradingAutoPublished : false ,
356365 displayInDashboard : true ,
357366 hasTokenCounter : false ,
358367 hasVotingFeatures : false ,
@@ -533,6 +542,7 @@ test('updateAssessmentOverviews generates correct action object', () => {
533542 {
534543 type : 'Missions' ,
535544 isManuallyGraded : true ,
545+ isPublished : false ,
536546 closeAt : 'test_string' ,
537547 coverImage : 'test_string' ,
538548 id : 0 ,
@@ -541,10 +551,10 @@ test('updateAssessmentOverviews generates correct action object', () => {
541551 openAt : 'test_string' ,
542552 title : 'test_string' ,
543553 shortSummary : 'test_string' ,
544- status : ' not_attempted' ,
554+ status : AssessmentStatuses . not_attempted ,
545555 story : null ,
546556 xp : 0 ,
547- gradingStatus : 'none' ,
557+ isGradingPublished : false ,
548558 maxTeamSize : 1 ,
549559 hasVotingFeatures : false
550560 }
@@ -595,9 +605,10 @@ test('updateGradingOverviews generates correct action object', () => {
595605 studentUsername : 'E0123456' ,
596606 studentUsernames : [ ] ,
597607 submissionId : 1 ,
598- submissionStatus : 'attempting' ,
608+ isGradingPublished : false ,
609+ progress : ProgressStatuses . attempting ,
599610 groupName : 'group' ,
600- gradingStatus : 'excluded' ,
611+ submissionStatus : AssessmentStatuses . attempting ,
601612 questionCount : 6 ,
602613 gradedCount : 0
603614 }
@@ -772,6 +783,7 @@ test('updateAssessmentTypes generates correct action object', () => {
772783 assessmentConfigId : 1 ,
773784 type : 'Missions' ,
774785 isManuallyGraded : true ,
786+ isGradingAutoPublished : false ,
775787 displayInDashboard : true ,
776788 hasTokenCounter : false ,
777789 hasVotingFeatures : false ,
@@ -782,6 +794,7 @@ test('updateAssessmentTypes generates correct action object', () => {
782794 assessmentConfigId : 2 ,
783795 type : 'Quests' ,
784796 isManuallyGraded : true ,
797+ isGradingAutoPublished : false ,
785798 displayInDashboard : true ,
786799 hasTokenCounter : false ,
787800 hasVotingFeatures : false ,
@@ -791,7 +804,8 @@ test('updateAssessmentTypes generates correct action object', () => {
791804 {
792805 assessmentConfigId : 3 ,
793806 type : 'Paths' ,
794- isManuallyGraded : true ,
807+ isManuallyGraded : false ,
808+ isGradingAutoPublished : true ,
795809 displayInDashboard : true ,
796810 hasTokenCounter : false ,
797811 hasVotingFeatures : false ,
@@ -802,6 +816,7 @@ test('updateAssessmentTypes generates correct action object', () => {
802816 assessmentConfigId : 4 ,
803817 type : 'Contests' ,
804818 isManuallyGraded : true ,
819+ isGradingAutoPublished : false ,
805820 displayInDashboard : true ,
806821 hasTokenCounter : false ,
807822 hasVotingFeatures : false ,
@@ -810,8 +825,20 @@ test('updateAssessmentTypes generates correct action object', () => {
810825 } ,
811826 {
812827 assessmentConfigId : 5 ,
828+ type : 'PEs' ,
829+ isManuallyGraded : false ,
830+ isGradingAutoPublished : false ,
831+ displayInDashboard : true ,
832+ hasTokenCounter : false ,
833+ hasVotingFeatures : false ,
834+ hoursBeforeEarlyXpDecay : 0 ,
835+ earlySubmissionXp : 0
836+ } ,
837+ {
838+ assessmentConfigId : 6 ,
813839 type : 'Others' ,
814840 isManuallyGraded : true ,
841+ isGradingAutoPublished : false ,
815842 displayInDashboard : true ,
816843 hasTokenCounter : false ,
817844 hasVotingFeatures : false ,
@@ -831,6 +858,7 @@ test('deleteAssessmentConfig generates correct action object', () => {
831858 assessmentConfigId : 1 ,
832859 type : 'Mission1' ,
833860 isManuallyGraded : true ,
861+ isGradingAutoPublished : false ,
834862 displayInDashboard : true ,
835863 hasTokenCounter : false ,
836864 hasVotingFeatures : false ,
0 commit comments