File tree Expand file tree Collapse file tree 3 files changed +5
-71
lines changed
src/courses/default/questions/fillIn Expand file tree Collapse file tree 3 files changed +5
-71
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -249,9 +249,12 @@ export class BlanksCard extends Question {
249249 s = s . substring ( 2 , s . length - 2 ) ;
250250 const split = s . split ( '||' ) ;
251251 if ( split . length > 1 ) {
252- const answers = split [ 0 ] . split ( '|' ) ;
252+ const answers = split [ 0 ] . split ( '|' ) . map ( ( a ) => a . trim ( ) ) ;
253253 // remove answers from distractors (makes for easier editing to allow answers in the distractor list)
254- const distractors = split [ 1 ] . split ( '|' ) . filter ( ( d ) => ! answers . includes ( d ) ) ;
254+ const distractors = split [ 1 ]
255+ . split ( '|' )
256+ . map ( ( d ) => d . trim ( ) )
257+ . filter ( ( d ) => ! answers . includes ( d ) ) ;
255258
256259 const options = distractors ;
257260 options . push ( answers [ randomInt ( 0 , answers . length - 1 ) ] ) ;
You can’t perform that action at this time.
0 commit comments