Following steps allow developer to have a quick start with simple integration.

Prerequisites

You need:
  • A Proview tenant and project dsn. You can reach out to our customer success team or sales team to get a tenant created for your use-case.

Install

In-order to proctor the session load the following script into your application.

Step 1 - Load the script

<script
  src="https://dev.proview.io/cdn/init.js"
  crossorigin="anonymous">
</script>

Step 2 - Initialize Proview

<html>
    <head>
        <title>Proview</title>
    </head>
    <body>
        <div>
            <h1>Title: Exam 001</h1>
            This is a dummy implementation
            <button onclick="StartProctoredExam()">Start Exam</button>
            <button style="display:none" onclick="StopProctoredExam()">Stop Exam</button>
            <button style="display:none" display="none" onclick="SubmitProctoredExam()">Submit Exam</button>
        </div>
        <script>
            // Configure proviewOnLoad before adding the Loader Script
            window.proviewOnLoad = function () {
                Proview.init({
		                dsn: "",
                    attendee_identifier :"att_0001",
                    workflow_identifier :"exam_0023"
                });

                Proview.onError((err)=>{
                    console.error(error);
                });
            };

            function StartProctoredExam()
            {
                Proview.session.start({
                    type: Proview.session.types.RECORDED,
                    sessionIdentifier: "session_0012"
                }, (sessionOutput, err)=>{
                        console.log(sessionOutput.state);
                        LoadExam();
                });
            }

            function StopProctoredExam()
            {
                Proview.session.stop((sessionOutput, err)=>{
		                    console.log(sessionOutput.state);
                });
            }

            function submitProctoredExam()
            {
                Proview.session.complete((sessionOutput, err)=>{
                        console.log(sessionOutput.state);
                        RedirectToHome();
                });
            }

            function RedirectToHome()
            {
                window.location.href = "https://proview.io";
            }

            function LoadExam()
            {
                document.getElementById("start-exam-button").style.display = "none";
                document.getElementById("stop-exam-button").style.display = "block";
                document.getElementById("submit-exam-button").style.display = "block";
                alert('Load Exam / Show Exam content here..');
            }
        </script>

        <script
            src="https://dev.proview.io/cdn/init.js" async
            crossorigin="anonymous">
        </script>
    </body>
</html>