UNPKG

@instructure/quiz-interactions

Version:

A React UI component Library for quiz interaction types.

75 lines (73 loc) 2.52 kB
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; import _createClass from "@babel/runtime/helpers/esm/createClass"; import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; import _inherits from "@babel/runtime/helpers/esm/inherits"; import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; function _callSuper(_this, derived, args) { function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (e) { return false; } } derived = _getPrototypeOf(derived); return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args)); } import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Take from '../Take'; /** --- category: Essay --- Essay Show component ```jsx_example <SettingsSwitcher locales={LOCALES}> <EssayShow itemBody="Why did the Roman Empire fall?" userResponse={{ value: 'This is some text' }} interactionData={{ rce: true, spellCheck: true, wordCount: true, wordLimitEnabled: true, wordLimitMax: 10, wordLimitMin: 1, notes: 'Teachers grading notes' }} /> </SettingsSwitcher> ``` **/ var EssayShow = /*#__PURE__*/function (_Component) { function EssayShow() { _classCallCheck(this, EssayShow); return _callSuper(this, EssayShow, arguments); } _inherits(EssayShow, _Component); return _createClass(EssayShow, [{ key: "render", value: function render() { return /*#__PURE__*/React.createElement(Take, { interactionData: this.props.interactionData, itemBody: this.props.itemBody, userResponse: this.props.userResponse, readOnly: true }); } }]); }(Component); _defineProperty(EssayShow, "propTypes", { interactionData: PropTypes.object.isRequired, itemBody: PropTypes.string.isRequired, userResponse: PropTypes.object // FIX: this should be scoringData }); _defineProperty(EssayShow, "defaultProps", { userResponse: void 0 }); export { EssayShow as default };