@skillsuite/course-viewer
1.8.5 • Public • Published SkillSuite - Course Viewer
This is a package to embed our course viewer feature into your own React project. It's simple, and you don't need third party libraries.
Scripts
Command |
Description |
npm run start |
Start development server |
npm run build |
Start build script |
Example
import CourseViewer, { config, client } from "@skillsuite/course-viewer";
config.log = console.log;
config.baseURL = "htttp://myhost.com.br";
const App = () => {
const [ overview, setOverview ] = useState(null);
const onSection = async ({ section }) => await client.get("/api/v3/course_viewer/section/" + section);
const onQuiz = async ({ quiz }) => await client.get("/api/v3/course_viewer/form/" + quiz);
useEffect(() => {
client.get("/api/v3/course_viewer/" + 1695).then(setOverview);
}, []);
return (
<CourseViewer
overview={ overview }
onSection={ onSection }
onQuiz={ onQuiz }
/>
)
}
Props
name |
description |
overview |
Object with course basic info |
onSection |
Callback to return the data from specific section |
onQuiz |
Callback to return the data from specific quiz |
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 1.8.5
0
Version History
Package Sidebar
Install
npm i @skillsuite/course-viewer
Weekly Downloads