"use strict"; /** * Value object for assessment question item. * * @author Sohan Rao * * @constructor */ function AssessmentQuestionVO() { // simple fields this.questionId = ''; this.text = ''; this.isDefault = false; this.desirableAnswer = false; this.weight = 0.01; this.actionLabel = null; this.actionType = null; this._persistence_shouldRefreshFetchGroup = false; this.textMap = { default: '' }; this.isVisible = false; this.sequenceNo = 0; this.isOpen = false; this.delete = false; } // inherit BaseVO AssessmentQuestionVO.prototype = new BaseVO(); // correct the constructor pointer AssessmentQuestionVO.prototype.constructor = AssessmentQuestionVO; /** * @override * @return {Array} */ AssessmentQuestionVO.prototype.getProps = function () { return BaseVO.prototype.getProps().concat('questionId', 'text', 'isDefault', 'desirableAnswer', 'weight', 'actionLabel', 'actionType', 'textMap', 'isVisible'); }; /** * Returns answer object based on desirable answer selection. * * @returns {Object} */ AssessmentQuestionVO.prototype.getAnswer = function () { return { questionId: this.id, answer: this.desirableAnswer }; }; AssessmentQuestionVO.prototype.deleteItem = function () { this.delete = true; }; AssessmentQuestionVO.prototype.openItem = function () { this.isOpen = true; }; AssessmentQuestionVO.prototype.closeItem = function () { this.isOpen = false; }; AssessmentQuestionVO.prototype.removeLabel = function (label) { delete this.textMap[label]; };