// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String CONSONANT_ARRAY_KEY = "consonantArray";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TEST_MODE_KEY = "testMode";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TEST_NAME_KEY = "testName";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String VOWEL_ARRAY_KEY = "vowelArray";


import android.content.DialogInterface;
import android.content.Intent;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import java.text.DateFormat;
import android.util.Pair;
import android.view.MenuItem;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import static com.aepronunciation.ipa.MainActivity.CONSONANT_ARRAY_KEY;
import static com.aepronunciation.ipa.MainActivity.TEST_MODE_KEY;
import static com.aepronunciation.ipa.MainActivity.TEST_NAME_KEY;
import static com.aepronunciation.ipa.MainActivity.VOWEL_ARRAY_KEY;

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // handle arrow click here
        if (item.getItemId() == android.R.id.home) {
            finish(); // close this activity and return to preview activity (if there is any)

        }

        return super.onOptionsItemSelected(item);
    }

    public void practiceDifficultClick(View view) {

        // get vowel and consonant sounds
        ArrayList<String> vowelArray = new ArrayList<>();
        ArrayList<String> consonantArray = new ArrayList<>();
        Set<String> allSounds = findNeedToPracticeSounds(answers);
        for (String sound : allSounds) {
            if (Ipa.isConsonant(sound)) {
                consonantArray.add(sound);
            } else {
                vowelArray.add(sound);
            }
        }

        // put the String to pass back into an Intent and close this activity
        Intent intent = new Intent();
        intent.putExtra(TEST_MODE_KEY, testMode);
        intent.putStringArrayListExtra(VOWEL_ARRAY_KEY, vowelArray);
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String CONSONANT_ARRAY_KEY = "consonantArray";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TEST_MODE_KEY = "testMode";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TEST_NAME_KEY = "testName";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String VOWEL_ARRAY_KEY = "vowelArray";


// Path: app/src/main/java/com/aepronunciation/ipa/TestResultsActivity.java
import android.content.DialogInterface;
import android.content.Intent;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import java.text.DateFormat;
import android.util.Pair;
import android.view.MenuItem;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import static com.aepronunciation.ipa.MainActivity.CONSONANT_ARRAY_KEY;
import static com.aepronunciation.ipa.MainActivity.TEST_MODE_KEY;
import static com.aepronunciation.ipa.MainActivity.TEST_NAME_KEY;
import static com.aepronunciation.ipa.MainActivity.VOWEL_ARRAY_KEY;


    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // handle arrow click here
        if (item.getItemId() == android.R.id.home) {
            finish(); // close this activity and return to preview activity (if there is any)

        }

        return super.onOptionsItemSelected(item);
    }

    public void practiceDifficultClick(View view) {

        // get vowel and consonant sounds
        ArrayList<String> vowelArray = new ArrayList<>();
        ArrayList<String> consonantArray = new ArrayList<>();
        Set<String> allSounds = findNeedToPracticeSounds(answers);
        for (String sound : allSounds) {
            if (Ipa.isConsonant(sound)) {
                consonantArray.add(sound);
            } else {
                vowelArray.add(sound);
            }
        }

        // put the String to pass back into an Intent and close this activity
        Intent intent = new Intent();
        intent.putExtra(TEST_MODE_KEY, testMode);
        intent.putStringArrayListExtra(VOWEL_ARRAY_KEY, vowelArray);
        intent.putStringArrayListExtra(CONSONANT_ARRAY_KEY, consonantArray);