"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setAnswerText = setAnswerText;
const QuestionEntity_1 = require("../Entities/QuestionEntity");
const SetAnswerTextUC_1 = require("../UC/SetAnswerTextUC");
function setAnswerText(answerID, text, appObjects) {
    const questionEntity = QuestionEntity_1.QuestionEntity.get(appObjects);
    if (!questionEntity) {
        appObjects.submitWarning("setAnswerText", "Can't find QuestionEntity");
        return;
    }
    const answer = questionEntity.getAnswer(answerID);
    if (!answer) {
        appObjects.submitWarning("setAnswerText", "Can't find Answer by ID");
        return;
    }
    const uc = answer.appObject.getComponent(SetAnswerTextUC_1.SetAnswerTextUC.type);
    if (!uc) {
        appObjects.submitWarning("setAnswerText", "Can't find SetAnswerTextUC on Answer");
        return;
    }
    uc.setText(text);
}
//# sourceMappingURL=setAnswerText.js.map