||" if( strstr( $tempStr, "|" ) ) { $pipeLoc = strpos( $tempStr, "|" ); $firstNumber = substr( $tempStr, 0, $pipeLoc ); $tempStr2 = substr( $tempStr, $pipeLoc+1 ); if( !strstr( $tempStr2, "|" ) ) { // if one | character is found but not a 2nd, something went wrong. report_error_form("MatRPC return value had only 1 pipe character.","form_processing/form_corina_quicktime_v1.php",""); } $pipeLoc = strpos( $tempStr2, "|" ); $secondNumber = substr( $tempStr2, 0, $pipeLoc ); $stimId = substr( $tempStr2, $pipeLoc+1 ); $_SESSION['firstNumber'] = $firstNumber; $_SESSION['secondNumber'] = $secondNumber; } else { $stimId = $tempStr; } } else { $stimId = $_SESSION['stimulus_id']; } // this would occur if the user relaods a page for example- // the matrpc call isn't repeated, but we still want to display // the trial count message so here we pull the values out of the session if( strlen( $firstNumber ) < 1 && isset( $_SESSION['firstNumber'] ) ) { $firstNumber = $_SESSION['firstNumber']; $secondNumber = $_SESSION['secondNumber']; } // matrpc function has told us to end the experiment // this can override ensemble's loop mechanism if( $stimId == "end" ) { unset( $_SESSION['trial_id'] ); //after all trials have been exhausted, break out of the loop $_SESSION['num_skip_forms'] = 1; include_once( $questionnaire_dir."form_processing/update_session.php" ); } elseif( $stimId == "break" ) // take a break { include_once( $questionnaire_dir."form_processing/htmlhead_name_mesg.php" ); printf( "
\n", $_SERVER['PHP_SELF'] ); print LANGUAGE_TEXT_BREAK_INSTRUCTION ; printf( "

\n" ); printf( "\n",LANGUAGE_TEXT_QPI_NEXT_BUTTON ); printf( "
"); } elseif( is_numeric( $stimId ) && $stimId > 0 ) // we got a good result from the matrpc call { include_once('htmlhead_name_mesg_formhead.php'); $_SESSION['stimulus_id'] = $stimId; // jg don't display unless first and 2nd numbers exist if( strlen( $firstNumber ) > 0 && strlen( $secondNumber ) > 0 ) { printf( "
%s of %s
", $firstNumber, $secondNumber ); } // (player, stimID, autoplay, allowcontrol, numreps ) present_stimuli( 'quicktime', $stimId, $doPlayStim, true, 3 ); $submit_to = "submit_response.php"; $trial_form = FALSE; include_once('display_form_fields.php'); // April 2008: iframe to reference a simple form submit button // that says "Save and Quit"- this button doesn't really do anything. // anyway, it's in an iframe because this way we can bypass that main // ensemble structure, which would be difficult to modify to accept // a blank submission like that without an error. printf( "" ); printf("\n" ); } elseif( $stimId == "error" ) { report_error_form("MatRPC callback returned an error.","form_processing/form_corina_quicktime_v1.php",""); } ?>