"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _Fetcher = _interopRequireDefault(require("../../common/util/Fetcher"));

var _withDynamoPagination = _interopRequireDefault(require("../../common/util/withDynamoPagination"));

var _callHandlers = require("../../common/api/callHandlers");

var _constants = require("@instructure/quiz-common/lib/constants");

function getQuizSessionEvents(quizSessionId) {
  var url = "/api/quiz_sessions/".concat(quizSessionId, "/quiz_session_events");
  var fetcher = Reflect.construct((0, _withDynamoPagination.default)(_Fetcher.default), [{
    callType: _constants.QUIZ_SESSION_EVENTS_FETCH_CALL
  }]);
  return function (dispatch, getState) {
    return fetcher.paginatedGet(url, {
      actionCreator: _callHandlers.handleQuizSessionEventsResponse
    });
  };
}