$data['response_id'] = $response_id;
        $data['study_id'] = $study_id;
        $data['questionnaire_id'] = $questionnaire_id;
        $data['question_id'] = $question_id;
        $data['question_name'] = get_question_name($question_id, 'ro');
        $data['question_type'] = $question_type;
        $data['choice_id'] = null;
        $data['score'] = null;
        $data['data'] = null;
        if ($question_type == 'choice') {
            $choice_name = get_choice_name($answer, 'ro');
            $query = "INSERT INTO results (`study_id`, `subj_id`, `questionnaire_id`, `question_id`, `choice_id`, `data`, `response_id`)\n\t\t\t\t\tVALUES ('" . $study_id . "', '" . $subject_id . "', '" . $questionnaire_id . "', '" . $question_id . "', '" . $answer . "', '" . $choice_name . "' , '" . $response_id . "') ";
            $result = mysql_query($query, $dbconnect);
            confirm_query($result);
            $data['choice_id'] = $answer;
            $data['score'] = get_choice_score($answer);
        } elseif ($question_type == 'text') {
            $query = "INSERT INTO results (`study_id`, `subj_id`, `questionnaire_id`, `question_id`, `data`, `response_id`)\n\t\t\t\t\t\t\t\t\t\tVALUES ('" . $study_id . "', '" . $subject_id . "', '" . $questionnaire_id . "', '" . $question_id . "', '" . mysql_real_escape_string(htmlspecialchars($answer)) . "', '" . $response_id . "') ";
            $result = mysql_query($query, $dbconnect);
            confirm_query($result);
            $data['data'] = $answer;
        }
        //}
    }
    ?>
		<p><strong>Raspunsurile au fost salvate!</strong></p>
		<p><em>Multumim pentru participare.</em></p>
		
		<p>Inapoi la <a href="tester.php">prescriptiveindex.ro</a>
		<?php 
    die;
        echo $question_type;
        ?>
                  </li>
                  <li class="answer">
                     <?php 
        if ($row['choice_id'] == 0) {
            echo $row['data'];
        } else {
            echo get_choice_name($row['choice_id'], $lang);
        }
        ?>
                  </li>
                  <li class="score">
                     <?php 
        if ($row['choice_id'] != 0) {
            echo get_choice_score($row['choice_id']);
        }
        ?>
                  </li>
               </ul>
            </li>
      <?php 
    }
} else {
    redirect("manage_subjects.php");
}
?>
      </ul>
      
      <a class="download csv" href="csv.php?subj_id=<?php 
echo $subject_id;