UNPKG

@instructure/quiz-interactions

Version:

A React UI component Library for quiz interaction types.

12 lines (10 loc) 397 B
export const UNCATEGORIZED = 'uncategorized' export function getSortedCategories(categories, categoryOrder) { // this check is for questions which were created before // categoryOrder was introduced if (!categoryOrder) { // NOTE: Object.values does not guarantee category order return Object.values(categories) } return categoryOrder.map(categoryId => categories[categoryId]) }