Because of the way your table is setup you can have it read only the quiz that is associated with the user by adding AND user_id = %d", $form_id, $user_id ) );
You just need to make sure that $user_id
is set to the id of the user currently logged in which will probably be in a session (or however it knows what user to select).
For example:
$userid = $_SESSION['userid'];
The new code
<?php
global $wpdb, $ipt_fsqm_info;
$userid = $_SESSION['userid']; //Change
$form_id = 9;
$data_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$ipt_fsqm_info['data_table']} WHERE form_id = %d AND user_id = %d ORDER BY id DESC LIMIT 0,1", $form_id, $user_id ) );
foreach ( $data_ids as $data_id ) {
$data = new IPT_FSQM_Form_Elements_Data( $data_id );
echo wpautop( $data->data->pinfo[14]['value'] );
}
?>