import { QuestionEntity } from "../Entities/QuestionEntity";
import { ToggleQuestionChallengeAnswerIsCorrectUC } from "../UC/ToggleQuestionAnswerIsCorrect";
export function toggleAnswerIsCorrect(answerID, appObjects) {
    const questionEntity = QuestionEntity.get(appObjects);
    if (!questionEntity) {
        appObjects.submitWarning("toggleAnswerIsCorrect", "Can't find QuestionEntity");
        return;
    }
    const answer = questionEntity.getAnswer(answerID);
    if (!answer) {
        appObjects.submitWarning("toggleAnswerIsCorrect", "Can't find Answer by ID");
        return;
    }
    const uc = answer.appObject.getComponent(ToggleQuestionChallengeAnswerIsCorrectUC.type);
    if (!uc) {
        appObjects.submitWarning("toggleAnswerIsCorrect", "Can't find ToggleQuestionChallengeAnswerIsCorrectUC on Answer");
        return;
    }
    uc.toggleIsCorrect();
}
//# sourceMappingURL=toggleAnswerIsCorrect.js.map