UNPKG

@instructure/quiz-interactions

Version:

A React UI component Library for quiz interaction types.

16 lines 592 B
import map from 'lodash/fp/map'; import max from 'lodash/fp/max'; export default function (_ref) { var _ref$properties = _ref.properties, properties = _ref$properties === void 0 ? {} : _ref$properties, _ref$scoringData = _ref.scoringData, scoringData = _ref$scoringData === void 0 ? {} : _ref$scoringData; var shouldVaryPoints = properties.varyPointsByAnswer; if (shouldVaryPoints && scoringData.values) { var points = map(function (_ref2) { var points = _ref2.points; return parseFloat(points) || 0; }, scoringData.values); return max(points); } }