@skillsuite/course-viewer
v1.8.9
Published
SkillSuite Course Viewer Package
Downloads
226
Readme
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 |