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