From 33212a049580c3c0ed9cdd34ce4cdfa0d27c31ee Mon Sep 17 00:00:00 2001 From: marcobarilari Date: Mon, 16 Nov 2020 15:41:23 +0100 Subject: [PATCH 1/3] fix code that causes error in getIsQuestionToAsk --- src/gui/createQuestionList.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/createQuestionList.m b/src/gui/createQuestionList.m index 22d709b6..272bde14 100644 --- a/src/gui/createQuestionList.m +++ b/src/gui/createQuestionList.m @@ -36,6 +36,8 @@ if cfg.subject.askGrpSess(1) questions.questionsToAsk{1, 1} = questions.group; questions.questionsToAsk{1, 2} = false; + else + questions.questionsToAsk{1, 2} = false; end % the subject number @@ -46,6 +48,8 @@ if cfg.subject.askGrpSess(2) questions.questionsToAsk{3, 1} = questions.session; questions.questionsToAsk{3, 2} = true; + else + questions.questionsToAsk{3, 2} = flase; end % the run number From c83265c142645bd10cbc73a928193afd6e1fddba Mon Sep 17 00:00:00 2001 From: marcobarilari Date: Mon, 16 Nov 2020 16:33:01 +0100 Subject: [PATCH 2/3] mh fix --- src/gui/createQuestionList.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/createQuestionList.m b/src/gui/createQuestionList.m index 272bde14..18e2955e 100644 --- a/src/gui/createQuestionList.m +++ b/src/gui/createQuestionList.m @@ -36,7 +36,7 @@ if cfg.subject.askGrpSess(1) questions.questionsToAsk{1, 1} = questions.group; questions.questionsToAsk{1, 2} = false; - else + else questions.questionsToAsk{1, 2} = false; end @@ -48,7 +48,7 @@ if cfg.subject.askGrpSess(2) questions.questionsToAsk{3, 1} = questions.session; questions.questionsToAsk{3, 2} = true; - else + else questions.questionsToAsk{3, 2} = flase; end From af811a025ad58cac462a64a96a06c8016ddee97f Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 16 Nov 2020 21:39:45 +0100 Subject: [PATCH 3/3] update test createQuestionList --- src/gui/createQuestionList.m | 2 +- tests/test_createQuestionList.m | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/gui/createQuestionList.m b/src/gui/createQuestionList.m index 18e2955e..eaa612bf 100644 --- a/src/gui/createQuestionList.m +++ b/src/gui/createQuestionList.m @@ -49,7 +49,7 @@ questions.questionsToAsk{3, 1} = questions.session; questions.questionsToAsk{3, 2} = true; else - questions.questionsToAsk{3, 2} = flase; + questions.questionsToAsk{3, 2} = false; end % the run number diff --git a/tests/test_createQuestionList.m b/tests/test_createQuestionList.m index 88a9e08c..a37dd6cb 100644 --- a/tests/test_createQuestionList.m +++ b/tests/test_createQuestionList.m @@ -19,6 +19,25 @@ function test_createQuestionListBasic() 'Enter the session number (i.e day ; 1-999): ', true 'Enter the run number (1-999): ', true}; - assertEqual(expectedCell(3, 1), questions.questionsToAsk(3, 1)); + assertEqual(expectedCell, questions.questionsToAsk); + +end + + +function test_createQuestionListRestricted() + + %% set up + cfg = struct(); + cfg.subject.askGrpSess = [false false]; + + questions = createQuestionList(cfg); + + expectedCell = { ... + [], false + 'Enter subject number (1-999): ', true + [], false + 'Enter the run number (1-999): ', true}; + + assertEqual(expectedCell, questions.questionsToAsk); end