\n",$_SERVER['PHP_SELF']); printf("%s

\n",LANGUAGE_TEXT_BREAK_INSTRUCTION); printf("\n",LANGUAGE_TEXT_QPI_NEXT_BUTTON); printf(""); } elseif ($stimulus_str == "end") { //after all stims have been revisited, skip if(isset($_SESSION['loop_end']) && isset($_SESSION['loop_goto'])) $_SESSION['num_skip_forms'] = $_SESSION['loop_end'] - $_SESSION['last_visited'] + 1; else $_SESSION['num_skip_forms'] = 1; include_once($questionnaire_dir."form_processing/update_session.php"); } else { include_once('htmlhead_name_mesg_formhead.php'); printf("\n

%s

\n\n",LANGUAGE_TEXT_PLAYING_AUDIO_NOTIFICATION); // Make sure we have a cleanly constructed dictionary $stimdict = json_decode($stimulus_str,true); if ($DEBUG) { write2log("Decoded stimulus string\n");} //if ($DEBUG} { print_r($stimdict['location']);} $options['urls'] = isset($stimdict['location']) ? $stimdict['location'] : array(); $options['playLengths'] = (isset($stimdict['duration']) && $stimdict['duration'][0] != NULL) ? $stimdict['duration'] : array(); $options['pauses'] = (isset($stimdict['pauses']) && $stimdict['pauses'][0] != NULL) ? $stimdict['pauses'] : array(); $options['skips'] = (isset($stimdict['skips']) && $stimdict['skips'][0] != NULL) ? $stimdict['skips'] : array(); $options['runWhenDone'] = isset($stimdict['runWhenDone']) ? $stimdict['runWhenDone'] : ""; $options['loadWhenDone'] = $questionnaire_location."form_processing/goto_current_form_w_misc.php"; //$options['loadWhenDone'] = ""; // Prepend the stimulus location to each of the urls foreach ($options['urls'] as &$loc) { $loc = $stimuli_location . $loc; } // There is a bit of an issue here as to what should be set as the // stimulus ID. Probably the safest thing for now is to set it to // the first stimulus ID of the set, though this is really not a // clean way to go $stimulus_id = $stimdict['stimulus_id'][0]; $_SESSION['stimulus_id'] = $stimulus_id; // Create a list of the stimuli so that this can be saved to the // misc field $_SESSION['misc_info'] = json_encode($stimdict['stimulus_id']); if ($DEBUG){ write2log("form_stimulus_matlab_multi_s.php: Ready to play audio stimuli starting with stimulus_id=" . $stimulus_id . "; location:" . $options['urls'][0] . "\n"); } play_audio_stimuli($options); } } else { include_once('htmlhead_name_mesg_formhead.php'); include_once('display_form_fields.php'); } include_once("htmlfoot.php"); ?>