function questionaires(questionaire_text1,questionaire_text2, questionaire_text3, questionaire_text4, questionaire_type) {

  var data_to_save = [];
  var questionaire1 = {
     type: 'html-keyboard-response',
     type: 'survey-text',
     questions: [
          {prompt: questionaire_text1,
           rows: 5,
           columns:50,
           required:true,
           name: 'Translation of the phrase'}
         ]
  };
  var save_answers_questionaire1 = {
  			  type: 'html-keyboard-response',
  			  stimulus: '',
  				choices: jsPsych.NO_KEYS,
  				prompt: function(){
  	  						// -------------- SAVE DATA (csv)----------------
                  var data_response = jsPsych.data.get().last(1).values()[0].responses;
                  var data_resp = data_response.split('"');
                  var myQ1 = [data_resp[1], data_resp[5]]
                  var myAns_Q1 = [data_resp[3], data_resp[7]];
                  var time = getTime();
                  var data_Q1 = ['Questionaire1\n', myQ1[0], myQ1[1]+'\n',
                  myAns_Q1[0], myAns_Q1[1]+'\n', data_response+'\n', 'TimeCompleted: '+time+'\n\n'];
                  data_to_save = data_to_save.concat(data_Q1);
                  var data_to_save_string = data_to_save.toString();
  				  var csvName = window.saveFileNameHeader+'_'+questionaire_type+'.csv';
  				 saveData(csvName,data_to_save_string);
  					      return ''
  						    },
  				trial_duration:500
  		};

  var questionaire2 = {
     type: 'html-keyboard-response',
     preamble: questionaire_text2,
     type: 'survey-text',
     questions: [
        {prompt: '<p style="font-size: 14px;line-height: 0;"> 1. himi</p>',
        required: true,
        name: 'himi'},
        {prompt: '<p style="font-size: 14px;line-height: 0;">2. hono</p>',
        required: true,
        name: 'hono'},
        {prompt: '<p style="font-size: 14px;line-height: 0;">5. puku</p>',
                required: true,
                name: 'puku'},
        {prompt: '<p style="font-size: 14px;line-height: 0;">6. taka</p>',
                required: true,
                name: 'taka'}
      ]
  };

  var save_answers_questionaire2 = {
  			  type: 'html-keyboard-response',
  			  stimulus: '',
  				choices: jsPsych.NO_KEYS,
  				prompt: function(){
  	  						// -------------- SAVE DATA (csv)----------------
                  var data_response = jsPsych.data.get().last(1).values()[0].responses;
                  var data_resp = data_response.split('"'); // this works well only when there is no any '"' sign input in the survey box
                  var myWord_Q2 = [data_resp[1], data_resp[5], data_resp[9], data_resp[13], data_resp[17], data_resp[21], data_resp[25], data_resp[29]];
                  var myAns_Q2 = [data_resp[3], data_resp[7], data_resp[11], data_resp[15], data_resp[19], data_resp[23], data_resp[27], data_resp[31]];
                  var ID_info = ['','ExperimentCode:',ExperimentCode+'\n\n'];
				  var time = getTime();
                  var data_Q2 = ['Questionaire2\n',
                      'ALL_words', myWord_Q2[0], myWord_Q2[1], myWord_Q2[2], myWord_Q2[3], myWord_Q2[4], myWord_Q2[5], myWord_Q2[6], myWord_Q2[7]+'\n',
                      'answers', myAns_Q2[0], myAns_Q2[1], myAns_Q2[2], myAns_Q2[3], myAns_Q2[4], myAns_Q2[5], myAns_Q2[6], myAns_Q2[7]+'\n',
                      '', data_response+'\n', 'TimeCompleted: '+time+'\n\n'];
                  data_to_save = data_to_save.concat(ID_info).concat(data_Q2);
                  var data_to_save_string = data_to_save.toString();
				    var csvName = window.saveFileNameHeader+'_'+questionaire_type+'.csv';
       			  saveData(csvName,data_to_save_string);
  				  return ''
  				  },
  				trial_duration:500
  		};



var questionaire3 = {
    type: 'html-keyboard-response',
    preamble: questionaire_text3,
    type: 'survey-text',
    questions: [
          {prompt: '<p style="font-size: 15px;line-height: 0.4;"> Language & Proficiency</p>',placeholder: "Language: Proficiency",
          required: true,
          name:"language experience1"},
          {prompt: '<p style="font-size: 15px;line-height: 0.4;"> Language & Proficiency</p>',placeholder: "Language: Proficiency",
          required: true,
          name: 'language experience2'}
      ],
};

var save_answers_questionaire3 = {
			  type: 'html-keyboard-response',
			  stimulus: '',
				choices: jsPsych.NO_KEYS,
				prompt: function(){
	  						// -------------- SAVE DATA (csv)----------------
                var data_response = jsPsych.data.get().last(1).values()[0].responses;
                var data_resp = data_response.split('"');
                var myQ3 = [data_resp[1], data_resp[5], data_resp[9]]
                var myAns_Q3 = [data_resp[3], data_resp[7], data_resp[11]];
                var time = getTime();
                var data_Q3 = ['Questionaire3\n',
                    myQ3[0], myQ3[1], myQ3[2]+'\n',
                    myAns_Q3[0], myAns_Q3[1], myAns_Q3[2]+'\n',
                    data_response+'\n', 'TimeCompleted: '+time+'\n\n'];
                data_to_save = data_to_save.concat(data_Q3);
                var data_to_save_string = data_to_save.toString();
				  var csvName = window.saveFileNameHeader+'_'+questionaire_type+'.csv';
     			  saveData(csvName,data_to_save_string);
					      return ''
						    },
				trial_duration:500
		};

var questionaire4 = {
    type: 'survey-text',
    questions: [
       {prompt: questionaire_text4,
        rows: 10,
        columns:100,
        required:true,
        name: 'Strategy'}
      ],
      button_label: 'Finish'
};

var save_answers_questionaire4 = {
			  type: 'html-keyboard-response',
			  stimulus: '',
				choices: jsPsych.NO_KEYS,
				prompt: function(){
	  						// -------------- SAVE DATA (csv)----------------
                var data_response = jsPsych.data.get().last(1).values()[0].responses;
                var data_resp = data_response.split('"');
                var myQ4 = [data_resp[1], data_resp[5]]
                var myAns_Q4 = [data_resp[3], data_resp[7]];
                var time = getTime();
                var data_Q4 = ['Questionaire4\n', myQ4[0], myQ4[1]+'\n',
                myAns_Q4[0], myAns_Q4[1]+'\n', data_response+'\n', 'TimeCompleted: '+time+'\n\n'];
                data_to_save = data_to_save.concat(data_Q4);
                var data_to_save_string = data_to_save.toString();
				  var csvName = window.saveFileNameHeader+'_'+questionaire_type+'.csv';
				 saveData(csvName,data_to_save_string);
					      return ''
						    },
				trial_duration:500
		};

var all_questionaires = {
		timeline: [
		     questionaire1,
         save_answers_questionaire1,
         questionaire2,
         save_answers_questionaire2,
         questionaire3,
         save_answers_questionaire3,
         questionaire4,
         save_answers_questionaire4,
			 ]
	  }
return all_questionaires
};
