Online Balloon Analogue Risk Task (oBART)

Example 2

For more information see http://timo.gnambs.at.



Instructions

  1. Load all required files for the BART in the head of the page:
    
    <script type="text/javascript" src="src/jquery-3.0.0.min.js"></script>	<!-- basic javascript library for dom manipulation -->
    <script type="text/javascript" src="src/jcanvas.min.js"></script>      	<!-- the canvas plugin -->
    <script type="text/javascript" src="src/jquery.bart.js"></script>       <!-- the main BART plugin -->
    <link rel="stylesheet" type="text/css" href="src/jquery.bart.css" />    <!-- additional styles for to make the BART look fancy -->
    
  2. Create an element in the body of the page with a unique id-attribute (here: "bart"):
    <div id="bart"></div>
  3. Create a script section in the head of the page:
    
    <script type="text/javascript">
    </script>
    
  4. Initialize the BART script after the page has loaded:
    
    <script type="text/javascript">
    	$(document).ready(function() {   // initialize the BART after the page has loaded
    	});
    </script>
    
  5. Define the BART (e.g., number and color of balloons) using the id defined in step 2 (see head of src/jquery.bart.js for configuration options):
    
    <script type="text/javascript">
    	$(document).ready(function() {   // initialize the BART after the page has loaded
    		$("#bart").bart( { b: 5,                    // create 5 balloons
    				   o: { color: '#00FF00',   // color of balloons
    			                earnings: 1,        // points earned for each pump
    			                popprob: 100        // probability of popping; defined as 1 out of popprop
    				      }
    			         } );
    	});
    </script>
    
    If an object with two elements named b and o is passed to the bart()-function, element b refers to the balloons (a single number indicates the number of balloons), whereas element o defines various settings for all balloons. The element color of o sets the color of the balloons (as hexcode), earnings sets the number of points received for each pump, and popprob sets the probability for an explosion at the first pump as 1 / popprob (e.g., popprob: 100 gives a probability of 1 / 100 = 0.001 = 1%).