'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = undefined;

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _class, _temp;

var _reduxRecord = require('./reduxRecord');

var _reduxRecord2 = _interopRequireDefault(_reduxRecord);

var _instructureValidations = require('instructure-validations');

var _constants = require('../../constants');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Response = (_temp = _class = function (_ReduxRecord) {
  (0, _inherits3.default)(Response, _ReduxRecord);

  function Response() {
    (0, _classCallCheck3.default)(this, Response);
    return (0, _possibleConstructorReturn3.default)(this, (Response.__proto__ || Object.getPrototypeOf(Response)).apply(this, arguments));
  }

  (0, _createClass3.default)(Response, [{
    key: 'getItem',
    value: function getItem() {
      if (this.itemId) {
        return this.stateHelper().findSessionItem(this.id).getItem();
      }
    }
  }]);
  return Response;
}((0, _reduxRecord2.default)({
  attempt: null,
  itemId: null,
  largeFormatResponse: null,
  position: null,
  userResponse: null,
  id: null
})), _class.validations = {
  userResponse: [(0, _instructureValidations.rule)('maxContent', { limit: _constants.TAKE_CHAR_LIMIT })]
}, _temp);
exports.default = Response;