diff --git a/packages/nulp_elite/src/App.js b/packages/nulp_elite/src/App.js index 1b6a22a1..57238628 100644 --- a/packages/nulp_elite/src/App.js +++ b/packages/nulp_elite/src/App.js @@ -3,6 +3,8 @@ import "./App.css"; import Sample from "pages/Sample"; import Home from "pages/Home"; import Courses from "pages/Courses"; +import Coursetest from "pages/CourseTest"; + import Contents from "pages/Contents"; import { NativeBaseProvider, @@ -80,6 +82,11 @@ function App() { path: "/user", component: User, }, + { + moduleName: "nulp_elite", + path: "/coursetest", + component: Coursetest, + }, ]; // return( diff --git a/packages/nulp_elite/src/configs/appConfig.json b/packages/nulp_elite/src/configs/appConfig.json new file mode 100644 index 00000000..7923f045 --- /dev/null +++ b/packages/nulp_elite/src/configs/appConfig.json @@ -0,0 +1,1439 @@ +{ + "UrlLinks": { + "downloadDikshaApp": "https://play.google.com/store/apps/details?id=in.gov.diksha.app" + }, + "layoutConfiguration": { + "source": "", + "name": "newLayout", + "options": "" + }, + "CommonSearch": { + "contentType": [ + "Collection", + "TextBook", + "LessonPlan", + "Resource", + "SelfAssess", + "PracticeResource", + "LearningOutcomeDefinition", + "ExplanationResource", + "CurriculumCourse" + ] + }, + "DialAssembleSearch": { + "contentType": [ + "Collection", + "TextBook", + "TextBookUnit", + "Resource", + "Course" + ] + }, + "Home": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "enrolledCourses": { + "constantData": { + "action": { + "right": { + "class": "ui blue basic button", + "eventName": "Resume", + "displayType": "button", + "text": "Resume" + }, + "onImage": { + "eventName": "onImage" + } + }, + "telemetryInteractEdata": { + "id": "courseId", + "type": "click", + "pageid": "home" + }, + "telemetryObjectType": "home" + }, + "metaData": ["batchId", "courseId", "trackable"], + "maxCount": "leafNodesCount", + "progress": "progress" + } + }, + "ViewAll": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "otherCourses": { + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + }, + "left": { + "class": "ui circular label card-badges-image" + } + } + } + }, + "enrolledCourses": { + "constantData": { + "action": { + "right": { + "class": "ui blue basic button", + "eventName": "Resume", + "displayType": "button", + "text": "Resume" + }, + "onImage": { + "eventName": "onImage" + } + } + }, + "metaData": ["batchId", "courseId", "trackable"] + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "trackable", + "batchId", + "courseId" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory", + "ribbon.left.image": "badgeAssertions[0].badgeClassImage" + }, + "PAGE_LIMIT": 100 + }, + "CourseConsumption": { + "contentApiQueryParams": { + "orgdetails": "orgName,email", + "licenseDetails": "name,description,url" + } + }, + "Course": { + "contentApiQueryParams": { + "orgdetails": "orgName,email", + "licenseDetails": "name,description,url" + }, + "otherCourse": { + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + } + } + }, + "metaData": { + "metaData": ["identifier", "mimeType", "framework", "contentType"] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory" + } + }, + "enrolledCourses": { + "constantData": { + "action": { + "right": { + "class": "ui blue basic button", + "eventName": "Resume", + "displayType": "button", + "text": "Resume" + }, + "onImage": { + "eventName": "onImage" + } + } + }, + "metaData": ["batchId", "courseId", "trackable"], + "maxCount": "leafNodesCount", + "progress": "progress" + } + }, + "CourseBatchPageSection": { + "slickSize": 10, + "slideConfig": { + "slidesToShow": 4, + "slidesToScroll": 1, + "responsive": [ + { + "breakpoint": 2800, + "settings": { + "slidesToShow": 4, + "slidesToScroll": 2 + } + }, + { + "breakpoint": 2200, + "settings": { + "slidesToShow": 4, + "slidesToScroll": 2 + } + }, + { + "breakpoint": 2000, + "settings": { + "slidesToShow": 3.01, + "slidesToScroll": 2 + } + }, + { + "breakpoint": 1600, + "settings": { + "slidesToShow": 3, + "slidesToScroll": 2 + } + }, + { + "breakpoint": 1200, + "settings": { + "slidesToShow": 2.5, + "slidesToScroll": 2 + } + }, + { + "breakpoint": 900, + "settings": { + "slidesToShow": 2.5, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 768, + "settings": { + "slidesToShow": 2, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 660, + "settings": { + "slidesToShow": 2, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 530, + "settings": { + "slidesToShow": 1.5, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 450, + "settings": { + "slidesToShow": 1, + "slidesToScroll": 1 + } + } + ], + "infinite": false, + "rtl": false + } + }, + "AllDownloadsSection": { + "slickSize": 10, + "slideConfig": { + "slidesToShow": 4, + "slidesToScroll": 4, + "respondTo": "slider", + "responsive": [ + { + "breakpoint": 2800, + "settings": { + "slidesToShow": 4, + "slidesToScroll": 4 + } + }, + { + "breakpoint": 2200, + "settings": { + "slidesToShow": 4, + "slidesToScroll": 4 + } + }, + { + "breakpoint": 2000, + "settings": { + "slidesToShow": 3.01, + "slidesToScroll": 3.01 + } + }, + { + "breakpoint": 1600, + "settings": { + "slidesToShow": 3, + "slidesToScroll": 3 + } + }, + { + "breakpoint": 1200, + "settings": { + "slidesToShow": 2.5, + "slidesToScroll": 2.5 + } + }, + { + "breakpoint": 900, + "settings": { + "slidesToShow": 2.5, + "slidesToScroll": 2 + } + }, + { + "breakpoint": 768, + "settings": { + "slidesToShow": 2, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 660, + "settings": { + "slidesToShow": 2, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 530, + "settings": { + "slidesToShow": 1.5, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 450, + "settings": { + "slidesToShow": 1, + "slidesToScroll": 1 + } + } + ], + "infinite": false, + "rtl": false + } + }, + "LibraryCourses": { + "slickSize": 10, + "slideConfig": { + "slidesToShow": 4, + "slidesToScroll": 4, + "respondTo": "slider", + "responsive": [ + { + "breakpoint": 2800, + "settings": { + "slidesToShow": 4, + "slidesToScroll": 4 + } + }, + { + "breakpoint": 2200, + "settings": { + "slidesToShow": 4, + "slidesToScroll": 4 + } + }, + { + "breakpoint": 2000, + "settings": { + "slidesToShow": 3.01, + "slidesToScroll": 3.01 + } + }, + { + "breakpoint": 1600, + "settings": { + "slidesToShow": 3, + "slidesToScroll": 3 + } + }, + { + "breakpoint": 1200, + "settings": { + "slidesToShow": 2.5, + "slidesToScroll": 2.5 + } + }, + { + "breakpoint": 900, + "settings": { + "slidesToShow": 2.5, + "slidesToScroll": 2 + } + }, + { + "breakpoint": 768, + "settings": { + "slidesToShow": 2, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 660, + "settings": { + "slidesToShow": 2, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 530, + "settings": { + "slidesToShow": 1.5, + "slidesToScroll": 1 + } + }, + { + "breakpoint": 450, + "settings": { + "slidesToShow": 1, + "slidesToScroll": 1 + } + } + ], + "infinite": false, + "rtl": false + } + }, + "Banner": { + "slickSize": 10, + "slideConfig": { + "slidesToShow": 3, + "slidesToScroll": 3, + "respondTo": "slider", + "dots": true, + "arrows": false, + "infinite": false, + "responsive": [ + { + "breakpoint": 768, + "settings": { + "slidesToShow": 1, + "slidesToScroll": 1 + } + } + ] + } + }, + "AdditionalBanner": { + "slickSize": 10, + "slideConfig": { + "slidesToShow": 6, + "slidesToScroll": 6, + "respondTo": "slider", + "dots": true, + "arrows": false, + "infinite": false, + "responsive": [ + { + "breakpoint": 768, + "settings": { + "slidesToShow": 3, + "slidesToScroll": 3 + } + } + ] + } + }, + "CoursePageSection": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "slideConfig": { + "variableWidth": true, + "centerPadding": "16px", + "infinite": false, + "rtl": false + }, + "course": { + "slickSize": 10, + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + } + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "trackable" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory", + "ribbon.left.image": "badgeAssertions[0].badgeClassImage" + } + }, + "enrolledCourses": { + "slickSize": 10, + "constantData": { + "action": { + "right": { + "class": "ui blue basic button", + "eventName": "Resume", + "displayType": "button", + "text": "Resume" + }, + "onImage": { + "eventName": "onImage" + } + } + }, + "metaData": { + "metaData": ["batchId", "courseId", "trackable"] + }, + "dynamicFields": { + "maxCount": "leafNodesCount", + "progress": "progress", + "ribbon.right.name": "content.primaryCategory" + } + } + }, + "Library": { + "slickSize": 10, + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + }, + "left": { + "class": "ui circular label card-badges-image" + } + } + }, + "metaData": { + "metaData": ["identifier", "mimeType", "framework", "contentType"] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory", + "ribbon.left.image": "badgeAssertions[0].badgeClassImage" + } + }, + "PublicPlayer": { + "contentApiQueryParams": { + "orgdetails": "orgName,email", + "licenseDetails": "name,description,url" + } + }, + "ContentPlayer": { + "contentApiQueryParams": { + "orgdetails": "orgName,email", + "licenseDetails": "name,description,url" + } + }, + "ExplorePage": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "slickSize": 10, + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + }, + "left": { + "class": "ui circular label card-badges-image" + } + } + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "trackable" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory", + "ribbon.left.image": "badgeAssertions[0].badgeClassImage" + } + }, + "CoursePage": { + "slickSize": 10, + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + }, + "left": { + "class": "ui circular label card-badges-image" + } + } + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "trackable", + "forumId" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory", + "ribbon.left.image": "badgeAssertions[0].badgeClassImage" + } + }, + "dialPage": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + } + }, + "GetPage": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + }, + "left": { + "class": "ui circular label card-badges-image" + } + }, + "telemetryInteractEdata": { + "id": "dial-code-view-card", + "type": "click", + "pageid": "get-dial" + }, + "telemetryObjectType": "public" + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "l1Parent", + "childTextbookUnit" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory", + "ribbon.left.image": "badgeAssertions[0].badgeClassImage" + } + }, + "HomeSearch": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + } + }, + "metaData": { + "metaData": ["identifier", "mimeType", "framework", "contentType"] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory", + "ribbon.left.image": "badgeAssertions[0].badgeClassImage" + } + }, + "CourseSearch": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "otherCourses": { + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + } + } + }, + "enrolledCourses": { + "constantData": { + "action": { + "right": { + "class": "ui blue basic button", + "eventName": "Resume", + "displayType": "button", + "text": "Resume" + }, + "onImage": { + "eventName": "onImage" + } + } + } + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "trackable" + ] + } + }, + "LibrarySearch": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + }, + "left": { + "class": "ui circular label card-badges-image" + } + } + }, + "metaData": { + "metaData": ["identifier", "mimeType", "framework", "contentType"] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory", + "ribbon.left.image": "badgeAssertions[0].badgeClassImage" + } + }, + "TELEMETRY": { + "MAX_BATCH_SIZE": 10, + "VERSION": "1.8.0", + "PID": "sunbird-portal" + }, + "FLAGREASONS": [ + { + "name": "Inappropriate content", + "value": "Inappropriate Content", + "description": "Hateful, harmful or explicit lesson that is inappropriate for young learners" + }, + { + "name": "Copyright violation", + "value": "Copyright Violation", + "description": "Uses copyrighted work without permission" + }, + { + "name": "Privacy violation", + "value": "Privacy Violation", + "description": "Collects sensitive data or personal information about users, such as name \\n address, photo or other personally identifiable information" + }, + { + "name": "Other", + "value": "Other" + } + ], + "PLAYER_CONFIG": { + "playerConfig": { + "context": { + "mode": "play", + "partner": [], + "pdata": { + "id": "sunbird.portal", + "ver": "1.8.0", + "pid": "sunbird-portal" + } + }, + "config": { + "showEndPage": false, + "endPage": [ + { + "template": "assessment", + "contentType": ["SelfAssess"] + } + ], + "showStartPage": true, + "host": "", + "overlay": { + "showUser": false + }, + "splash": { + "text": "", + "icon": "", + "bgImage": "assets/icons/splacebackground_1.png", + "webLink": "" + }, + "apislug": "/action", + "repos": ["/sunbird-plugins/renderer"], + "plugins": [ + { + "id": "org.sunbird.iframeEvent", + "ver": 1.0, + "type": "plugin" + }, + { + "id": "org.sunbird.player.endpage", + "ver": 1.1, + "type": "plugin" + } + ], + "sideMenu": { + "showShare": true, + "showDownload": true, + "showExit": false + } + } + }, + "contentType": { + "Course": "Course" + }, + "MIME_TYPE": { + "collection": "application/vnd.ekstep.content-collection", + "ecmlContent": "application/vnd.ekstep.ecml-archive", + "genericMimeType": [ + "application/pdf", + "video/mp4", + "video/x-youtube", + "video/youtube", + "application/vnd.ekstep.html-archive", + "application/epub", + "application/vnd.ekstep.h5p-archive", + "video/webm", + "text/x-url" + ], + "pdf": "application/pdf", + "mp4": "video/mp4", + "youtube": "video/x-youtube", + "pYoutube": "video/youtube", + "html": "application/vnd.ekstep.html-archive", + "ePub": "application/epub", + "h5p": "application/vnd.ekstep.h5p-archive", + "webm": "video/webm", + "xUrl": "text/x-url", + "questionset": "application/vnd.sunbird.questionset" + }, + "baseURL": "/content/preview/preview.html?webview=true", + "localBaseUrl": "/contentPlayer/preview/preview.html?", + "cdnUrl": "/content/preview/preview_cdn.html?webview=true" + }, + "WORKSPACE": { + "PAGE_LIMIT": 9, + "contentType": [ + "Collection", + "TextBook", + "Course", + "LessonPlan", + "Resource", + "SelfAssess", + "PracticeResource", + "LearningOutcomeDefinition", + "ExplanationResource", + "ExperientialResource", + "eTextBook", + "TVLesson" + ], + "primaryCategory": [ + "Course", + "Digital Textbook", + "Content Playlist", + "Explanation Content", + "Learning Resource", + "Practice Question Set", + "eTextbook", + "Teacher Resource", + "Course Assessment" + ], + "adminHandledContentType": ["TextBook"], + "mimeType": [ + "application/vnd.ekstep.ecml-archive", + "application/vnd.ekstep.content-collection" + ], + "objectType": "Content", + "lastUpdatedOn": "desc", + "createdOn": "asc", + "createdDate": "desc", + "name": "asc", + "genericMimeType": [ + "application/pdf", + "video/mp4", + "video/x-youtube", + "video/youtube", + "application/vnd.ekstep.html-archive", + "application/epub", + "application/vnd.ekstep.h5p-archive", + "video/webm", + "text/x-url" + ], + "states": [ + "draft", + "uploaded", + "published", + "limited-publish", + "allcontent", + "collaborating-on" + ], + "courseBatch": { + "PAGE_LIMIT": 12 + }, + "Draft": { + "constantData": { + "action": { + "right": { + "class": "trash large icon", + "eventName": "delete", + "displayType": "icon" + }, + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + } + }, + "telemetryInteractEdata": { + "id": "draftContentId", + "type": "click", + "pageid": "DraftContent" + }, + "telemetryObjectType": "draft" + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "primaryCategory", + "pkgVersion", + "status" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory" + } + }, + "Published": { + "constantData": { + "action": { + "right": { + "class": "trash large icon", + "eventName": "delete", + "displayType": "icon" + }, + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + } + }, + "telemetryInteractEdata": { + "id": "published", + "type": "click", + "pageid": "published" + }, + "telemetryObjectType": "published" + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "primaryCategory", + "pkgVersion", + "status" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory" + } + }, + "Uploaded": { + "constantData": { + "action": { + "right": { + "class": "trash large icon", + "eventName": "delete", + "displayType": "icon" + }, + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + } + }, + "telemetryInteractEdata": { + "id": "uploadedContent", + "type": "click", + "pageid": "UploadContent" + }, + "telemetryObjectType": "UploadContent" + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "primaryCategory", + "pkgVersion", + "status" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory" + } + }, + "Flagged": { + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + } + }, + "telemetryInteractEdata": { + "id": "flagged", + "type": "click", + "pageid": "Flagged" + }, + "telemetryObjectType": "UploadContent" + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "primaryCategory", + "pkgVersion", + "status" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory" + } + }, + "ReviewSubmission": { + "constantData": { + "action": { + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + } + }, + "telemetryInteractEdata": { + "id": "reviewSubmissionId", + "type": "click", + "pageid": "ReviewSubmission" + }, + "telemetryObjectType": "ReviewSubmission" + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "primaryCategory", + "pkgVersion", + "status" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory" + } + }, + "LimitedPublishing": { + "constantData": { + "action": { + "right": { + "class": "trash large icon", + "eventName": "delete", + "displayType": "icon" + }, + "left": { + "class": "linkify large icon float-ContentLeft limitedPublishingLinkIcon", + "eventName": "share", + "displayType": "icon" + }, + "onImage": { + "eventName": "onImage" + } + }, + "ribbon": { + "right": { + "class": "ui black right ribbon label" + } + }, + "telemetryInteractEdata": { + "id": "limitedPublish", + "type": "click", + "pageid": "LimitedPublish" + }, + "telemetryObjectType": "limitedPublish" + }, + "metaData": { + "metaData": [ + "identifier", + "mimeType", + "framework", + "contentType", + "primaryCategory", + "pkgVersion", + "status" + ] + }, + "dynamicFields": { + "ribbon.right.name": "primaryCategory" + } + }, + "questionPrimaryCategories": [ + "Multiple Choice Question", + "Subjective Question" + ] + }, + "DASHBOARD": { + "PAGE_LIMIT": 20 + }, + "CONTENT_CONST": { + "CREATE_LESSON": "application/vnd.ekstep.ecml-archive" + }, + "SEARCH": { + "PAGE_LIMIT": 100, + "SECTION_LIMIT": 3, + "USER": { + "DOWNLOAD_BUTTON_VISIBILITY": "FALSE" + }, + "ORGANISATION": { + "DOWNLOAD_BUTTON_VISIBILITY": "TRUE" + } + }, + "ADMIN_UPLOAD": { + "SAMPLE_USER_CSV": [ + { + "firstName": "firstName", + "lastName": "lastName", + "phone": "phone", + "email": "email", + "userName": "userName", + "externalId": "externalId", + "externalIdType": "externalIdType", + "externalIdProvider": "externalIdProvider", + "externalIds": "externalIds", + "phoneVerified": "phoneVerified", + "emailVerified": "emailVerified", + "roles": "roles", + "position": "position", + "grade": "grade", + "location": "location", + "dob": "dob", + "gender": "gender", + "language": "language", + "profileSummary": "profileSummary", + "subject": "subject" + } + ], + "SAMPLE_ORGANIZATION_CSV": [ + { + "orgName": "orgName", + "isRootOrg": "isRootOrg", + "channel": "channel", + "externalId": "externalId", + "provider": "provider", + "description": "description", + "homeUrl": "homeUrl", + "orgCode": "orgCode", + "orgType": "orgType", + "preferredLanguage": "preferredLanguage", + "contactDetail": "contactDetail", + "locationId": "locationId", + "locationCode": "locationCode" + } + ] + }, + "contentCreateType": { + "textbook": "textbook", + "course": "course", + "collection": "collection", + "studymaterial": "resource", + "lessonplan": "lessonplan" + }, + "contentCreateTypeLable": { + "textbook": "createtextbook", + "course": "designcourse", + "collection": "createcollection", + "studymaterial": "createlessontext", + "lessonplan": "createlessonplan", + "assessment": "createassessment" + }, + "contentName": { + "textbook": "Untitled Textbook", + "course": "Untitled Course", + "collection": "Untitled Collection", + "studymaterial": "Untitled Resource", + "lessonplan": "Untitled Lessonplan", + "assessment": "Untitled Assessment" + }, + "contentDescription": { + "textbook": "Enter description for TextBook", + "course": "Enter description for Course", + "collection": "Enter description for Collection", + "studymaterial": "Enter description for Resource", + "lessonplan": "Enter description for Lessonplan", + "assessment": "Enter description for Assessment" + }, + "contentCreateTypeForEditors": { + "textbook": "TextBook", + "course": "Course", + "collection": "Collection", + "studymaterial": "Resource", + "lessonplan": "LessonPlan", + "assessment": "SelfAssess" + }, + "course": { + "filterType": "course", + "inPageredirectUrl": "/learn", + "searchPageredirectUrl": "/search/Courses/1" + }, + "home": { + "filterType": "home", + "inPageredirectUrl": "/home", + "searchPageredirectUrl": "/search/All/1" + }, + "library": { + "filterType": "library", + "inPageredirectUrl": "/resources", + "searchPageredirectUrl": "/search/Library/1" + }, + "upForReview": { + "filterType": "upforreview", + "inPageredirectUrl": "/workspace/content/upForReview/1" + }, + "flagReviewer": { + "inPageredirectUrl": "/workspace/content/flagreviewer/1" + }, + "allmycontent": { + "filterType": "allmycontent", + "inPageredirectUrl": "workspace/content/allcontent/1", + "searchPageredirectUrl": "workspace/content/allcontent/1" + }, + "alltextbooks": { + "filterType": "alltextbooks", + "inPageredirectUrl": "workspace/content/alltextbooks/1", + "searchPageredirectUrl": "workspace/content/alltextbooks/1" + }, + "draft": { + "filterType": "draft", + "inPageredirectUrl": "workspace/content/draft/1", + "searchPageredirectUrl": "workspace/content/draft/1" + }, + "published": { + "filterType": "published", + "inPageredirectUrl": "workspace/content/published/1", + "searchPageredirectUrl": "workspace/content/published/1" + }, + "collaboration": { + "filterType": "collaboration", + "inPageredirectUrl": "workspace/content/collaborating-on/1", + "searchPageredirectUrl": "workspace/content/collaborating-on/1" + }, + "explore": { + "filterType": "explore", + "inPageredirectUrl": "/explore", + "searchPageredirectUrl": "/explore/1" + }, + "exploreCourse": { + "filterType": "explore-course", + "inPageredirectUrl": "/explore-course", + "searchPageredirectUrl": "/explore-course/1" + }, + "courses": { + "filterType": "courses", + "inPageredirectUrl": "/learn", + "searchPageredirectUrl": "/search/Courses/1" + }, + "formApiTypes": { + "home": "home", + "textbook": "textbook", + "course": "course", + "collection": "collection", + "studymaterial": "resource", + "lessonplan": "lessonplan", + "library": "library", + "allmycontent": "allmycontent", + "explore": "explore", + "resourcebundle": "resourcebundle", + "upforreview": "upforreview", + "collaboration": "collaboration", + "framework": "framework", + "explore-course": "explore-course", + "framework-code": "framework-code", + "courses": "courses", + "organization": "organization", + "externalIdVerification": "externalIdVerification", + "assessment": "assessment", + "userType": "userType" + }, + "cacheServiceConfig": { + "setTimeInMinutes": 10, + "setTimeInSeconds": 60 + }, + "resourceType": { + "collection": "Collection", + "textbook": "Book", + "course": "Course", + "lessonplan": "Lesson Plan", + "studymaterial": "Learn" + }, + "timeOutConfig": { + "setTime": 1500 + }, + "PROFILE": { + "contentApiQueryParams": { + "orgdetails": "orgName,email" + }, + "profileField": { + "profileSummary": "profile/summary/edit", + "jobProfile": "profile/experience/add", + "address": "profile/address/add", + "education": "profile/education/add", + "location": "profile/additionalInfo/edit", + "dob": "profile/additionalInfo/edit", + "subject": "profile/additionalInfo/edit", + "grade": "profile/additionalInfo/edit", + "gender": "profile/additionalInfo/edit", + "lastName": "profile/additionalInfo/edit", + "email": "profile/additionalInfo/edit", + "phone": "profile/additionalInfo/edit", + "language": "profile/additionalInfo/edit" + }, + "defaultViewMoreLimit": 3, + "defaultShowMoreLimit": 4, + "options": [ + { + "text": "Hide this from everyone", + "value": "private" + }, + { + "text": "Show this to all", + "value": "public" + } + ] + }, + "CHECK_LIST_CONFIG": { + "reject": { + "comments": "Please detail the required changes in the comments:" + }, + "publish": { + "title": "Are you sure you want to publish?" + }, + "read": { + "title": "Review Comments", + "subtitle": "" + } + }, + "collectionTreeOptions": { + "fileIcon": "sb-icon-content sb-fancyTree-icon", + "customFileIcon": { + "video": "icon play circle sb-fancyTree-icon", + "pdf": "sb-icon-doc sb-fancyTree-icon", + "youtube": "icon play circle sb-fancyTree-icon", + "H5P": "sb-icon-content sb-fancyTree-icon", + "audio": "sb-icon-mp3 sb-fancyTree-icon", + "ECML": "sb-icon-content sb-fancyTree-icon", + "HTML": "sb-icon-content sb-fancyTree-icon", + "collection": "icon folder sb-fancyTree-icon", + "epub": "sb-icon-doc sb-fancyTree-icon", + "doc": "sb-icon-doc sb-fancyTree-icon" + } + }, + "mediumCode": { + "english": "en", + "hindi": "hi", + "telugu": "te", + "kannada": "kn", + "tamil": "ta", + "marathi": "mr", + "urdu": "ur", + "malayalam": "ml", + "bengali": "bn", + "assamese": "as", + "gujarati": "gu", + "punjabi": "pa", + "oriya": "or" + }, + "DIAL_CODE": { + "PAGE_LIMIT": 10 + }, + "userTypeMapping": { + "student": ["Student", "Learner"], + "teacher": ["Teacher", "Instructor"], + "other": ["Student", "Teacher", "Instructor", "Learner"], + "administrator": ["Administrator"], + "parent": ["Student", "Teacher", "Instructor", "Learner"] + }, + "contentType": { + "Course": "Course", + "Collection": "Collection", + "Textbook": "Textbook", + "Resource": "Resource", + "Courses": "Courses", + "Textbooks": "Textbooks" + }, + "assetsPath": { + "book": "./assets/images/book.png" + }, + "OTPTemplate": { + "updateContactTemplate": "otpContactUpdateTemplate" + } +} diff --git a/packages/nulp_elite/src/pages/CourseTest.js b/packages/nulp_elite/src/pages/CourseTest.js new file mode 100644 index 00000000..e5f804dd --- /dev/null +++ b/packages/nulp_elite/src/pages/CourseTest.js @@ -0,0 +1,181 @@ +import React, { useState, useEffect } from "react"; +import { Box, Heading, Text, Button } from "@chakra-ui/react"; +import URLSConfig from "../configs/urlConfig.json"; +import APPConfig from "../configs/appConfig.json"; +import { + getCourseSection, + getCourseSectionDetails, + getQRCodeFile, + getEnrolledCourses, +} from "../services/courseService"; +import * as _ from "lodash-es"; + +const Coursetest = () => { + const [data, setData] = useState({}); + const [enrolledCourses, setEnrolledCourses] = useState([]); + const [isLoading, setIsLoading] = useState(false); + const [error, setError] = useState(null); + const [sectionId, setSectionId] = useState(null); + const [showExtContentMsg, setShowExtContentMsg] = useState(false); + useEffect(() => { + getCourseSectionPage(); + getQRCodeFilePage(); + + getEnrolledCoursesPage(); + }, []); + const headers = { + "content-type": "Application/json", + }; + + const getCourseSectionPage = async () => { + try { + const url = + "http://localhost:3000/learner/" + + URLSConfig.URLS.SYSTEM_SETTING.SSO_COURSE_SECTION; + const response = await getCourseSection(url, headers); + console.log(response.data.result); + setData(response.data.result); + } catch (error) { + setError(error.message); + } finally { + setIsLoading(false); + } + }; + + const getCourseSectionDetails = () => { + if (sectionId) { + return of(sectionId); + } + + return getCourseSection().pipe( + map((sectionId) => { + setSectionId(sectionId); + return sectionId; + }) + ); + }; + + const getQRCodeFilePage = async () => { + try { + const url = + "http://localhost:3000/learner/" + + URLSConfig.URLS.COURSE.GET_QR_CODE_FILE; + const data = { + request: { + filter: { + userIds: "5d757783-a86a-40cd-a814-1b6a16d37cb6", + }, + }, + }; + const response = await getQRCodeFile(url, data, headers); + console.log(response); + setData(response); + } catch (error) { + setError(error.message); + } finally { + setIsLoading(false); + } + }; + + const updateCourseProgressPage = (courseId, batchId, Progress) => { + const updatedCourses = _.cloneDeep(enrolledCourses); + const index = _.findIndex(updatedCourses, { + courseId: courseId, + batchId: batchId, + }); + if (index !== -1) { + updatedCourses[index].progress = Progress; + setEnrolledCourses(updatedCourses); + } + }; + + const setExtContentMsg = (isExtContent) => { + setShowExtContentMsg(isExtContent ? isExtContent : false); + }; + const findEnrolledCourses = (enrolledCourses, courseId) => { + const enrInfo = _.reduce( + enrolledCourses, + (acc, cur) => { + if (cur.courseId !== courseId) { + return acc; + } + if (_.get(cur, "batch.enrollmentType") === "invite-only") { + if (_.get(cur, "batch.status") === 2) { + acc.inviteOnlyBatch.expired.push(cur); + acc.expiredBatchCount++; + } else { + acc.onGoingBatchCount++; + acc.inviteOnlyBatch.ongoing.push(cur); + } + } else { + if (_.get(cur, "batch.status") === 2) { + acc.expiredBatchCount++; + acc.openBatch.expired.push(cur); + } else { + acc.onGoingBatchCount++; + acc.openBatch.ongoing.push(cur); + } + } + return acc; + }, + { + onGoingBatchCount: 0, + expiredBatchCount: 0, + openBatch: { ongoing: [], expired: [] }, + inviteOnlyBatch: { ongoing: [], expired: [] }, + } + ); + return enrInfo; + }; + + const getEnrolledCoursesPage = async () => { + try { + setIsLoading(true); + const params1 = APPConfig.Course.contentApiQueryParams.orgdetails; + const params2 = APPConfig.Course.contentApiQueryParams.licenseDetails; + const params3 = URLSConfig.params.enrolledCourses.fields; + const params4 = URLSConfig.params.enrolledCourses.batchDetails; + + const baseUrl = + "http://localhost:3000/learner/" + + URLSConfig.URLS.COURSE.GET_ENROLLED_COURSES; + const url = `${baseUrl}/5d757783-a86a-40cd-a814-1b6a16d37cb6?orgdetails=${params1}&licenseDetails=${params2}&fields=${params3}&batchDetails=${params4}`; + console.log(url); + const response = await getEnrolledCourses(url, headers); + console.log(response.data.result); + setData(response.data.result); + } catch (error) { + setError(error.message); + } finally { + setIsLoading(false); + } + }; + const handleFilterChange = (field, value) => {}; + + return ( + + + Welcome to Our Learning Portal Content + + + Enhance your knowledge and skills with our diverse range of courses and + content. + + + + {isLoading &&

Loading...

} + {error &&

Error: {error}

} + {Object.keys(data).map((key) => ( +
+

+ {key}: {JSON.stringify(data[key])} +

+
+ ))} +
+ ); +}; + +export default Coursetest; diff --git a/packages/nulp_elite/src/services/courseService.js b/packages/nulp_elite/src/services/courseService.js new file mode 100644 index 00000000..5d61df39 --- /dev/null +++ b/packages/nulp_elite/src/services/courseService.js @@ -0,0 +1,61 @@ +import { post, get, update } from "./RestClient.ts"; + +// Get all content +export const getAllCourses = async (url, filters = {}, header = {}) => { + const result = await post(url, filters, header); + if (result) { + return result; + } else { + return []; + } +}; + +export const getOne = async (url, header = {}) => { + const result = await get(url, { + header, + }); + if (result) { + return result; + } else { + return []; + } +}; + +// Update content +export const updateCourseProgress = async (url, data = {}, headers = {}) => { + const result = await update(url, data, { + headers, + }); + if (result) { + return result; + } else { + return {}; + } +}; + +export const getCourseSection = async (url, headers = {}) => { + const result = await get(url, { headers }); + if (result) { + return result; + } else { + return {}; + } +}; + +export const getQRCodeFile = async (url, data = {}, headers = {}) => { + const result = await post(url, { data }, { headers }); + if (result) { + return result; + } else { + return {}; + } +}; + +export const getEnrolledCourses = async (url, headers = {}) => { + const result = await get(url, { headers }); + if (result) { + return result; + } else { + return {}; + } +};