// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String NUMBER_OF_QUESTIONS_KEY = "numberOfQuestions";
// 
// 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 int TEST_RESULTS_RESULT = 0;


import android.content.Intent;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.util.ArrayList;
import static com.aepronunciation.ipa.MainActivity.NUMBER_OF_QUESTIONS_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.TEST_RESULTS_RESULT;
    private ArrayList<Answer> answers;

    private SingleSound singleSound;
    private DoubleSound doubleSound;
    private TextView tvInputWindow;
    private TextView tvQuestionNumber;
    private RelativeLayout nextButton;
    private String currentIpa = "";
    private static final int SRC_QUALITY = 0;
    private static final int PRIORITY = 1;
    private SoundPool soundPool = null;
    private boolean readyForNewSound = true;
    private int inputKeyCounter = 0;
    private int questionNumber = 0; // zero based
    private long startTime;

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View layout = inflater.inflate(R.layout.fragment_test_content, container, false);

        // get arguments
        if (getArguments() == null) {
            studentName = getString(R.string.test_default_name);
            totalNumberOfQuestions = 50;
            testMode = SoundMode.Single;
        } else {
            studentName = getArguments().getString(TEST_NAME_KEY);
            totalNumberOfQuestions = getArguments().getInt(NUMBER_OF_QUESTIONS_KEY, 50);
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String NUMBER_OF_QUESTIONS_KEY = "numberOfQuestions";
// 
// 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 int TEST_RESULTS_RESULT = 0;


// Path: app/src/main/java/com/aepronunciation/ipa/TestContentFragment.java
import android.content.Intent;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.util.ArrayList;
import static com.aepronunciation.ipa.MainActivity.NUMBER_OF_QUESTIONS_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.TEST_RESULTS_RESULT;

    private ArrayList<Answer> answers;

    private SingleSound singleSound;
    private DoubleSound doubleSound;
    private TextView tvInputWindow;
    private TextView tvQuestionNumber;
    private RelativeLayout nextButton;
    private String currentIpa = "";
    private static final int SRC_QUALITY = 0;
    private static final int PRIORITY = 1;
    private SoundPool soundPool = null;
    private boolean readyForNewSound = true;
    private int inputKeyCounter = 0;
    private int questionNumber = 0; // zero based
    private long startTime;

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View layout = inflater.inflate(R.layout.fragment_test_content, container, false);

        // get arguments
        if (getArguments() == null) {
            studentName = getString(R.string.test_default_name);
            totalNumberOfQuestions = 50;
            testMode = SoundMode.Single;
        } else {
            studentName = getArguments().getString(TEST_NAME_KEY);
            totalNumberOfQuestions = getArguments().getInt(NUMBER_OF_QUESTIONS_KEY, 50);
            testMode = SoundMode.fromString(getArguments().getString(TEST_MODE_KEY));