mediarecorder.record

getMediaRecorder(id).record() (since PennController 1.8) Starts recording. Example: [js highlight=”5″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newMediaRecorder(“recorder”,”audio”) .record() , newTimer(“recording”, 2000) .start() .wait() , getMediaRecorder(“recorder”) .stop() .play() .wait(“playback”) );[/js] Will record audio for 2s and then play it back.

mediarecorder.play

getMediaRecorder(id).play() (since PennController 1.8) Starts playing the last recording (if any). Example: [js highlight=”15″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newMediaRecorder(“recorder”) .record() , newTimer(“recording”, 2000) .start() .wait() , getMediaRecorder(“recorder”) .stop() .print() .disable() .play() .wait(“playback”) ); [/js] Will record for 2s and then play back the recording.

html.settings.radioWarning

getHtml(id).settings.radioWarning( message ) Defines the error message that gets displayed if no radio button of an obligatory group is checked when calling . If you use %name% in the string it will be replaced with the element’s name. Example: [js highlight=”4″ try=”true”]newHtml(“intro”, “example_intro.html”) .settings.checkboxWarning(“It is highly recommended that you check the ‘%name%’ box before continuing”) …

html.settings.inputWarning

getHtml(id).settings.inputWarning( message ) Defines the error message that gets displayed if an obligatory input field is not filled when calling . If you use %name% in the string it will be replaced with the element’s name. Example: [js highlight=”3″ try=”true”]newHtml(“intro”, “example_intro.html”) .settings.checkboxWarning(“It is highly recommended that you check the ‘%name%’ box before continuing”) .settings.inputWarning(“We would …

html.settings.checkboxWarning

getHtml(id).settings.checkboxWarning( message ) Defines the error message that gets displayed if an obligatory checkbox is not checked when calling . If you use %name% in the string it will be replaced with the element’s name. Example: [js highlight=”2″ try=”true”]newHtml(“intro”, “example_intro.html”) .settings.checkboxWarning(“It is highly recommended that you check the ‘%name%’ box before continuing”) .settings.radioWarning(“Please consider selecting …

controller.wait

getController(id).wait() (since PennController 1.7) or getController(id).wait( test ) (since PennController 1.7) Waits until the controller has been completed. Example: [js highlight=”9″ try=”true”]newButton(“Start reading”) .print() .wait() .remove() , newController(“DashedSentence”, {s: “The mouse that the cat that the dog is petting is hugging is happy”} ) .print() .log() .wait() .remove() , newText(“Good job!”) .print() [/js]

The Debugger

Detecting and fixing typos Say you mistype a command, for example you type newCanva instead of newCanvas: [js highlight=11]newTrial( newText(“The fish swim in a tank which is perfectly round”) .print() , newImage(“two”, “2fishRoundTank.png”) .size(200,200) , newImage(“one”, “1fishSquareTank.png”) .size(200,200) , newCanva(450,200) .add( 0 , 0 , getImage(“tow”) ) .add( 250 , 0 , getImage(“one”) ) .print() …