{"version":3,"sources":["SharedLogic/creator/action-types.js","SharedLogic/product/action-types.js","SharedLogic/tree/lms/action-types.js","SharedLogic/tree/learningSystem/action-types.js","SharedLogic/user/action-types.js","SharedLogic/lo/action-types.js","SharedLogic/product/reducer.js","SharedLogic/user/reducer.js","SharedLogic/lo/reducer.js","SharedLogic/creator/reducer.js","SharedLogic/ui/reducer.js","SharedLogic/tree/reducer/services.js","SharedLogic/tree/reducer/index.js","SharedLogic/tree/lms/services.js","SharedLogic/olamonim/reducer.js","SharedLogic/olamonim/action-types.js","SharedLogic/tree/data/action-types.js","SharedLogic/ui/action-types.js","SharedLogic/tree/learningSystem/services.js"],"names":["CLEAR_ADD_BUTTON_ACTIVE_NODE","CLEAR_ADD_MENU_ACTIVE_NODE","CLEAR_BAD_DROP_PROPERTIES","CLEAR_DRAGGED_NODE","CLEAR_DROP_ZONE_NODE","CLEAR_EDIT_MENU_ACTIVE_NODE","CLEAR_EDIT_TITLE_ACTIVE_NODE","CLEAR_ITEMS_DEPOT_SRC_NODE","CLEAR_LAST_LO_STUDIO_EDITED_ITEM_KEY","CLEAR_NODE_TO_DELETE","CLEAR_NODE_TO_HIDE","SET_ADD_BUTTON_ACTIVE_NODE","SET_ADD_MENU_ACTIVE_NODE","SET_BAD_DROP_PROPERTIES","SET_DELETE_NODES_MAP","SET_DRAGGED_NODE","SET_DROP_ZONE_NODE","SET_EDIT_MENU_ACTIVE_NODE","SET_EDIT_TITLE_ACTIVE_NODE","SET_ITEMS_DEPOT_SRC_NODE","SET_LAST_LO_STUDIO_EDITED_ITEM_KEY","SET_NEW_NODES_MAP","SET_NODE_TITLE","SET_NODE_TO_DELETE","SET_NODE_TO_HIDE","SET_UNDO_AVAILABILITY","SET_UNDO_PENDING","GET_PRODUCT_CONFIG","GET_PRODUCT_I18N","SET_AS_ADAPTIVE","CLEAR_STATE","LOAD_STATE","LOAD_STATE_SUCCESS","LOAD_NODE_EVALUTAIONS_SUCCESS","LOAD_DOCUMENTS_NUM_OF_SECTIONS","ADD_AUDIENCE","GET_LAST_VISIT","GET_USER_COURSES","GET_USER_TASKS","REMOVE_AUDIENCE","SET_ACTIVE_AUDIENCE","SET_USER","CLEAR_USER_TASKS","SET_AUDIENCE_STUDENTS","RESET_DOCUMENT","LOAD_DOCUMENT","SET_WAITING_FOR_LOADING","SET_WAITING_FOR_LOGOUT","initState","config","i18n","reducer","state","arguments","length","undefined","action","type","_objectSpread","isAdaptiveEnabled","isLoggedIn","isTasksLoaded","courses","tasks","data","immediateTasksCount","activeTasksCount","overdueTasksCount","examTasksCount","evaluatedTasksCount","students","_action$groupsData","_action$groupsData2","_action$groupsData3","isAuthorized","groups","groupsData","audiences","isNMM","activeAudience","audience","slice","i","audienceId","push","id","splice","lastVisit","connection","viewSettings","isWaitingForLoading","isWaitingForLogout","resetConnection","parentId","status","addButtonActiveNode","addDropActiveNode","addMenuActiveNode","editMenuActiveNode","editTitleActiveNode","nodeBeingDraggedUniqueId","itemsDepotSrcNode","dropDisabledNodesMap","nodeToDelete","nodeToHide","isUndoAvailable","isUndoPending","isActionInsideFolder","newNodesMap","toDeleteNodesMap","badDropTotalItemsCount","badDropBadItemsCount","lastLoStudioEditedItemKey","enableItemsAddMap","key","itemKey","totalItemsCount","badItemsCount","isPending","studioEditedItem","editedItemKey","isInsideFolder","RESET_TREE_VIEW","teacherMenuActiveNode","teacherSchedulerActiveNodeKeys","teacherInfoActiveNodeKeys","addMenuActiveItem","editMenuActiveItem","alertType","modalType","preventScroll","SET_TEACHER_MENU_ACTIVE_NODE","Boolean","node","document","querySelector","concat","SET_TEACHER_SCHEDULER_ACTIVE_NODE","nodeKeys","SET_TEACHER_INFO_ACTIVE_NODE","SHOW_ALERT_MESSAGE","HIDE_ALERT_MESSAGE","SHOW_MODAL_MESSAGE","HIDE_MODAL_MESSAGE","RESET_VIEW","SET_TREE","PREVENT_SCROLL","updateFolderItemsLmsAsLoading","treeData","folderId","children","forEach","cid","lms","updateItemsLmsData","lmsData","FolderId","DocumentId","isAdaptive","scope","isDisabled","TaskId","TaskType","toLowerCase","isStarted","itemType","item","parents","p","parent","index","scheduledInnerItems","indexOf","IsScheduled","updateParentsAsInnerScheduled","TeacherLmsInfo","States","hasActiveStudents","hasInProgressItems","updateFolderAsWithInProgressItems","StudentLmsInfo","FeedbackType","Date","FeedbackTime","State","isLmsInfoHidden","updateItemsByScope","scopes","Object","values","filter","s","updatedNode","keys","nodeKey","pages","docScope","docPageState","mergeEvaluationsToLms","mergeSingleNodeEvalutaionToLms","_node$lms","evaluations","scopeScore","ByLastTry","Scores","AutoScore","AutoWeight","EvaluatedWeight","FinalScore","ManualScore","updateItemsProgress","_calculateStudentProg","calculateStudentProgressByPages","progress","hasWorkToDo","foldersToUpdate","nodeLms","_calculateStudentProg2","calculateStudentProgressByTasks","folderKey","folder","_calculateStudentProg3","inScheduleMode","activeFilterType","tasksSortType","environmentTasks","newTreeData","ev","methodName","value","_defineProperty","documentsNumOfPages","documentKey","replace","numOfPages","SET_RB_STATE","ruleBaseState","ruleBase","SET_NODE_FLAG","nodeID","SET_NODE_VISIBILITY","nodes","updatedTree","SET_TREE_ACTIVE_FILTER_TYPE","filterType","SET_TASKS_SORT_TYPE","sortBy","SET_ENVIRONMENT_TASKS","items","enumTaskState","none","inprogressaftersubmit","startedtrial","submitted","evaluated","createTaskOnTheFly","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","user","defaultTaskType","createTaskAs","url","wrap","_context","prev","next","window","tocGlobalEndpoints","treeServiceAPIURL","productId","scoreType","loLanguage","timeZoneOffsetInHours","abrupt","Promise","resolve","fetch","headers","method","then","response","json","stop","_x","_x2","_x3","_x4","_x5","apply","fetchLmsForFolder","userId","schoolId","environmentId","rootId","currentLms","fetchOptions","body","JSON","stringify","childId","map","ItemId","fetchLmsForItem","fetchLmsForFolderItemPairs","pairs","pair","documentId","_item$FolderId","_pairs$find","find","fetchAllEnvironmentTasks","_ref2","_callee2","_context2","cache","catch","err","_x6","extractTime","date","getHours","getMinutes","isEqualDate","anotherDate","getDate","getMonth","getYear","getScheduleFromLms","schedule","startDate","StartTime","now","endDate","EndTime","startDateString","endDateString","startDateTime","endDateTime","getScheduleState","IsDisabled","isSubmitted","isOnSchedule","isFutureTask","isLateTask","studentLmsInfo","isSubmittedLate","endTime","SubmittedTime","isSubmittedAtLeastOnce","Trial","isReturnedToFix","taskType","isPartial","isValidScore","isDisabledTask","role","getScoreAsNumber","scores","Number","toFixed","getScoreAsNumberLevel","score","getPositiveScores","positiveScores","getProgressTotal","states","progressKeys","progressTotal","getItemProgress","calcAvg","arrayOfNumbers","avg","reduce","number","isNaN","Math","round","isDisabledExam","shouldConfirmHide","isHidden","Done","InProgress","WaitingForCheck","isNotScheduledExam","isConvertToExamDisabled","isStudentStarted","Skipped","tree","totalNumOfTasks","totalNumOfDoneTasks","_node$lms$StudentLmsI","_node$lms2","_node$lms2$StudentLms","folderDocuments","isHiddenByStudio","includes","_document$lms","_document$lms$Student","_document$lms2","_document$lms2$Studen","docsToDo","n","settings","wallet","currentMap","ui","UPDATE_USER_AS_INTERACTED","userInteracted","LOAD_USER_STATUS","UPDATE_USER_STATUS","LOAD_SETTINGS","settingsObj","LOAD_USER_WALLET","walletItems","UPDATE_USER_WALLET_ITEM","walletItem","UPDATE_MAP_ID","mapId","UPDATE_MAP_STATUS","isMapLoaded","UPDATE_UI_ELEMENTS","UPDATE_CLASS_NAMES","extractIdFromNodeKey","nodeKeyParts","split","sendLearningEvent","cetEvent","result","learningEvent","buildLearningEvent","cet","microservices","activityapi","activity","send","sent","t0","error","isValidParam","param","studentId","verb","actionData","optionalData","_cetEvent$optionalDat","contentParentId","loId","applicationId","sessionId","structureId","contentGroupingId","contentLanguage","categoryId","objectAdditionalInformation","affected","affectedIds","accumulator","currentValue","objectType","nodeId","pageId","sectionId","questionId","elementId","interactionType","objectFieldsGraded","fieldsScore","fieldsResponse","scoreScaled","scoreMax","scoreRaw","completion","buildStudentStateMap","studentState","numOfSkippedPages","studentStateMap","studentStateNodes","_loop","nodeType","nodeStatus","nodeMetadata","parse","metadata","documentVersion","majorVersion","minorVersion","structureVersion","documentState","docPages","docCurrentElement","pagesSkipped","versions","pageStatus","substring","lastIndexOf","fetchStudentTreeState","learningapi","getByApplication","withEvaluation","fetchStudentStateByNodes","_ref3","_callee3","nodeIds","_context3","getByNodeIds","methods","enforceCalculation","fetchStudentNextItem","_ref4","_callee4","scopeId","engineType","walkBy","nextState","_args4","_context4","get","console","log","_x7","_x8","triggerEndOfNode","_ref5","_callee5","productConfig","_user$activeAudience","productType","triggerInfo","_context5","noCheck","productName","productLocalName","triggerName","triggerData","productID","audienceID","userID","schoolID","entityID","entityType","entityLang","mode","credentials","productPlayerServicesAPIURL","_x9","_x10","_x11","fetchEvaluationForNodes","_ref6","_callee6","_args6","_context6","evaluation","getByPath","pathes","_x12","_x13","_x14","fetchStudentsStateByType","_ref7","_callee7","studentIds","_context7","getMultipleByElementType","withNotVisited","_x15","_x16","_x17","buildStudentStateMapForTeacher","studentsState","studentsCount","stateMap","treeNodeId","NotStarted","fetchDocumentsNumOfSections","_ref8","_callee8","_context8","getDocumentsNumOfSections","_x18","getNumOfDonePages","donePages","page","max","totalNumOfPages","totalNumOfDonePages","isNodeDone"],"mappings":"oIAAA,s5BAAO,IAAMA,EAA+B,+BAC/BC,EAA6B,6BAC7BC,EAA4B,4BAC5BC,EAAqB,qBACrBC,EAAuB,uBACvBC,EAA8B,8BAC9BC,EAA+B,+BAC/BC,EAA6B,6BAC7BC,EAAuC,uCACvCC,EAAuB,uBACvBC,EAAqB,qBACrBC,EAA6B,6BAC7BC,EAA2B,2BAC3BC,EAA0B,0BAC1BC,EAAuB,uBACvBC,EAAmB,mBACnBC,EAAqB,qBACrBC,EAA4B,4BAC5BC,EAA6B,6BAC7BC,EAA2B,2BAC3BC,EAAqC,qCACrCC,EAAoB,oBACpBC,EAAiB,iBACjBC,EAAqB,qBACrBC,EAAmB,mBACnBC,EAAwB,wBACxBC,EAAmB,kB,mCC1BhC,sGAA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1B,EAAK5E,MAAyC,SAAtB4E,EAAK0B,MAAMjE,OAE5G,CAEA,OAAO,CACT,C","file":"static/js/7.9ad10e81.chunk.js","sourcesContent":["export const CLEAR_ADD_BUTTON_ACTIVE_NODE = 'CLEAR_ADD_BUTTON_ACTIVE_NODE';\r\nexport const CLEAR_ADD_MENU_ACTIVE_NODE = 'CLEAR_ADD_MENU_ACTIVE_NODE';\r\nexport const CLEAR_BAD_DROP_PROPERTIES = 'CLEAR_BAD_DROP_PROPERTIES';\r\nexport const CLEAR_DRAGGED_NODE = 'CLEAR_DRAGGED_NODE';\r\nexport const CLEAR_DROP_ZONE_NODE = 'CLEAR_DROP_ZONE_NODE';\r\nexport const CLEAR_EDIT_MENU_ACTIVE_NODE = 'CLEAR_EDIT_MENU_ACTIVE_NODE';\r\nexport const CLEAR_EDIT_TITLE_ACTIVE_NODE = 'CLEAR_EDIT_TITLE_ACTIVE_NODE';\r\nexport const CLEAR_ITEMS_DEPOT_SRC_NODE = 'CLEAR_ITEMS_DEPOT_SRC_NODE';\r\nexport const CLEAR_LAST_LO_STUDIO_EDITED_ITEM_KEY = 'CLEAR_LAST_LO_STUDIO_EDITED_ITEM_KEY';\r\nexport const CLEAR_NODE_TO_DELETE = 'CLEAR_NODE_TO_DELETE';\r\nexport const CLEAR_NODE_TO_HIDE = 'CLEAR_NODE_TO_HIDE';\r\nexport const SET_ADD_BUTTON_ACTIVE_NODE = 'SET_ADD_BUTTON_ACTIVE_NODE';\r\nexport const SET_ADD_MENU_ACTIVE_NODE = 'SET_ADD_MENU_ACTIVE_NODE';\r\nexport const SET_BAD_DROP_PROPERTIES = 'SET_BAD_DROP_PROPERTIES';\r\nexport const SET_DELETE_NODES_MAP = 'SET_DELETE_NODES_MAP';\r\nexport const SET_DRAGGED_NODE = 'SET_DRAGGED_NODE';\r\nexport const SET_DROP_ZONE_NODE = 'SET_DROP_ZONE_NODE';\r\nexport const SET_EDIT_MENU_ACTIVE_NODE = 'SET_EDIT_MENU_ACTIVE_NODE';\r\nexport const SET_EDIT_TITLE_ACTIVE_NODE = 'SET_EDIT_TITLE_ACTIVE_NODE';\r\nexport const SET_ITEMS_DEPOT_SRC_NODE = 'SET_ITEMS_DEPOT_SRC_NODE';\r\nexport const SET_LAST_LO_STUDIO_EDITED_ITEM_KEY = 'SET_LAST_LO_STUDIO_EDITED_ITEM_KEY';\r\nexport const SET_NEW_NODES_MAP = 'SET_NEW_NODES_MAP';\r\nexport const SET_NODE_TITLE = 'SET_NODE_TITLE';\r\nexport const SET_NODE_TO_DELETE = 'SET_NODE_TO_DELETE';\r\nexport const SET_NODE_TO_HIDE = 'SET_NODE_TO_HIDE';\r\nexport const SET_UNDO_AVAILABILITY = 'SET_UNDO_AVAILABILITY';\r\nexport const SET_UNDO_PENDING = 'SET_UNDO_PENDING';","export const GET_PRODUCT_CONFIG = 'GET_PRODUCT_CONFIG';\r\nexport const GET_PRODUCT_I18N = 'GET_PRODUCT_I18N';\r\nexport const SET_AS_ADAPTIVE = 'SET_AS_ADAPTIVE';","export const CLEAR_STATE = 'CLEAR_STATE';\r\nexport const LOAD_STATE = 'LOAD_STATE';\r\nexport const LOAD_STATE_SUCCESS = 'LOAD_STATE_SUCCESS';","export const LOAD_STATE_SUCCESS = 'LOAD_STATE_SUCCESS';\r\nexport const LOAD_NODE_EVALUTAIONS_SUCCESS = 'LOAD_NODE_EVALUTAIONS_SUCCESS';\r\nexport const LOAD_DOCUMENTS_NUM_OF_SECTIONS = 'LOAD_DOCUMENTS_NUM_OF_SECTIONS';","export const ADD_AUDIENCE = 'ADD_AUDIENCE';\r\nexport const GET_LAST_VISIT = 'GET_LAST_VISIT';\r\nexport const GET_USER_COURSES = 'GET_USER_COURSES';\r\nexport const GET_USER_TASKS = 'GET_USER_TASKS';\r\nexport const REMOVE_AUDIENCE = 'REMOVE_AUDIENCE';\r\nexport const SET_ACTIVE_AUDIENCE = 'SET_ACTIVE_AUDIENCE';\r\nexport const SET_USER = 'SET_USER';\r\nexport const CLEAR_USER_TASKS = 'CLEAR_USER_TASKS';\r\nexport const SET_AUDIENCE_STUDENTS = 'SET_AUDIENCE_STUDENTS';","export const RESET_DOCUMENT = 'RESET_DOCUMENT';\r\nexport const LOAD_DOCUMENT = 'LOAD_DOCUMENT';\r\nexport const SET_WAITING_FOR_LOADING = 'SET_WAITING_FOR_LOADING';\r\nexport const SET_WAITING_FOR_LOGOUT = 'SET_WAITING_FOR_LOGOUT';","import { GET_PRODUCT_CONFIG, GET_PRODUCT_I18N, SET_AS_ADAPTIVE } from './action-types';\r\n\r\nconst initState = {\r\n config: {},\r\n i18n: {}\r\n};\r\n\r\nconst reducer = (state = initState, action) => {\r\n switch (action.type) {\r\n case GET_PRODUCT_CONFIG: {\r\n const config = { ...action.config };\r\n return { ...state, config };\r\n }\r\n case GET_PRODUCT_I18N:\r\n return { ...state, i18n: action.i18n };\r\n case SET_AS_ADAPTIVE: {\r\n const config = { ...state.config, isAdaptiveEnabled: true };\r\n return { ...state, config };\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default reducer;\r\n","import {\r\n SET_USER,\r\n SET_ACTIVE_AUDIENCE,\r\n ADD_AUDIENCE,\r\n REMOVE_AUDIENCE,\r\n GET_USER_COURSES,\r\n GET_LAST_VISIT,\r\n GET_USER_TASKS,\r\n CLEAR_USER_TASKS,\r\n SET_AUDIENCE_STUDENTS\r\n} from './action-types';\r\n\r\nconst initState = {\r\n isLoggedIn: false,\r\n isTasksLoaded: false,\r\n courses: undefined,\r\n tasks: {\r\n data: [],\r\n immediateTasksCount: undefined,\r\n activeTasksCount: undefined,\r\n overdueTasksCount: undefined,\r\n examTasksCount: undefined,\r\n evaluatedTasksCount: undefined\r\n },\r\n students: undefined\r\n};\r\n\r\nconst reducer = (state = initState, action) => {\r\n switch (action.type) {\r\n case SET_USER: {\r\n const isLoggedIn = action.data ? true : false;\r\n let data = action.data ? action.data : {};\r\n\r\n if (isLoggedIn) {\r\n data.isAuthorized = action.isAuthorized ? true : false;\r\n data.groups = action.groupsData?.groups ? action.groupsData.groups : [];\r\n data.audiences = action.audiences ? action.audiences : [];\r\n\r\n if (action.groupsData?.isNMM !== null) {\r\n data.isNMM = action.groupsData?.isNMM;\r\n }\r\n }\r\n\r\n return { ...state, isLoggedIn, ...data };\r\n }\r\n\r\n case SET_ACTIVE_AUDIENCE: {\r\n return { ...state, activeAudience: action.audience };\r\n }\r\n case ADD_AUDIENCE: {\r\n let audiences = state.audiences.slice(0);\r\n let i = 0;\r\n //if audienceId exists then update\r\n for (; i < audiences.length; i++) {\r\n if (audiences[i].audienceId === action.audience.audienceId) {\r\n audiences[i] = action.audience;\r\n break;\r\n }\r\n }\r\n //else add new audience\r\n if (i === audiences.length) {\r\n audiences.push(action.audience);\r\n }\r\n return { ...state, audiences };\r\n }\r\n case REMOVE_AUDIENCE: {\r\n //if audienceId exists then remove it\r\n let audiences = state.audiences;\r\n for (let i = 0; i < audiences.length; i++) {\r\n if (audiences[i].audienceId === action.id) {\r\n audiences.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n return { ...state, audiences };\r\n }\r\n case GET_USER_COURSES: {\r\n return { ...state, courses: action.courses };\r\n }\r\n case GET_LAST_VISIT:\r\n return { ...state, lastVisit: action.lastVisit };\r\n case CLEAR_USER_TASKS:\r\n return {\r\n ...state,\r\n tasks: {\r\n data: [],\r\n immediateTasksCount: undefined,\r\n activeTasksCount: undefined,\r\n overdueTasksCount: undefined,\r\n examTasksCount: undefined,\r\n evaluatedTasksCount: undefined\r\n }\r\n };\r\n case GET_USER_TASKS:\r\n const {\r\n tasks,\r\n immediateTasksCount,\r\n activeTasksCount,\r\n overdueTasksCount,\r\n examTasksCount,\r\n evaluatedTasksCount\r\n } = action;\r\n return {\r\n ...state,\r\n isTasksLoaded: true,\r\n tasks: {\r\n data: tasks,\r\n immediateTasksCount,\r\n activeTasksCount,\r\n overdueTasksCount,\r\n examTasksCount,\r\n evaluatedTasksCount\r\n }\r\n };\r\n case SET_AUDIENCE_STUDENTS: {\r\n return { ...state, students: action.students }\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default reducer;\r\n","import { RESET_DOCUMENT, LOAD_DOCUMENT, SET_WAITING_FOR_LOADING, SET_WAITING_FOR_LOGOUT } from './action-types';\r\n\r\nconst initState = {\r\n connection: {},\r\n viewSettings: {},\r\n isWaitingForLoading: false,\r\n isWaitingForLogout: false\r\n};\r\n\r\nconst reducer = (state = initState, action) => {\r\n switch (action.type) {\r\n case RESET_DOCUMENT:\r\n return action.resetConnection === false ? { ...state, viewSettings: {} } : initState;\r\n case LOAD_DOCUMENT: {\r\n const { connection, viewSettings } = action;\r\n\r\n const newState = { ...state, connection, viewSettings, parentId: action.parentId };\r\n return newState;\r\n }\r\n case SET_WAITING_FOR_LOADING:\r\n return { ...state, isWaitingForLoading: action.status};\r\n case SET_WAITING_FOR_LOGOUT:\r\n return { ...state, isWaitingForLogout: true};\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default reducer;\r\n","import {\r\n CLEAR_ADD_MENU_ACTIVE_NODE,\r\n CLEAR_BAD_DROP_PROPERTIES,\r\n CLEAR_DRAGGED_NODE,\r\n CLEAR_DROP_ZONE_NODE,\r\n CLEAR_EDIT_MENU_ACTIVE_NODE,\r\n CLEAR_EDIT_TITLE_ACTIVE_NODE,\r\n CLEAR_ITEMS_DEPOT_SRC_NODE,\r\n CLEAR_LAST_LO_STUDIO_EDITED_ITEM_KEY,\r\n CLEAR_NODE_TO_DELETE,\r\n CLEAR_NODE_TO_HIDE,\r\n SET_ADD_MENU_ACTIVE_NODE,\r\n SET_BAD_DROP_PROPERTIES,\r\n SET_DELETE_NODES_MAP,\r\n SET_DRAGGED_NODE,\r\n SET_DROP_ZONE_NODE,\r\n SET_EDIT_MENU_ACTIVE_NODE,\r\n SET_EDIT_TITLE_ACTIVE_NODE,\r\n SET_ITEMS_DEPOT_SRC_NODE,\r\n SET_LAST_LO_STUDIO_EDITED_ITEM_KEY,\r\n SET_NEW_NODES_MAP,\r\n SET_NODE_TITLE,\r\n SET_NODE_TO_DELETE,\r\n SET_NODE_TO_HIDE,\r\n SET_UNDO_AVAILABILITY,\r\n SET_UNDO_PENDING\r\n} from './action-types';\r\n\r\nimport { RESET_TREE_VIEW } from '../tree/data/action-types';\r\n\r\nconst initState = {\r\n addButtonActiveNode: undefined,\r\n addDropActiveNode: undefined,\r\n addMenuActiveNode: undefined,\r\n editMenuActiveNode: undefined,\r\n editTitleActiveNode: undefined,\r\n nodeBeingDraggedUniqueId: undefined,\r\n itemsDepotSrcNode: undefined,\r\n dropDisabledNodesMap: {},\r\n nodeToDelete: undefined,\r\n nodeToHide: undefined,\r\n isUndoAvailable: false,\r\n isUndoPending: false,\r\n isActionInsideFolder: false,\r\n newNodesMap: {},\r\n toDeleteNodesMap: {},\r\n badDropTotalItemsCount: undefined,\r\n badDropBadItemsCount: undefined,\r\n lastLoStudioEditedItemKey: undefined,\r\n enableItemsAddMap: {}\r\n};\r\n\r\nconst reducer = (state = initState, action) => {\r\n switch (action.type) {\r\n case SET_ADD_MENU_ACTIVE_NODE: {\r\n // let itemsDepotSrcNode = state.itemsDepotSrcNode ? state.itemsDepotSrcNode.toString() : '';\r\n\r\n return {\r\n ...state,\r\n addMenuActiveNode: action.key,\r\n addDropActiveNode: undefined,\r\n addButtonActiveNode: undefined,\r\n editMenuActiveNode: undefined,\r\n editTitleActiveNode: undefined\r\n // itemsDepotSrcNode: itemsDepotSrcNode && itemsDepotSrcNode !== action.key ? action.key : itemsDepotSrcNode\r\n };\r\n }\r\n case CLEAR_ADD_MENU_ACTIVE_NODE:\r\n return {\r\n ...state,\r\n addMenuActiveNode: undefined,\r\n addButtonActiveNode: undefined,\r\n itemsDepotSrcNode: undefined\r\n };\r\n case SET_EDIT_MENU_ACTIVE_NODE:\r\n return { ...state, addMenuActiveNode: undefined, editMenuActiveNode: action.key, editTitleActiveNode: undefined };\r\n case CLEAR_EDIT_MENU_ACTIVE_NODE:\r\n return { ...state, editMenuActiveNode: undefined, editTitleActiveNode: undefined };\r\n case SET_EDIT_TITLE_ACTIVE_NODE:\r\n return { ...state, editMenuActiveNode: undefined, editTitleActiveNode: action.key };\r\n case SET_NODE_TITLE:\r\n case CLEAR_EDIT_TITLE_ACTIVE_NODE:\r\n return { ...state, editTitleActiveNode: undefined };\r\n case SET_DRAGGED_NODE:\r\n return {\r\n ...state,\r\n nodeBeingDraggedUniqueId: action.key,\r\n dropDisabledNodesMap: action.dropDisabledNodesMap,\r\n addMenuActiveNode: undefined,\r\n editMenuActiveNode: undefined,\r\n editTitleActiveNode: undefined\r\n };\r\n case CLEAR_DRAGGED_NODE:\r\n return { ...state, nodeBeingDraggedUniqueId: undefined, dropDisabledNodesMap: {} };\r\n case SET_NODE_TO_DELETE:\r\n return { ...state, nodeToDelete: action.key };\r\n case CLEAR_NODE_TO_DELETE:\r\n return { ...state, nodeToDelete: undefined };\r\n case SET_NODE_TO_HIDE:\r\n return { ...state, nodeToHide: action.key };\r\n case CLEAR_NODE_TO_HIDE:\r\n return { ...state, nodeToHide: undefined };\r\n case SET_DROP_ZONE_NODE:\r\n return {\r\n ...state,\r\n addButtonActiveNode: undefined,\r\n addMenuActiveNode: undefined,\r\n addDropActiveNode: action.key,\r\n editMenuActiveNode: undefined,\r\n editTitleActiveNode: undefined\r\n };\r\n case CLEAR_DROP_ZONE_NODE:\r\n return { ...state, addDropActiveNode: undefined };\r\n case SET_ITEMS_DEPOT_SRC_NODE:\r\n return { ...state, itemsDepotSrcNode: action.itemKey };\r\n case CLEAR_ITEMS_DEPOT_SRC_NODE:\r\n return { ...state, itemsDepotSrcNode: undefined };\r\n case SET_UNDO_AVAILABILITY:\r\n return { ...state, isUndoAvailable: action.isUndoAvailable };\r\n case SET_NEW_NODES_MAP:\r\n return { ...state, newNodesMap: action.newNodesMap };\r\n case SET_DELETE_NODES_MAP:\r\n return { ...state, toDeleteNodesMap: action.toDeleteNodesMap };\r\n case SET_BAD_DROP_PROPERTIES:\r\n return { ...state, badDropTotalItemsCount: action.totalItemsCount, badDropBadItemsCount: action.badItemsCount };\r\n case CLEAR_BAD_DROP_PROPERTIES:\r\n return { ...state, badDropTotalItemsCount: undefined, badDropBadItemsCount: undefined };\r\n case SET_LAST_LO_STUDIO_EDITED_ITEM_KEY:\r\n return { ...state, lastLoStudioEditedItemKey: action.itemKey, itemsDepotSrcNode: undefined };\r\n case CLEAR_LAST_LO_STUDIO_EDITED_ITEM_KEY:\r\n return { ...state, lastLoStudioEditedItemKey: undefined, itemsDepotSrcNode: undefined };\r\n case SET_UNDO_PENDING:\r\n return { ...state, isUndoPending: action.isPending };\r\n case 'OPEN_LO_STUDIO': {\r\n return { ...state, studioEditedItem: action.editedItemKey, isActionInsideFolder: action.isInsideFolder };\r\n }\r\n case 'CLOSE_LO_STUDIO': {\r\n return { ...state, studioEditedItem: undefined, isActionInsideFolder: false };\r\n }\r\n case RESET_TREE_VIEW:\r\n return { ...initState };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default reducer;\r\n","import {\r\n SET_TEACHER_MENU_ACTIVE_NODE,\r\n SET_TEACHER_SCHEDULER_ACTIVE_NODE,\r\n SET_TEACHER_INFO_ACTIVE_NODE,\r\n SHOW_ALERT_MESSAGE,\r\n HIDE_ALERT_MESSAGE,\r\n SHOW_MODAL_MESSAGE,\r\n HIDE_MODAL_MESSAGE,\r\n RESET_VIEW,\r\n PREVENT_SCROLL\r\n} from './action-types';\r\n\r\nimport { SET_TREE } from '../tree/data/action-types';\r\n\r\nconst initState = {\r\n teacherMenuActiveNode: null,\r\n teacherSchedulerActiveNodeKeys: [],\r\n teacherInfoActiveNodeKeys: [],\r\n addMenuActiveItem: null,\r\n editMenuActiveItem: null,\r\n alertType: null,\r\n modalType: null,\r\n preventScroll: false\r\n};\r\n\r\nconst reducer = (state = initState, action) => {\r\n switch (action.type) {\r\n case SET_TEACHER_MENU_ACTIVE_NODE: {\r\n let { preventScroll, teacherMenuActiveNode } = state;\r\n\r\n if (teacherMenuActiveNode) {\r\n preventScroll = Boolean(action.node);\r\n }\r\n\r\n if (teacherMenuActiveNode && !action.node) {\r\n const el = document.querySelector(`a[data-id=\"${teacherMenuActiveNode.key}\"]`);\r\n if (el) {\r\n //el.focus();\r\n }\r\n }\r\n\r\n return { ...state, teacherMenuActiveNode: action.node, preventScroll };\r\n }\r\n case SET_TEACHER_SCHEDULER_ACTIVE_NODE: {\r\n return {\r\n ...state,\r\n teacherMenuActiveNode: null,\r\n teacherSchedulerActiveNodeKeys: action.nodeKeys,\r\n preventScroll: action.preventScroll\r\n };\r\n }\r\n case SET_TEACHER_INFO_ACTIVE_NODE: {\r\n return {\r\n ...state,\r\n teacherMenuActiveNode: null,\r\n teacherInfoActiveNodeKeys: action.nodeKeys,\r\n preventScroll: action.preventScroll\r\n };\r\n }\r\n case SHOW_ALERT_MESSAGE: {\r\n return { ...state, alertType: action.alertType };\r\n }\r\n case HIDE_ALERT_MESSAGE: {\r\n return { ...state, alertType: null };\r\n }\r\n case SHOW_MODAL_MESSAGE: {\r\n return { ...state, modalType: action.modalType };\r\n }\r\n case HIDE_MODAL_MESSAGE: {\r\n return { ...state, modalType: null };\r\n }\r\n case RESET_VIEW: {\r\n return initState;\r\n }\r\n case SET_TREE: {\r\n return initState;\r\n }\r\n\r\n case PREVENT_SCROLL: {\r\n return { ...state, preventScroll: action.preventScroll };\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default reducer;\r\n","import { hasActiveStudents, isStarted, calculateStudentProgressByTasks } from '../lms/services';\r\nimport { calculateStudentProgressByPages } from '../learningSystem/services';\r\n\r\nexport const updateFolderItemsLmsAsLoading = (treeData, folderId) => {\r\n treeData[folderId].children.forEach((cid) => {\r\n const key = `${folderId}_${cid}`;\r\n const node = { ...treeData[key] };\r\n if (node) {\r\n node.lms = 'loading';\r\n }\r\n\r\n treeData[key] = node;\r\n });\r\n};\r\n\r\nexport const updateParentsAsInnerScheduled = (item, treeData) => {\r\n if (item.parents) {\r\n item.parents.forEach((p) => {\r\n const parent = { ...treeData[p] };\r\n const index = parent.scheduledInnerItems.indexOf(item.key);\r\n if (item.lms && item.lms.IsScheduled && index < 0) {\r\n parent.scheduledInnerItems.push(item.key);\r\n } else if (!(item.lms && item.lms.IsScheduled) && index >= 0) {\r\n parent.scheduledInnerItems.splice(index, 1);\r\n }\r\n\r\n treeData[p] = parent;\r\n });\r\n }\r\n};\r\n\r\nexport const updateFolderAsWithInProgressItems = (node, treeData) => {\r\n if (node.parents) {\r\n node.parents.forEach((p) => {\r\n treeData[p].hasInProgressItems = true;\r\n });\r\n }\r\n};\r\n\r\nexport const updateItemsLmsData = (treeData, lms) => {\r\n\r\n if (lms && lms.length) {\r\n lms.forEach((lmsData) => {\r\n const key = `${lmsData.FolderId}_${lmsData.DocumentId}`;\r\n const node = { ...treeData[key] };\r\n const isAdaptive = Boolean(node && node.scope);\r\n\r\n node.lms = lmsData;\r\n\r\n const isDisabled =\r\n node.isDisabled &&\r\n (!lmsData.TaskId ||\r\n (lmsData.TaskType.toLowerCase() === 'exam' && !isStarted(lmsData, isAdaptive)));\r\n\r\n node.isDisabled = isDisabled;\r\n if (node.lms) {\r\n if (typeof node.lms !== 'string' && !node.lms.TaskType) {\r\n node.lms.TaskType = node.itemType;\r\n }\r\n \r\n updateParentsAsInnerScheduled(node, treeData);\r\n\r\n if (node.lms.TeacherLmsInfo && node.lms.TeacherLmsInfo.States && hasActiveStudents(node.lms.TeacherLmsInfo.States)) {\r\n updateFolderAsWithInProgressItems(node, treeData);\r\n }\r\n\r\n if (node.lms.StudentLmsInfo && !isAdaptive) {\r\n if (node.lms.FeedbackType === 'AfterTeacherComment' && new Date(node.lms.FeedbackTime) > new Date()) {\r\n node.lms.isLmsInfoHidden = true;\r\n } else if (node.lms.FeedbackType === 'AfterSubmitByAll' && node.lms.StudentLmsInfo.State !== 'evaluated') {\r\n node.lms.isLmsInfoHidden = true;\r\n }\r\n\r\n }\r\n }\r\n\r\n treeData[key] = node;\r\n });\r\n }\r\n};\r\n\r\nexport const updateItemsByScope = (treeData, scopes) => {\r\n if (scopes) {\r\n // make sure there is only one \"current\" path by setting all the \"current\" nodes to \"currentpending\" \r\n // the real \"current\" path will be updated afterwards from \"scopes\"\r\n const isNewCurrent = Object.values(scopes).filter(s => s === 'current' || s.status === 'current').length > 0;\r\n isNewCurrent && Object.values(treeData).forEach((node) => {\r\n const updatedNode = { ...node };\r\n\r\n if (updatedNode.type === 'folder' && updatedNode.scope === 'current') {\r\n updatedNode.scope = 'currentpending';\r\n } else if (updatedNode.type === 'item' && updatedNode.scope && updatedNode.scope.status === 'current') {\r\n updatedNode.scope.status = 'currentpending';\r\n }\r\n\r\n treeData[updatedNode.key] = updatedNode;\r\n });\r\n \r\n Object.keys(scopes).forEach((nodeKey) => {\r\n const node = { ...treeData[nodeKey] };\r\n\r\n node.lms = node.lms || {};\r\n\r\n if (\r\n node.scope &&\r\n node.scope.state &&\r\n node.scope.state.pages &&\r\n scopes[nodeKey].state &&\r\n scopes[nodeKey].state.pages\r\n ) {\r\n const docScope = { ...node.scope, ...scopes[nodeKey] };\r\n const docPageState = { ...node.scope.state.pages, ...scopes[nodeKey].state.pages };\r\n node.scope = docScope;\r\n node.scope.state.pages = docPageState;\r\n } else {\r\n node.scope = scopes[nodeKey];\r\n }\r\n\r\n treeData[nodeKey] = node;\r\n });\r\n }\r\n};\r\n\r\nexport const mergeEvaluationsToLms = (treeData) => {\r\n Object.keys(treeData).forEach((key) => {\r\n const node = { ...treeData[key] };\r\n mergeSingleNodeEvalutaionToLms(node);\r\n });\r\n};\r\n\r\nexport const mergeSingleNodeEvalutaionToLms = (node) => {\r\n if (node.lms && node.lms.StudentLmsInfo && node.scope && node.scope.evaluations) {\r\n const scopeScore = node.scope.evaluations.ByLastTry * 100;\r\n node.lms.StudentLmsInfo.Scores = node.lms.StudentLmsInfo.Scores || {};\r\n node.lms.StudentLmsInfo.Scores.AutoScore = scopeScore;\r\n node.lms.StudentLmsInfo.Scores.AutoWeight = scopeScore;\r\n node.lms.StudentLmsInfo.Scores.EvaluatedWeight = scopeScore;\r\n node.lms.StudentLmsInfo.Scores.FinalScore = scopeScore;\r\n node.lms.StudentLmsInfo.Scores.ManualScore = scopeScore;\r\n node.lms.StudentLmsInfo.State = 'evaluated';\r\n } else if (node.lms?.TeacherLmsInfo && typeof node.scope === 'object') {\r\n node.lms.TeacherLmsInfo = { ...node.lms.TeacherLmsInfo, ...node.scope };\r\n }\r\n};\r\n\r\nexport const updateItemsProgress = (treeData, scopes, lms) => {\r\n if (scopes) {\r\n Object.keys(scopes).forEach((nodeKey) => {\r\n if (treeData[nodeKey]) {\r\n const { progress, hasWorkToDo } = calculateStudentProgressByPages(treeData, nodeKey);\r\n treeData[nodeKey] = { ...treeData[nodeKey], progress, hasWorkToDo };\r\n }\r\n });\r\n } else if (lms) {\r\n const foldersToUpdate = [];\r\n\r\n // update documents progress\r\n Object.values(lms).forEach((nodeLms) => {\r\n const nodeKey = `${nodeLms.FolderId}_${nodeLms.DocumentId}`;\r\n \r\n if (treeData[nodeLms.FolderId] && !treeData[nodeLms.FolderId].isAdaptive) {\r\n if (foldersToUpdate.indexOf(nodeLms.FolderId) === -1) {\r\n foldersToUpdate.push(nodeLms.FolderId);\r\n }\r\n\r\n const { progress, hasWorkToDo } = calculateStudentProgressByTasks(treeData, nodeKey);\r\n treeData[nodeKey] = { ...treeData[nodeKey], progress, hasWorkToDo };\r\n }\r\n });\r\n\r\n // update folders progress\r\n foldersToUpdate.forEach(folderKey => {\r\n const folder = { ...treeData[folderKey] };\r\n \r\n if (folder && !folder.isAdaptive) {\r\n const { progress, hasWorkToDo } = calculateStudentProgressByTasks(treeData, folderKey);\r\n treeData[folderKey] = { ...folder, progress, hasWorkToDo };\r\n }\r\n });\r\n }\r\n};\r\n","import {\r\n SET_TREE,\r\n SET_NODE_FLAG,\r\n SET_NODE_VISIBILITY,\r\n SET_TREE_ACTIVE_FILTER_TYPE,\r\n SET_TASKS_SORT_TYPE,\r\n SET_RB_STATE,\r\n SET_ENVIRONMENT_TASKS\r\n} from '../data/action-types';\r\nimport {\r\n CLEAR_STATE,\r\n LOAD_STATE,\r\n} from '../lms/action-types';\r\nimport {\r\n LOAD_STATE_SUCCESS,\r\n LOAD_NODE_EVALUTAIONS_SUCCESS,\r\n LOAD_DOCUMENTS_NUM_OF_SECTIONS\r\n} from '../learningSystem/action-types';\r\n\r\nimport { RESET_VIEW } from '../../ui/action-types';\r\nimport { updateFolderItemsLmsAsLoading, updateItemsLmsData, updateItemsByScope, updateItemsProgress, mergeEvaluationsToLms, mergeSingleNodeEvalutaionToLms } from './services';\r\n\r\nconst defaultTasksSortType = 'subjects'\r\n\r\nconst initState = {\r\n data: {},\r\n inScheduleMode: [],\r\n activeFilterType: 'none',\r\n tasksSortType: defaultTasksSortType,\r\n environmentTasks: []\r\n};\r\n\r\nconst reducer = (state = initState, action) => {\r\n switch (action.type) {\r\n case SET_TREE:\r\n return { ...state, data: action.newTreeData };\r\n case LOAD_STATE: {\r\n const data = { ...state.data };\r\n updateFolderItemsLmsAsLoading(data, action.folderId);\r\n\r\n return { ...state, data };\r\n }\r\n case LOAD_STATE_SUCCESS: {\r\n\r\n const data = { ...state.data };\r\n\r\n updateItemsLmsData(data, action.lms);\r\n updateItemsByScope(data, action.scopes);\r\n updateItemsProgress(data, action.scopes, action.lms);\r\n mergeEvaluationsToLms(data);\r\n\r\n return { ...state, data };\r\n }\r\n case LOAD_NODE_EVALUTAIONS_SUCCESS: {\r\n const node = { ...state.data[action.key] };\r\n const evaluations = {};\r\n action.evaluations.forEach(ev => { evaluations[ev.methodName] = ev.value });\r\n\r\n node.scope = { ...node.scope, evaluations };\r\n\r\n mergeSingleNodeEvalutaionToLms(node);\r\n\r\n const newState = {\r\n ...state, data: { ...state.data, [action.key]: node }\r\n };\r\n\r\n return newState;\r\n }\r\n case LOAD_DOCUMENTS_NUM_OF_SECTIONS: {\r\n const data = { ...state.data };\r\n\r\n Object.keys(action.documentsNumOfPages).forEach((documentKey) => {\r\n const nodeKey = documentKey.replace(':', '_');\r\n const node = { ...data[nodeKey] };\r\n\r\n if (node) {\r\n node.numOfPages = action.documentsNumOfPages[documentKey];\r\n data[nodeKey] = node;\r\n }\r\n });\r\n\r\n return { ...state, data };\r\n }\r\n case SET_RB_STATE: {\r\n const data = { ...state.data };\r\n\r\n Object.keys(action.ruleBaseState).forEach((nodeKey) => {\r\n const node = { ...data[nodeKey] };\r\n\r\n if (node) {\r\n node.ruleBase = action.ruleBaseState[nodeKey];\r\n data[nodeKey] = node;\r\n }\r\n });\r\n\r\n return { ...state, data };\r\n }\r\n case SET_NODE_FLAG: {\r\n const { node } = action;\r\n const data = { ...state.data };\r\n const nodeID = (node.type === 'link' && node.parentId) ? node.parentId + '_' + node.id : node.id;\r\n\r\n const newState = {\r\n ...state, data: { ...data, [nodeID]: { ...node }, ...action.parents }\r\n };\r\n\r\n return newState;\r\n }\r\n case SET_NODE_VISIBILITY: {\r\n const data = { ...state.data, ...action.nodes };\r\n return { ...state, data };\r\n }\r\n case CLEAR_STATE: {\r\n const { data } = state;\r\n let updatedTree = { ...data };\r\n Object.keys(data).forEach(key => {\r\n const node = data[key];\r\n const folder = data[node.parentId];\r\n if (node.type === 'link' && folder?.isAdaptive) {\r\n updatedTree[key] = { ...node, lms: null };\r\n }\r\n });\r\n return { ...state, data: updatedTree };\r\n }\r\n case SET_TREE_ACTIVE_FILTER_TYPE: {\r\n return { ...state, activeFilterType: action.filterType };\r\n }\r\n case SET_TASKS_SORT_TYPE: {\r\n return { ...state, tasksSortType: action.sortBy };\r\n }\r\n case SET_ENVIRONMENT_TASKS: {\r\n return { ...state, environmentTasks: action.items };\r\n }\r\n case RESET_VIEW: {\r\n return { ...state, inScheduleMode: [], activeFilterType: 'none' };\r\n }\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default reducer;\r\n","export const enumTaskState = {\r\n none: 'none',\r\n inprogressaftersubmit: 'inProgressAfterSubmit',\r\n startedtrial: 'startedTrial',\r\n submitted: 'submitted',\r\n evaluated: 'evaluated'\r\n};\r\n\r\nexport const createTaskOnTheFly = async (item, folder, user, config, defaultTaskType) => {\r\n const createTaskAs = item.itemType === 'SelfLearning' ? defaultTaskType : item.itemType;\r\n const url = `${window.tocGlobalEndpoints.treeServiceAPIURL}TreeLMS/CreateTaskOnTheFly/${item.id}/${folder.id}/${config.productId}/${user.activeAudience.audienceId}/${user.activeAudience.scoreType}/${config.loLanguage}/${config.timeZoneOffsetInHours}/${createTaskAs}?environmentId=${user.activeAudience.id}`;\r\n\r\n return new Promise(resolve => {\r\n fetch(url, {\r\n headers: {\r\n 'Access-Control-Allow-Origin': '*',\r\n 'Content-Type': 'application/json'\r\n },\r\n\r\n method: 'POST'\r\n })\r\n .then(response => response.json())\r\n .then(json => {\r\n resolve(json);\r\n });\r\n });\r\n};\r\n\r\nexport const fetchLmsForFolder = (userId, schoolId, productId, environmentId, audienceId, rootId, folderId, loLanguage, isAdaptive, currentLms, children) => {\r\n // if(isAdaptive && currentLms?.StudentLmsInfo) return Promise.resolve(currentLms);\r\n\r\n return new Promise(resolve => {\r\n if (userId && schoolId && productId && audienceId && rootId && folderId) {\r\n let url;\r\n let fetchOptions = {};\r\n\r\n if (children && children.length) {\r\n url = `${window.tocGlobalEndpoints.treeServiceAPIURL}TreeLMS/GetFolderTasksFromItems/${userId}/${schoolId}/${productId}/${audienceId}/${rootId}/0/${folderId}/${loLanguage}/false?environmentId=${environmentId}`;\r\n fetchOptions = {\r\n method: 'POST',\r\n headers: {\r\n 'Access-Control-Allow-Origin': '*',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(children.filter(childId => childId).map(childId => ({ ItemId: childId, FolderId: folderId })))\r\n };\r\n } else {\r\n url = `${window.tocGlobalEndpoints.treeServiceAPIURL}TreeLMS/${userId}/${schoolId}/${productId}/${audienceId}/${rootId}/0/${folderId}/${loLanguage}/false?environmentId=${environmentId}`;\r\n fetchOptions = {\r\n method: 'GET'\r\n };\r\n }\r\n\r\n fetch(url, fetchOptions)\r\n .then(response => response.json())\r\n .then(json => {\r\n if (json && json[0]) {\r\n // Items with no LMS folderId is null and we need it for reducer\r\n json = json.map(item => ({ ...item, FolderId: folderId }));\r\n resolve(json);\r\n } else {\r\n //TODO: IMPORTANT - fix issue of fetching lms for new folders created on creator\r\n resolve(null);\r\n }\r\n });\r\n } else {\r\n resolve(null);\r\n }\r\n });\r\n};\r\n\r\nexport const fetchLmsForItem = (userId, schoolId, productId, environmentId, audienceId, id, parentId, loLanguage) => {\r\n return new Promise(resolve => {\r\n if (userId && schoolId && productId && audienceId && id && parentId && loLanguage) {\r\n fetch(\r\n `${window.tocGlobalEndpoints.treeServiceAPIURL}TreeLMS/GetItemLMS/${userId}/${schoolId}/${productId}/${audienceId}/${id}/${parentId}/${loLanguage}/false?environmentId=${environmentId}`\r\n )\r\n .then(response => response.json())\r\n .then(json => {\r\n // Items with no LMS folderId debis null and we need it for reducer\r\n json.FolderId = parentId;\r\n resolve(json);\r\n });\r\n } else {\r\n resolve(null);\r\n }\r\n });\r\n};\r\n\r\nexport const fetchLmsForFolderItemPairs = (userId, schoolId, productId, environmentId, audienceId, rootId, loLanguage, pairs) => {\r\n return new Promise(resolve => {\r\n if (userId && schoolId && productId && audienceId && rootId && pairs?.length > 0) {\r\n const url = `${window.tocGlobalEndpoints.treeServiceAPIURL}TreeLMS/GetFolderTasksFromItems/${userId}/${schoolId}/${productId}/${audienceId}/${rootId}/0/${rootId}/${loLanguage}/false?environmentId=${environmentId}`;\r\n const fetchOptions = {\r\n method: 'POST',\r\n headers: {\r\n 'Access-Control-Allow-Origin': '*',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(pairs.filter(pair => Boolean(pair?.folderId && pair?.documentId)).map(pair => ({ ItemId: pair.documentId, FolderId: pair.folderId })))\r\n };\r\n\r\n fetch(url, fetchOptions)\r\n .then(response => response.json())\r\n .then(json => {\r\n if (json && json[0]) {\r\n // Items with no LMS folderId is null and we need it for reducer\r\n json = json.map(item => ({ ...item, FolderId: item.FolderId ?? pairs.find(p => p.documentId === item.DocumentId)?.folderId }));\r\n resolve(json);\r\n } else {\r\n //TODO: IMPORTANT - fix issue of fetching lms for new folders created on creator\r\n resolve(null);\r\n }\r\n });\r\n } else {\r\n resolve(null);\r\n }\r\n });\r\n};\r\n\r\nexport const fetchAllEnvironmentTasks = async environmentId => {\r\n let url = `${window.tocGlobalEndpoints.treeServiceAPIURL}TreeLMS/GetAllEnvironmentTasks/${environmentId}`;\r\n\r\n return fetch(url, { cache: 'no-store' })\r\n .then(response => response.json())\r\n .then(json => json)\r\n .catch(err => err);\r\n};\r\n\r\nconst extractTime = date => {\r\n return (date.getHours() < 10 ? '0' : '') + date.getHours() + ':' + (date.getMinutes() < 10 ? '0' : '') + date.getMinutes();\r\n};\r\n\r\nconst isEqualDate = (date, anotherDate) => {\r\n return date.getDate() === anotherDate.getDate() && date.getMonth() === anotherDate.getMonth() && date.getYear() === anotherDate.getYear();\r\n};\r\n\r\nexport const getScheduleFromLms = lms => {\r\n let schedule = '';\r\n const startDate = new Date(lms.StartTime * 1000);\r\n const now = new Date();\r\n const endDate = new Date(lms.EndTime * 1000);\r\n const startDateString = startDate.getDate() + '.' + (startDate.getMonth() + 1);\r\n const endDateString = endDate.getDate() + '.' + (endDate.getMonth() + 1);\r\n const startDateTime = extractTime(startDate);\r\n const endDateTime = extractTime(endDate);\r\n if (lms.TeacherLmsInfo) {\r\n schedule = startDateString + ' - ' + endDateString;\r\n if (isEqualDate(endDate, startDate)) {\r\n schedule = endDateString;\r\n }\r\n if (lms.TaskType.toLowerCase() === 'exam') {\r\n schedule = startDateString + ' (' + startDateTime + ') - ' + endDateString + ' (' + endDateTime + ')';\r\n if (isEqualDate(endDate, startDate)) {\r\n schedule = startDateString + ' (' + startDateTime + ' - ' + endDateTime + ')';\r\n }\r\n }\r\n return schedule;\r\n }\r\n if (lms.TaskType.toLowerCase() === 'exam') {\r\n if (startDate > now) {\r\n if (isEqualDate(startDate, endDate)) {\r\n schedule = startDateString + ' (' + startDateTime + ' - ' + endDateTime + ') ';\r\n } else {\r\n schedule = startDateString + ' (' + startDateTime + ')';\r\n schedule += ' - ' + endDateString + ' (' + endDateTime + ')';\r\n }\r\n } else {\r\n if (isEqualDate(endDate, now)) {\r\n schedule = endDateTime;\r\n } else {\r\n schedule = endDateString + ' (' + endDateTime + ')';\r\n }\r\n }\r\n } else {\r\n if (startDate > now) {\r\n schedule = startDateString + ' - ' + endDateString;\r\n } else {\r\n schedule = endDateString;\r\n }\r\n }\r\n return schedule;\r\n};\r\n\r\nexport const getScheduleState = lms => {\r\n var state = 'not-started';\r\n var startDate = new Date(lms.StartTime * 1000);\r\n if (lms.IsScheduled && Date.now() >= startDate && !lms.IsDisabled) {\r\n if (isSubmitted(lms.StudentLmsInfo)) {\r\n state = 'submitted';\r\n } else {\r\n state = 'active';\r\n }\r\n }\r\n return state;\r\n};\r\n\r\nexport const isOnSchedule = lms => {\r\n var startDate = new Date(lms.StartTime * 1000),\r\n endDate = new Date(lms.EndTime * 1000),\r\n now = new Date();\r\n\r\n return startDate <= now && endDate >= now && lms.IsScheduled && lms.IsScheduled === true;\r\n};\r\n\r\nexport const isFutureTask = lms => {\r\n const startDate = new Date(lms.StartTime * 1000);\r\n const now = new Date();\r\n return lms.IsScheduled && lms.IsScheduled === true && startDate > now;\r\n};\r\n\r\nexport const isLateTask = lms => {\r\n const endDate = new Date(lms.EndTime * 1000);\r\n const now = new Date();\r\n return lms.IsScheduled && lms.IsScheduled === true && endDate < now;\r\n};\r\n\r\nexport const isSubmitted = studentLmsInfo => {\r\n return (\r\n Boolean(studentLmsInfo && studentLmsInfo.State) &&\r\n Boolean(enumTaskState[studentLmsInfo.State.toLowerCase()] === enumTaskState.submitted || enumTaskState[studentLmsInfo.State.toLowerCase()] === enumTaskState.evaluated)\r\n );\r\n};\r\n\r\nexport const isSubmittedLate = (studentLmsInfo, endTime) => {\r\n return isSubmitted(studentLmsInfo) && studentLmsInfo.SubmittedTime > endTime;\r\n};\r\n\r\nexport const isSubmittedAtLeastOnce = studentLmsInfo => {\r\n return isSubmitted(studentLmsInfo) || studentLmsInfo?.SubmittedTime > 0 || studentLmsInfo?.Trial > 0;\r\n};\r\n\r\nexport const isReturnedToFix = (studentLmsInfo, taskType) => {\r\n if (!studentLmsInfo?.State) return false;\r\n\r\n return Boolean(taskType && taskType !== 'SelfLearning' && enumTaskState[studentLmsInfo.State.toLowerCase()] === enumTaskState.startedtrial && studentLmsInfo.Trial > 0);\r\n};\r\n\r\nexport const isPartial = studentLmsInfo => {\r\n return enumTaskState[studentLmsInfo.State.toLowerCase()] === enumTaskState.submitted;\r\n};\r\n\r\nexport const isValidScore = (studentLmsInfo, taskType, scope) => {\r\n if (scope && scope.evaluations && scope.evaluations.ByLastTry > -1) return true;\r\n\r\n return (\r\n studentLmsInfo.Scores &&\r\n typeof studentLmsInfo.Scores.AutoScore === 'number' &&\r\n typeof studentLmsInfo.Scores.ManualScore === 'number' &&\r\n typeof studentLmsInfo.Scores.AutoWeight === 'number' &&\r\n typeof studentLmsInfo.Scores.EvaluatedWeight === 'number' &&\r\n studentLmsInfo.Scores.AutoScore + studentLmsInfo.Scores.ManualScore >= 0 &&\r\n (enumTaskState[studentLmsInfo.State.toLowerCase()] === enumTaskState.submitted ||\r\n enumTaskState[studentLmsInfo.State.toLowerCase()] === enumTaskState.evaluated ||\r\n isReturnedToFix(studentLmsInfo, taskType))\r\n );\r\n};\r\n\r\nexport const isStarted = (lms, isAdaptive = false) => {\r\n var startDate = new Date(lms.StartTime * 1000),\r\n now = new Date();\r\n\r\n return startDate <= now && (isAdaptive || lms.IsScheduled === true);\r\n};\r\n\r\nexport const isDisabledTask = (node, user) => {\r\n const isAdaptive = typeof node.scope !== 'undefined';\r\n\r\n return node.lms && node.lms.TaskType && node.lms.TaskType.toLowerCase() === 'exam' && !isStarted(node.lms, isAdaptive) && user.role === 'student';\r\n};\r\n\r\nexport const getScoreAsNumber = (scores, state) => {\r\n if (typeof scores.FinalScore === 'number' && scores.FinalScore >= 0 && state === 'evaluated') {\r\n return Number(scores.FinalScore.toFixed(1));\r\n } else if (state === 'submitted') {\r\n return Number(scores.AutoScore.toFixed(1));\r\n } else {\r\n return Number((scores.AutoScore + scores.ManualScore).toFixed(1));\r\n }\r\n};\r\n\r\nexport const getScoreAsNumberLevel = score => {\r\n if (score <= 60) {\r\n return 'bad';\r\n } else if (score > 60 && score <= 80) {\r\n return 'medium';\r\n } else {\r\n return 'good';\r\n }\r\n};\r\n\r\nexport const getPositiveScores = scores => {\r\n const positiveScores = [];\r\n scores.forEach(score => {\r\n if (score >= 0) {\r\n positiveScores.push(score);\r\n }\r\n });\r\n return positiveScores;\r\n};\r\n\r\nexport const getProgressTotal = states => {\r\n if (!states) return 0;\r\n const progressKeys = Object.keys(states);\r\n let progressTotal = 0; //, submittedTotal; //TODO: these were defined but never used: value = 0, valueWidth = 0,\r\n\r\n progressKeys.forEach(key => {\r\n if (states[key] && key !== 'WaitingForCheck' && key !== 'NotStarted') {\r\n progressTotal += states[key];\r\n }\r\n\r\n // if (data.States[key] && (key === 'Done' || key === \"Skipped\")) {\r\n // submittedTotal += data.States[key]\r\n // }\r\n });\r\n\r\n return progressTotal;\r\n};\r\n\r\nexport const getItemProgress = state => {\r\n if (!state) return 'not-started';\r\n return enumTaskState[state.toLowerCase()] === enumTaskState.none\r\n ? 'not-started'\r\n : enumTaskState[state.toLowerCase()] === enumTaskState.startedtrial || enumTaskState[state.toLowerCase()] === enumTaskState.inprogressaftersubmit\r\n ? 'started'\r\n : 'finished';\r\n};\r\n\r\nexport const calcAvg = arrayOfNumbers => {\r\n let avg =\r\n arrayOfNumbers.reduce(function (prev, number) {\r\n if (isNaN(number)) {\r\n return prev;\r\n }\r\n\r\n return (prev += number);\r\n }, 0) / arrayOfNumbers.length;\r\n\r\n avg = Math.round(avg) !== avg ? avg.toFixed(1) : avg;\r\n\r\n return Number(avg);\r\n};\r\n\r\nexport const isDisabledExam = (data, user, isAdaptive = false) => {\r\n const lms = data.lms || {};\r\n const taskType = lms && lms.TaskType ? lms.TaskType : data.itemType;\r\n\r\n const result = Boolean((!user || !user.userId || user.role === 'student') && taskType && taskType.toLowerCase() === 'exam' && !isStarted(lms, isAdaptive));\r\n return result;\r\n};\r\n\r\nexport const shouldConfirmHide = node => {\r\n if (node) {\r\n if (node.type === 'link') {\r\n const { lms } = node;\r\n\r\n if (node.isHidden) {\r\n return false;\r\n }\r\n if (lms && lms.TeacherLmsInfo && hasActiveStudents(lms.TeacherLmsInfo.States)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n } else if (node.type === 'folder' && !node.isHidden && (node.hasInProgressItems || node.scheduledInnerItems.length)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n};\r\n\r\nexport const hasActiveStudents = states => {\r\n return Object.keys(states) && (states.Done > 0 || states.InProgress > 0 || states.WaitingForCheck > 0);\r\n};\r\n\r\nexport const isNotScheduledExam = (item, lms) => {\r\n //if item is exam and has no task or has task but not scheduled\r\n return Boolean((item && item.itemType === 'Exam' && (!lms || !lms.TaskId)) || (lms && lms.TaskType === 'Exam' && !lms.IsScheduled));\r\n};\r\n\r\nexport const isConvertToExamDisabled = lms => {\r\n return Boolean(lms.TaskType && lms.TaskType.toLowerCase() !== 'exam' && lms.TeacherLmsInfo && hasActiveStudents(lms.TeacherLmsInfo.States));\r\n};\r\n\r\nconst getDateString = dateTime => {\r\n if (dateTime && dateTime.getUTCFullYear) {\r\n return dateTime.getUTCFullYear() + '-' + (dateTime.getUTCMonth() + 1) + '-' + dateTime.getUTCDate() + ' ' + dateTime.getUTCHours() + ':' + dateTime.getUTCMinutes();\r\n } else {\r\n return '0';\r\n }\r\n};\r\n\r\nconst getScoreType = (taskType, scoreType) => {\r\n if (taskType === 'SelfLearning') {\r\n return String(scoreType);\r\n } else {\r\n return '0';\r\n }\r\n};\r\n\r\nexport const updateItemSchedule = (task, activeAudience, config) => {\r\n let url = [\r\n window.tocGlobalEndpoints.treeServiceAPIURL,\r\n 'TreeLMS/OverwriteTaskTypeAndTimeFrameOfTask/',\r\n task.id,\r\n '/',\r\n task.parentId,\r\n '/',\r\n config.productId,\r\n '/',\r\n activeAudience.audienceId,\r\n '/',\r\n config.loLanguage,\r\n '/',\r\n task.taskType,\r\n '/',\r\n getDateString(task.fromDate),\r\n '/',\r\n getDateString(task.toDate),\r\n '/',\r\n getScoreType(task.taskType, activeAudience.scoreType),\r\n '/',\r\n task.taskType,\r\n '/',\r\n config.timeZoneOffsetInHours,\r\n '/',\r\n task.publishMode || '1',\r\n task.publishDate ? '/' + getDateString(task.publishDate) : '',\r\n `?environmentId=${activeAudience.id}`\r\n ].join('');\r\n\r\n return fetch(url, { method: 'POST' });\r\n};\r\n\r\nexport const isStudentStarted = lms => {\r\n if (lms.TeacherLmsInfo.States.InProgress > 0 || lms.TeacherLmsInfo.States.Done > 0 || lms.TeacherLmsInfo.States.WaitingForCheck > 0 || lms.TeacherLmsInfo.States.Skipped)\r\n return true;\r\n return false;\r\n};\r\n\r\nexport const isStudentSubmitted = lms => {\r\n if (lms.TeacherLmsInfo.States.Done > 0) return true;\r\n return false;\r\n};\r\n\r\nexport const calculateStudentProgressByTasks = (tree, nodeKey) => {\r\n let progress = 0;\r\n let hasWorkToDo = false;\r\n\r\n if (nodeKey && tree) {\r\n const node = tree[nodeKey];\r\n\r\n let totalNumOfTasks = 0;\r\n let totalNumOfDoneTasks = 0;\r\n if (node && node.type === 'link') {\r\n totalNumOfTasks = 1;\r\n totalNumOfDoneTasks = node?.lms?.StudentLmsInfo?.SubmittedTime > 0 || node?.lms?.StudentLmsInfo?.Trial > 0 ? 1 : 0;\r\n hasWorkToDo = Boolean(totalNumOfTasks > totalNumOfDoneTasks);\r\n } else {\r\n // node.type = 'folder'\r\n const folderDocuments = Object.values(tree).filter(node => node.type === 'link' && !node.isHidden && !node.isHiddenByStudio && node.parents.includes(nodeKey));\r\n\r\n folderDocuments.forEach(document => {\r\n totalNumOfTasks++;\r\n\r\n if (document?.lms?.StudentLmsInfo?.SubmittedTime > 0 || document?.lms?.StudentLmsInfo?.Trial > 0) {\r\n totalNumOfDoneTasks++;\r\n }\r\n });\r\n\r\n if (totalNumOfTasks > totalNumOfDoneTasks) {\r\n const docsToDo = folderDocuments.filter(n => !n.lms || !isSubmitted(n.lms.StudentLmsInfo));\r\n hasWorkToDo = Boolean(docsToDo && docsToDo.length > 0);\r\n }\r\n }\r\n\r\n if (totalNumOfTasks > 0) {\r\n progress = Math.round((totalNumOfDoneTasks / totalNumOfTasks) * 100);\r\n }\r\n }\r\n\r\n return { progress, hasWorkToDo };\r\n};\r\n","import { UPDATE_USER_AS_INTERACTED, LOAD_USER_STATUS, UPDATE_USER_STATUS, LOAD_SETTINGS, LOAD_USER_WALLET, UPDATE_USER_WALLET_ITEM, UPDATE_MAP_ID, UPDATE_MAP_STATUS, UPDATE_UI_ELEMENTS, UPDATE_CLASS_NAMES } from './action-types';\r\n\r\nconst reducer = (\r\n state = {\r\n settings: {},\r\n status: {},\r\n wallet: {},\r\n currentMap: {},\r\n ui: {}\r\n },\r\n action\r\n) => {\r\n switch (action.type) {\r\n case UPDATE_USER_AS_INTERACTED:\r\n return { ...state, status: { ...state.status, userInteracted: true } };\r\n case LOAD_USER_STATUS:\r\n return { ...state, status: { ...action.status ,userInteracted: false } };\r\n case UPDATE_USER_STATUS:\r\n return { ...state, status: { ...action.status } };\r\n case LOAD_SETTINGS:\r\n const settingsObj = { ...state.settings };\r\n settingsObj[action.settings.type] = action.settings.settings;\r\n return { ...state, settings: settingsObj };\r\n case LOAD_USER_WALLET:\r\n return { ...state, wallet: { ...action.walletItems } };\r\n case UPDATE_USER_WALLET_ITEM:\r\n return { ...state, wallet: { ...state.wallet, ...action.walletItem } };\r\n case UPDATE_MAP_ID:\r\n return {\r\n ...state, currentMap: { ...state.currentMap, id: action.mapId } };\r\n case UPDATE_MAP_STATUS:\r\n return {\r\n ...state, currentMap: { ...state.currentMap, isMapLoaded: action.isMapLoaded }\r\n };\r\n case UPDATE_UI_ELEMENTS:\r\n return { ...state, ui: { ...action.ui } };\r\n case UPDATE_CLASS_NAMES:\r\n return { ...state, ui: { ...action.ui } };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default reducer;\r\n","export const LOAD_USER_STATUS = 'LOAD_USER_STATUS';\r\nexport const UPDATE_USER_STATUS = 'UPDATE_USER_STATUS';\r\nexport const LOAD_SETTINGS = 'LOAD_SETTINGS';\r\nexport const LOAD_USER_WALLET = 'LOAD_USER_WALLET';\r\nexport const UPDATE_USER_WALLET_ITEM = 'UPDATE_USER_WALLET_ITEM';\r\nexport const UPDATE_MAP_ID = 'UPDATE_MAP_ID';\r\nexport const UPDATE_MAP_STATUS = 'UPDATE_MAP_STATUS';\r\nexport const UPDATE_UI_ELEMENTS = 'UPDATE_UI_ELEMENTS';\r\nexport const UPDATE_CLASS_NAMES = 'UPDATE_CLASS_NAMES';\r\nexport const UPDATE_USER_AS_INTERACTED = 'UPDATE_USER_AS_INTERACTED';\r\n\r\n\r\n","export const SET_TREE = 'SET_TREE';\r\nexport const SET_NODE_FLAG = 'SET_NODE_FLAG';\r\nexport const SET_NODE_VISIBILITY = 'SET_NODE_VISIBILITY';\r\nexport const RESET_TREE_VIEW = 'RESET_TREE_VIEW';\r\nexport const SET_TREE_ACTIVE_FILTER_TYPE = 'SET_TREE_ACTIVE_FILTER_TYPE';\r\nexport const SET_TASKS_SORT_TYPE = 'SET_TASKS_SORT_TYPE';\r\nexport const SET_RB_STATE = 'SET_RB_STATE';\r\nexport const SET_ENVIRONMENT_TASKS = 'SET_ENVIRONMENT_TASKS'","export const SET_TEACHER_MENU_ACTIVE_NODE = 'SET_TEACHER_MENU_ACTIVE_NODE';\r\nexport const SET_TEACHER_SCHEDULER_ACTIVE_NODE = 'SET_TEACHER_SCHEDULER_ACTIVE_NODE';\r\nexport const SET_TEACHER_INFO_ACTIVE_NODE = 'SET_TEACHER_INFO_ACTIVE_NODE';\r\nexport const SHOW_ALERT_MESSAGE = 'SHOW_ALERT_MESSAGE';\r\nexport const HIDE_ALERT_MESSAGE = 'HIDE_ALERT_MESSAGE';\r\nexport const SHOW_MODAL_MESSAGE = 'SHOW_MODAL_MESSAGE';\r\nexport const HIDE_MODAL_MESSAGE = 'HIDE_MODAL_MESSAGE';\r\nexport const RESET_VIEW = 'RESET_VIEW';\r\nexport const PREVENT_SCROLL = 'PREVENT_SCROLL';\r\n","export const extractParentIdFromNodeKey = (nodeKey) => {\r\n let id = '';\r\n\r\n if (nodeKey) {\r\n const nodeKeyParts = nodeKey.split(':');\r\n\r\n if (nodeKeyParts.length > 1) {\r\n id = nodeKeyParts[nodeKeyParts.length - 2];\r\n } else {\r\n id = nodeKeyParts[0];\r\n }\r\n }\r\n\r\n return id;\r\n};\r\n\r\nexport const extractIdFromNodeKey = (nodeKey) => {\r\n let id = '';\r\n\r\n if (nodeKey) {\r\n const nodeKeyParts = nodeKey.split(':');\r\n\r\n if (nodeKeyParts.length === 2) {\r\n // node type is document\r\n id = nodeKey.replace(':', '_');\r\n } else {\r\n id = nodeKeyParts[nodeKeyParts.length - 1];\r\n }\r\n }\r\n\r\n return id;\r\n};\r\n\r\nexport const sendLearningEvent = async (cetEvent) => {\r\n let result = null;\r\n\r\n if (cetEvent) {\r\n const learningEvent = buildLearningEvent(cetEvent);\r\n\r\n try {\r\n result = await window.cet.microservices.activityapi.activity.send(learningEvent);\r\n } catch (error) { result = { error }; }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nexport const isValidParam = (param) => {\r\n return (\r\n typeof param !== 'undefined' &&\r\n param !== null &&\r\n (typeof param !== 'string' || (typeof param === 'string' && param.length > 0))\r\n );\r\n};\r\n\r\nexport const buildLearningEvent = (cetEvent) => {\r\n var learningEvent = {};\r\n\r\n // Extract relevant fields from CET event object and build learning event\r\n if (cetEvent) {\r\n learningEvent.studentId = cetEvent.userId;\r\n learningEvent.action = cetEvent.verb;\r\n learningEvent.actionData = {};\r\n //learningEvent.timestamp = cetEvent.timestamp_long;\r\n\r\n if (cetEvent.optionalData) {\r\n const { contentParentId, loId } = cetEvent.optionalData\r\n\r\n learningEvent.applicationId = cetEvent.optionalData.audienceId;\r\n learningEvent.actionData.schoolId = cetEvent.optionalData.schoolId;\r\n learningEvent.actionData.sessionId = cetEvent.optionalData.sessionId;\r\n learningEvent.actionData.structureId = cetEvent.optionalData.contentGroupingId;\r\n learningEvent.actionData.contentLanguage = cetEvent.optionalData.contentLanguage;\r\n learningEvent.actionData.categoryId = contentParentId;\r\n learningEvent.actionData.documentId = loId;\r\n\r\n if (cetEvent.optionalData.objectAdditionalInformation &&\r\n cetEvent.optionalData.objectAdditionalInformation.affected) {\r\n\r\n const affectedIds = cetEvent.optionalData.objectAdditionalInformation.affected.reduce(\r\n (accumulator, currentValue) => {\r\n Object.keys(currentValue).forEach((key) => {\r\n for (let i = 0; i < currentValue[key].length; i++) {\r\n accumulator.push(`${contentParentId}:${loId}:${key}:${currentValue[key][i]}`);\r\n }\r\n });\r\n\r\n return accumulator;\r\n },\r\n []\r\n );\r\n\r\n if (affectedIds.length) {\r\n learningEvent.affectedIds = affectedIds;\r\n }\r\n }\r\n }\r\n\r\n if (cetEvent.objectType.toLowerCase() === 'lo') {\r\n // document\r\n learningEvent.nodeId = cetEvent.optionalData.contentParentId + ':' + cetEvent.optionalData.loId;\r\n learningEvent.actionData.objectType = 'document';\r\n } else if (cetEvent.objectType.toLowerCase() === 'page') {\r\n // section\r\n learningEvent.nodeId = cetEvent.optionalData.contentParentId + ':' + cetEvent.optionalData.loId + ':' + cetEvent.optionalData.pageId;\r\n learningEvent.actionData.objectType = 'section';\r\n learningEvent.actionData.sectionId = cetEvent.optionalData.pageId;\r\n } else {\r\n // element (question OR static_content)\r\n learningEvent.nodeId =\r\n cetEvent.optionalData.contentParentId + ':' +\r\n cetEvent.optionalData.loId + ':' +\r\n cetEvent.optionalData.pageId + ':' +\r\n cetEvent.optionalData.questionId;\r\n\r\n learningEvent.actionData.objectType = cetEvent.objectType;\r\n learningEvent.actionData.sectionId = cetEvent.optionalData.pageId;\r\n learningEvent.actionData.elementId = cetEvent.optionalData.questionId;\r\n\r\n if (cetEvent.optionalData) {\r\n if (isValidParam(cetEvent.optionalData.interactionType)) {\r\n learningEvent.actionData.interactionType = cetEvent.optionalData.interactionType;\r\n }\r\n if (isValidParam(cetEvent.optionalData.objectFieldsGraded)) {\r\n learningEvent.actionData.objectFieldsGraded = cetEvent.optionalData.objectFieldsGraded;\r\n }\r\n if (isValidParam(cetEvent.optionalData.fieldsScore)) {\r\n learningEvent.actionData.fieldsScore = cetEvent.optionalData.fieldsScore;\r\n }\r\n if (isValidParam(cetEvent.optionalData.fieldsResponse)) {\r\n learningEvent.actionData.fieldsResponse = cetEvent.optionalData.fieldsResponse;\r\n }\r\n if (isValidParam(cetEvent.optionalData.scoreScaled)) {\r\n learningEvent.actionData.scoreScaled = cetEvent.optionalData.scoreScaled;\r\n }\r\n if (isValidParam(cetEvent.optionalData.scoreMax)) {\r\n learningEvent.actionData.scoreMax = cetEvent.optionalData.scoreMax;\r\n }\r\n if (isValidParam(cetEvent.optionalData.scoreRaw)) {\r\n learningEvent.actionData.scoreRaw = cetEvent.optionalData.scoreRaw;\r\n }\r\n if (isValidParam(cetEvent.optionalData.completion)) {\r\n learningEvent.actionData.completion = cetEvent.optionalData.completion;\r\n }\r\n }\r\n }\r\n\r\n learningEvent.actionData = JSON.stringify(learningEvent.actionData).replace(/\"/g, '\"');\r\n }\r\n\r\n return learningEvent;\r\n};\r\n\r\nexport const buildStudentStateMap = (studentState, numOfSkippedPages = 0) => {\r\n let studentStateMap = {};\r\n\r\n if (studentState) {\r\n const studentStateNodes = Object.values(studentState);\r\n\r\n for (let i = 0; i < studentStateNodes.length; i++) {\r\n const nodeKey = studentStateNodes[i].id;\r\n const nodeType = studentStateNodes[i].type.toLowerCase();\r\n const nodeStatus = studentStateNodes[i].status.toLowerCase();\r\n const nodeMetadata = JSON.parse(studentStateNodes[i].metadata);\r\n\r\n if (nodeType === 'category') {\r\n studentStateMap[nodeKey] = nodeStatus;\r\n } else if (nodeType === 'document') {\r\n const documentKey = extractIdFromNodeKey(nodeKey);\r\n\r\n let documentVersion = {\r\n majorVersion: nodeMetadata.majorVersion,\r\n minorVersion: nodeMetadata.minorVersion,\r\n structureVersion: nodeMetadata.structureVersion,\r\n };\r\n let documentState = nodeStatus;\r\n\r\n if (nodeStatus !== 'disabled') {\r\n // In case of document - get inner state (pages & elements)\r\n const docPages = studentStateNodes.filter(n => n.type.toLowerCase() === 'section' && n.id.includes(nodeKey));\r\n const docCurrentElement = studentStateNodes.filter(n => n.type.toLowerCase() === 'element' && n.status.toLowerCase() === 'current' && n.id.includes(nodeKey));\r\n\r\n documentState = {\r\n status: nodeStatus === 'currentpending' ? 'current' : nodeStatus,\r\n pageId: '',\r\n questionId: docCurrentElement && docCurrentElement.length > 0 ? extractIdFromNodeKey(docCurrentElement[0].id) : '',\r\n pagesSkipped: numOfSkippedPages,\r\n state: { pages: {} },\r\n versions: documentVersion,\r\n };\r\n\r\n for (let i = 0; i < docPages.length; i++) {\r\n const pageId = extractIdFromNodeKey(docPages[i].id);\r\n const pageStatus = docPages[i].status.toLowerCase();\r\n\r\n if (['current', 'done', 'skipped'].indexOf(pageStatus) >= 0) {\r\n documentState.state.pages[pageId] = pageStatus;\r\n documentState.pageId = pageStatus === 'current' ? pageId : '';\r\n } else {\r\n documentState.state.pages[pageId] = 'disabled';\r\n }\r\n }\r\n }\r\n\r\n if ((nodeStatus === 'done' || nodeStatus === 'skipped') && studentStateNodes[i].evaluations && studentStateNodes[i].evaluations['ByLastTry'] >= 0) {\r\n documentState.evaluations = studentStateNodes[i].evaluations;\r\n }\r\n\r\n studentStateMap[documentKey] = documentState;\r\n } else if (nodeType === 'section') {\r\n const pageId = extractIdFromNodeKey(nodeKey);\r\n const documentKey = extractIdFromNodeKey(nodeKey.substring(0, nodeKey.lastIndexOf(':')));\r\n const documentState = studentStateMap[documentKey] || { state: { pages: {} } };\r\n\r\n documentState.state.pages[pageId] = nodeStatus;\r\n studentStateMap[documentKey] = documentState;\r\n }\r\n }\r\n }\r\n\r\n return studentStateMap;\r\n};\r\n\r\nexport const fetchStudentTreeState = async (userId, audienceId) => {\r\n let studentStateMap = {};\r\n\r\n if (userId && audienceId) {\r\n const studentState = await window.cet.microservices.learningapi.state.getByApplication({\r\n applicationId: audienceId,\r\n studentId: userId,\r\n withEvaluation: 'All',\r\n });\r\n\r\n if (studentState && studentState.state) {\r\n studentStateMap = buildStudentStateMap(studentState.state);\r\n }\r\n }\r\n\r\n return studentStateMap;\r\n};\r\n\r\nexport const fetchStudentStateByNodes = async (studentId, audienceId, nodeIds) => {\r\n let studentStateMap = {};\r\n\r\n if (studentId && audienceId) {\r\n const studentState = await window.cet.microservices.learningapi.state.getByNodeIds({\r\n nodeIds,\r\n methods: [],\r\n enforceCalculation: 'Always',\r\n applicationId: audienceId,\r\n studentId,\r\n withEvaluation: 'All',\r\n });\r\n\r\n if (studentState && studentState.state) {\r\n studentStateMap = buildStudentStateMap(studentState.state);\r\n }\r\n }\r\n\r\n return studentStateMap;\r\n};\r\n\r\nexport const fetchStudentNextItem = async (userId, audienceId, scopeId = '', engineType = 'Linear', walkBy = 'Section') => {\r\n let nextState = null;\r\n\r\n if (userId && audienceId) {\r\n nextState = await window.cet.microservices.learningapi.next\r\n .get({\r\n engineType,\r\n applicationId: audienceId,\r\n studentId: userId,\r\n walkBy,\r\n scopeId\r\n })\r\n .catch((error) => {\r\n console.log('Error: learningapi.next.get', error);\r\n });\r\n }\r\n\r\n return nextState;\r\n};\r\n\r\nexport const triggerEndOfNode = async (productConfig, user, node) => {\r\n if (!node) {\r\n return null;\r\n }\r\n\r\n const isAdaptive = node.type === 'folder' ? node.isAdaptive : Boolean(node.scope);\r\n const productType = isAdaptive ? 'Adaptive' : 'Regular';\r\n const nodeType = node.type === 'folder' ? 'Subject' : 'Task';\r\n const nodeStatus = node.noCheck ? 'Done' : 'Evaluated';\r\n\r\n const triggerInfo = {\r\n productName: productConfig.productLocalName,\r\n triggerName: `CET.Triggers.${productType}.${nodeType}${nodeStatus}`,\r\n triggerData: JSON.stringify({\r\n productID: productConfig.productId,\r\n audienceID: user?.activeAudience?.audienceId,\r\n userID: user?.userId,\r\n schoolID: user?.schoolId,\r\n entityID: node.key,\r\n entityType: nodeType,\r\n entityLang: productConfig.loLanguage\r\n })\r\n };\r\n\r\n const fetchOptions = {\r\n method: 'POST',\r\n body: JSON.stringify(triggerInfo),\r\n headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },\r\n mode: 'cors',\r\n credentials: 'include',\r\n //cache: 'default',\r\n //keepalive: false\r\n };\r\n \r\n const url = `${window.tocGlobalEndpoints.productPlayerServicesAPIURL}trigger/dispatch`;\r\n const response = await fetch(url, fetchOptions)\r\n .then(response => response.json())\r\n .then(json => json)\r\n .catch(err => err);\r\n\r\n return response;\r\n};\r\n\r\nexport const fetchEvaluationForNodes = async (\r\n applicationId,\r\n studentId,\r\n nodeIds,\r\n enforceCalculation = 'WhenMissing'\r\n) => {\r\n const response = await window.cet.microservices.learningapi.evaluation.getByPath({\r\n enforceCalculation,\r\n applicationId,\r\n studentId,\r\n nodeIds,\r\n pathes: ['All'],\r\n });\r\n\r\n return response;\r\n};\r\n\r\nexport const fetchStudentsStateByType = async (applicationId, studentIds, nodeType) => {\r\n return await window.cet.microservices.learningapi.state.getMultipleByElementType({\r\n nodeType,\r\n withEvaluation: 'All',\r\n studentIds,\r\n applicationId,\r\n withNotVisited: false,\r\n });\r\n};\r\n\r\nexport const buildStudentStateMapForTeacher = (studentsState, studentsCount) => {\r\n const stateMap = {};\r\n\r\n studentsState.forEach((studentState) => {\r\n Object.keys(studentState.state).forEach((id) => {\r\n const treeNodeId = extractIdFromNodeKey(id);\r\n\r\n if (!stateMap[treeNodeId]) {\r\n stateMap[treeNodeId] = {\r\n Scores: [],\r\n States: {\r\n NotStarted: studentsCount,\r\n InProgress: 0,\r\n Done: 0,\r\n WaitingForCheck: 0,\r\n Skipped: 0,\r\n },\r\n };\r\n }\r\n\r\n switch (studentState.state[id].status) {\r\n case 'Done':\r\n if (studentState.state[id].evaluations.ByLastTry > -1) {\r\n stateMap[treeNodeId].Scores.push(studentState.state[id].evaluations.ByLastTry * 100);\r\n }\r\n\r\n stateMap[treeNodeId].States.NotStarted--;\r\n stateMap[treeNodeId].States.Done++;\r\n break;\r\n case 'Current':\r\n stateMap[treeNodeId].States.NotStarted--;\r\n stateMap[treeNodeId].States.InProgress++;\r\n break;\r\n case 'Skipped':\r\n stateMap[treeNodeId].States.NotStarted--;\r\n stateMap[treeNodeId].States.Skipped++;\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n });\r\n\r\n return stateMap;\r\n};\r\n\r\nexport const fetchDocumentsNumOfSections = async (applicationId) => {\r\n return await window.cet.microservices.learningapi.node.getDocumentsNumOfSections({ applicationId });\r\n};\r\n\r\nexport const getNumOfDonePages = (document) => {\r\n if (document && document.scope && document.scope !== 'disabled') {\r\n if (document.scope.status) {\r\n if (document.scope.status === 'done' || document.scope.status === 'skipped') {\r\n return document.numOfPages;\r\n }\r\n else if (document.scope.state && document.scope.state.pages) {\r\n const donePages = Object.values(document.scope.state.pages).filter(page => page === 'done' || page === 'skipped');\r\n return Math.max(0, donePages.length);\r\n }\r\n }\r\n }\r\n\r\n return 0;\r\n}\r\n\r\nexport const calculateStudentProgressByPages = (tree, nodeKey) => {\r\n let progress = 0;\r\n let hasWorkToDo = false;\r\n\r\n if (nodeKey && tree) {\r\n const node = tree[nodeKey];\r\n\r\n let totalNumOfPages = 0;\r\n let totalNumOfDonePages = 0;\r\n\r\n if (node && node.type === 'link') {\r\n totalNumOfPages = node.numOfPages;\r\n totalNumOfDonePages = getNumOfDonePages(node);\r\n hasWorkToDo = Boolean(totalNumOfPages > totalNumOfDonePages);\r\n } else { // node.type = 'folder'\r\n const folderDocuments = Object.values(tree).filter(node => node.type === 'link' && node.parents.includes(nodeKey));\r\n\r\n folderDocuments.forEach(document => {\r\n totalNumOfPages += document.numOfPages || 0;\r\n totalNumOfDonePages += getNumOfDonePages(document);\r\n });\r\n\r\n if (totalNumOfPages > totalNumOfDonePages) {\r\n const docsToDo = folderDocuments.filter(n => !n.isHidden && (!n.scope || n.scope.status !== 'done'));\r\n hasWorkToDo = Boolean(docsToDo && docsToDo.length > 0);\r\n }\r\n }\r\n\r\n if (totalNumOfPages > 0) {\r\n progress = Math.round((totalNumOfDonePages / totalNumOfPages) * 100);\r\n }\r\n }\r\n\r\n return { progress, hasWorkToDo };\r\n};\r\n\r\nexport const isNodeDone = (tree, nodeKey) => {\r\n if (nodeKey && tree) {\r\n nodeKey = nodeKey.replace(':', '_');\r\n const node = tree[nodeKey];\r\n\r\n if (node) {\r\n return Boolean((node.type === 'folder' && node.scope === 'done') || (node.type === 'link' && node.scope.status === 'done'));\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n"],"sourceRoot":""}