File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1100,23 +1100,25 @@ export class AddonModWorkshopProvider {
11001100 const args : string [ ] = field . name . split ( '_' ) ;
11011101 const name = args [ 0 ] ;
11021102 const idx = args [ 3 ] ;
1103- const idy = args [ 6 ] || false ;
1103+ const idy = args [ 6 ] ;
1104+ const idxNumber = parseInt ( args [ 3 ] , 10 ) ;
1105+ const idyNumber = parseInt ( args [ 6 ] , 10 ) ;
11041106
1105- if ( parseInt ( idx , 10 ) + '' == idx ) {
1107+ if ( ! isNaN ( idxNumber ) ) {
11061108 if ( ! parsedFields [ idx ] ) {
11071109 parsedFields [ idx ] = {
1108- number : idx + 1 , // eslint-disable-line id-blacklist
1110+ number : idxNumber + 1 , // eslint-disable-line id-blacklist
11091111 } ;
11101112 }
11111113
1112- if ( idy && parseInt ( idy , 10 ) + '' == idy ) {
1114+ if ( ! isNaN ( idyNumber ) ) {
11131115 if ( ! parsedFields [ idx ] . fields ) {
11141116 parsedFields [ idx ] . fields = [ ] ;
11151117 }
11161118
11171119 if ( ! parsedFields [ idx ] . fields [ idy ] ) {
11181120 parsedFields [ idx ] . fields [ idy ] = {
1119- number : idy + 1 , // eslint-disable-line id-blacklist
1121+ number : idyNumber + 1 , // eslint-disable-line id-blacklist
11201122 } ;
11211123 }
11221124 parsedFields [ idx ] . fields [ idy ] [ name ] = field . value ;
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ Feature: Test basic usage of workshop activity in app
8282 Then I should find "Task to do" within "Assess peers" "ion-item" in the app
8383
8484 When I press "The Answer" in the app
85- And I press "Grade for Aspect 01 " in the app
85+ And I press "Grade for Aspect 1 " in the app
8686 And I press "10 / 10" in the app
8787 And I press "Save" in the app
8888 Then I should find "Assessed submission" in the app
You can’t perform that action at this time.
0 commit comments