From f7e465e1f61dd8341bf732a94c34f1ad30e8aa1f Mon Sep 17 00:00:00 2001 From: Seth Bashford Date: Tue, 9 Jul 2019 09:55:33 -0500 Subject: [PATCH] refactor --- src/recognition-test/RecognitionTestModel.cpp | 15 ++++++++++++--- src/recognition-test/RecognitionTestModel.hpp | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/recognition-test/RecognitionTestModel.cpp b/src/recognition-test/RecognitionTestModel.cpp index 7e55edd01..b184d758c 100644 --- a/src/recognition-test/RecognitionTestModel.cpp +++ b/src/recognition-test/RecognitionTestModel.cpp @@ -172,6 +172,10 @@ namespace av_speech_in_noise { void FixedLevelMethod::loadTargets(const std::string &p) { targetList->loadFromDirectory(p); + updateCompletion(); + } + + void FixedLevelMethod::updateCompletion() { complete_ = targetList->empty(); } @@ -212,7 +216,7 @@ namespace av_speech_in_noise { void FixedLevelMethod::submitResponse( const coordinate_response_measure::SubjectResponse & ) { - complete_ = targetList->empty(); + updateCompletion(); } void FixedLevelMethod::submitResponse(const FreeResponse &) { @@ -227,8 +231,13 @@ namespace av_speech_in_noise { int snr_dB() override { return {}; } void submitCorrectResponse() override {} void submitIncorrectResponse() override {} - void writeTrial(OutputFile *, const coordinate_response_measure::SubjectResponse &) override {} - void submitResponse(const coordinate_response_measure::SubjectResponse &) override {} + void writeTrial( + OutputFile *, + const coordinate_response_measure::SubjectResponse & + ) override {} + void submitResponse( + const coordinate_response_measure::SubjectResponse & + ) override {} void submitResponse(const FreeResponse &) override {} }; diff --git a/src/recognition-test/RecognitionTestModel.hpp b/src/recognition-test/RecognitionTestModel.hpp index 1b71aa27e..da9ebd67c 100644 --- a/src/recognition-test/RecognitionTestModel.hpp +++ b/src/recognition-test/RecognitionTestModel.hpp @@ -246,6 +246,8 @@ namespace av_speech_in_noise { const coordinate_response_measure::SubjectResponse & ) override; void submitResponse(const FreeResponse &) override; + private: + void updateCompletion(); }; class RecognitionTestModel :