Embedding a Virtual Lab in Moodle

Add or edit an existing section or HTML block and once you see the Rich Text editor, look for the down arrow in the toolbar, and click that to expand the options in the toolbar.

Then you'll see the icon </> which when you click that, it will switch to the HTML editor view. You will copy the HTML/Javascript snippet below and edit the values to reflect the project you want to launch.

Here is the snippet to add in the HTML editor shown above. Be sure to replace the project name and token with your project's name and token.

Get your project name and token from within the "Projects" screen in the Appsembler Virtual Labs interface.

Copy and paste the following into your Moodle site after you've replaced the project name and token with your project's name and token.

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>

<div id="wharf">

<iframe src="https://staging-avl.appsembler.com/isc/newdeploy/" style="visibility: hidden" width="0" height="0"></iframe>

<p>When you click the button below, a new REPLACE-THIS-WITH-PROJECT-FRIENDLY-NAME site will be started for you.</p>

<input type="button" value="Launch REPLACE-THIS-WITH-PROJECT-FRIENDLY-NAME site" style="margin-bottom: 20px;">



(function() {

    var $wharf = $('#wharf'),

        $launch_button = $wharf.find('input');

    $launch_button.click(function() {

        $launch_button.attr('disabled', 'disabled').val('Launching...');

        var user_id = $('div.logininfo a').attr('href').split('id=')[1];


            owner_email: user_id + "@moodle_id.appsembler",



        }, "https://staging\u002Davl.appsembler.com");

        return false;


    window.addEventListener("message", function(event) {

        if (event.origin !== 'https://staging\u002Davl.appsembler.com') return;

        if (event.data.status === 'siteDeployed') {


        } else if (event.data.status === 'deploymentError') {



    }, false);



You need to turn editing off before trying out the launch button. Click the orange "Turn editing off" button.

Now you can click the "Launch Tomcat site" button to launch the lab environment. 

After you click the button, you will see the button change to "Launching..."

And after a few seconds, you should see the launch URL and any other information that you're displaying to the learner: