herum-shared 0.1.39 → 0.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -147,6 +147,9 @@ const dateRangeTimeRangeWithoutSecondsPlaceHolder = `${dateTimeWithoutSecondsPla
147
147
  const resourceIdPlaceholder = "$resourceId";
148
148
  const defaultCloseTime = new Date('01-01-2999');
149
149
  const defaultOpenTime = new Date('01-01-1999');
150
+ const legacyCorrectAnswerPropertyPath = `.Quiz.Questions[].Answers[].IsCorrect`;
151
+ const correctAnswerPropertyPath = `.Quiz.Questions[].ClosedContent.Answers[].IsCorrect`;
152
+ const matchingSourceIndexPropertyPath = `.Quiz.Questions[].MatchingContent.sources[].index`;
150
153
  const openStatus = {
151
154
  openingTime: new Date(),
152
155
  closingTime: defaultCloseTime,
@@ -211,7 +214,15 @@ const defaultAuthorizationObject = {
211
214
  },
212
215
  isCorrect() {
213
216
  return cloneDeep({
214
- propertyPath: `[${resourceIdPlaceholder}].Quiz.Questions[].Answers[].IsCorrect`,
217
+ propertyPath: `[${resourceIdPlaceholder}]${correctAnswerPropertyPath}`,
218
+ authorizationType: MicroResourceAuthorizationType.view,
219
+ ...closeStatus,
220
+ collectionItemType: 'Resources'
221
+ });
222
+ },
223
+ matchingSourceIndex() {
224
+ return cloneDeep({
225
+ propertyPath: `[${resourceIdPlaceholder}]${matchingSourceIndexPropertyPath}`,
215
226
  authorizationType: MicroResourceAuthorizationType.view,
216
227
  ...closeStatus,
217
228
  collectionItemType: 'Resources'
@@ -225,14 +236,17 @@ function getResourceDefaultAuthorizations() {
225
236
  return [defaultAuthorizationObject.view()];
226
237
  }
227
238
  function getPublishAuthorization() {
228
- return [defaultAuthorizationObject.resourceGrade(), defaultAuthorizationObject.questionGrade(), defaultAuthorizationObject.areAnswersCorrect(), defaultAuthorizationObject.answerNotes(), defaultAuthorizationObject.isCorrect()];
239
+ return [defaultAuthorizationObject.resourceGrade(), defaultAuthorizationObject.questionGrade(), defaultAuthorizationObject.areAnswersCorrect(), defaultAuthorizationObject.answerNotes(), defaultAuthorizationObject.isCorrect(), defaultAuthorizationObject.matchingSourceIndex()];
229
240
  }
230
241
  function getMediaDefaultAuthorizations() {
231
242
  return [defaultAuthorizationObject.view(), defaultAuthorizationObject.edit()];
232
243
  }
233
244
  function getPropertyPathsOfPublishAuthorization() {
234
245
  return ([defaultAuthorizationObject.resourceGrade().propertyPath, defaultAuthorizationObject.questionGrade().propertyPath,
235
- defaultAuthorizationObject.areAnswersCorrect().propertyPath, defaultAuthorizationObject.answerNotes().propertyPath, defaultAuthorizationObject.isCorrect().propertyPath]);
246
+ defaultAuthorizationObject.areAnswersCorrect().propertyPath, defaultAuthorizationObject.answerNotes().propertyPath, defaultAuthorizationObject.isCorrect().propertyPath, defaultAuthorizationObject.matchingSourceIndex().propertyPath]);
247
+ }
248
+ function normalizeQuizAuthorizationPropertyPath(propertyPath) {
249
+ return propertyPath?.replace(legacyCorrectAnswerPropertyPath, correctAnswerPropertyPath);
236
250
  }
237
251
  const viewPermissionLabel = 'צפייה';
238
252
 
@@ -738,5 +752,5 @@ const validatorsNames = {
738
752
  * Generated bundle index. Do not edit.
739
753
  */
740
754
 
741
- export { activeDragPath, additionTagName, anySubFileTypeWildCard, assignmentMetadata, attributes, audioAndVideoPreviewSupportedMimes, audioAndVideoPreviewSupportedSuffixes, audioPreviewSupportedMimes, audioPreviewSupportedSuffixes, calendarActiveColorCssVariable, calendarHoverColorCssVariable, calendarLibraryBodyCellSelector, calendarLibrarySelector, checkboxTypes, collectionFormKeys, collectionFormValues, datePlaceHolder, dateRangePlaceHolder, dateRangeTimeRangePlaceHolder, dateRangeTimeRangeWithoutSecondsPlaceHolder, dateTimePlaceHolder, dateTimeWithoutSecondsPlaceHolder, dayInMilliSeconds, defaultAuthorizationObject, defaultCloseTime, defaultGrade, defaultOpenTime, defaultPlaceholder, defaultTrackTextChangesStyle, defaultUploadsManagerTitle, defaultUserId, deletionTagName, dialogsCloseActionButtons, dialogsDescriptions, dialogsNotes, dialogsSubmitActionButtons, dialogsTitles, dragPath, editorContainerElementId, errorHeadersToSet, femaleAvatarPath, filesSuffixes, formStatuses, formatError, formsErrorMessages, generalKeys, getMediaDefaultAuthorizations, getPropertyPathsOfPublishAuthorization, getPublishAuthorization, getQuizDefaultAuthorizations, getResourceDefaultAuthorizations, getSignUpFormFieldsByFields, getSignUpMethod, globalErrorHandlingHeader, herumClosedListMultiSelectType, initialMediaSettings, inputs, insuranceDialogPageNavigationData, keyboardAsciiCodes, keyboardKeys, maleAvatarPath, maxImageHeight, maxImageWidth, minDateError, minuteInMilliseconds, mouseEnter, mouseEnterHandlerKey, mouseLeave, mouseLeaveHandlerKey, previewImageKey, radioButtonTypes, readynessDisplayName, regexExpressions, resourceColumnPrefix, resourceFileTypes, resourceFormKeys, resourceIdPlaceholder, resourceKeys, resourceTypes, resourcesFilesSuffixes, routes, secondInMilliseconds, sideBarSizeButtonId, signUpFormFields, signUpFormFieldsData, signUpFormKeys, sixMonthsInDays, skipToastHeader, startEndDateError, statusCodes, structHierarchyTreeMaxHeight, svgsStrings, system, tableRowHeights, timePattern, timePlaceHolder, timeWithoutSecondsPlaceHolder, timerActiveColorCssVariable, timerHoverColorCssVariable, timerItemSizeColorCssVariable, timestampError, toastContext, toastStates, toastStatuses, toastsKeys, toastsTemplates, toastsTemplatesKeys, types, uploadStatuses, uploadsManagerKeys, uploadsProgressMetadataTypes, validatorsNames, videoPreviewSupportedMimes, videoPreviewSupportedSuffixes, viewPermissionLabel };
755
+ export { activeDragPath, additionTagName, anySubFileTypeWildCard, assignmentMetadata, attributes, audioAndVideoPreviewSupportedMimes, audioAndVideoPreviewSupportedSuffixes, audioPreviewSupportedMimes, audioPreviewSupportedSuffixes, calendarActiveColorCssVariable, calendarHoverColorCssVariable, calendarLibraryBodyCellSelector, calendarLibrarySelector, checkboxTypes, collectionFormKeys, collectionFormValues, correctAnswerPropertyPath, datePlaceHolder, dateRangePlaceHolder, dateRangeTimeRangePlaceHolder, dateRangeTimeRangeWithoutSecondsPlaceHolder, dateTimePlaceHolder, dateTimeWithoutSecondsPlaceHolder, dayInMilliSeconds, defaultAuthorizationObject, defaultCloseTime, defaultGrade, defaultOpenTime, defaultPlaceholder, defaultTrackTextChangesStyle, defaultUploadsManagerTitle, defaultUserId, deletionTagName, dialogsCloseActionButtons, dialogsDescriptions, dialogsNotes, dialogsSubmitActionButtons, dialogsTitles, dragPath, editorContainerElementId, errorHeadersToSet, femaleAvatarPath, filesSuffixes, formStatuses, formatError, formsErrorMessages, generalKeys, getMediaDefaultAuthorizations, getPropertyPathsOfPublishAuthorization, getPublishAuthorization, getQuizDefaultAuthorizations, getResourceDefaultAuthorizations, getSignUpFormFieldsByFields, getSignUpMethod, globalErrorHandlingHeader, herumClosedListMultiSelectType, initialMediaSettings, inputs, insuranceDialogPageNavigationData, keyboardAsciiCodes, keyboardKeys, legacyCorrectAnswerPropertyPath, maleAvatarPath, matchingSourceIndexPropertyPath, maxImageHeight, maxImageWidth, minDateError, minuteInMilliseconds, mouseEnter, mouseEnterHandlerKey, mouseLeave, mouseLeaveHandlerKey, normalizeQuizAuthorizationPropertyPath, previewImageKey, radioButtonTypes, readynessDisplayName, regexExpressions, resourceColumnPrefix, resourceFileTypes, resourceFormKeys, resourceIdPlaceholder, resourceKeys, resourceTypes, resourcesFilesSuffixes, routes, secondInMilliseconds, sideBarSizeButtonId, signUpFormFields, signUpFormFieldsData, signUpFormKeys, sixMonthsInDays, skipToastHeader, startEndDateError, statusCodes, structHierarchyTreeMaxHeight, svgsStrings, system, tableRowHeights, timePattern, timePlaceHolder, timeWithoutSecondsPlaceHolder, timerActiveColorCssVariable, timerHoverColorCssVariable, timerItemSizeColorCssVariable, timestampError, toastContext, toastStates, toastStatuses, toastsKeys, toastsTemplates, toastsTemplatesKeys, types, uploadStatuses, uploadsManagerKeys, uploadsProgressMetadataTypes, validatorsNames, videoPreviewSupportedMimes, videoPreviewSupportedSuffixes, viewPermissionLabel };
742
756
  //# sourceMappingURL=herum-shared-constants.mjs.map