<commit_before>package lt.vumifps.undzenastest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ListView;

import java.util.LinkedList;


public class StartingActivity extends Activity implements
        OnQuizListItemClickListener,
        View.OnClickListener {

    private LinkedList<Quiz> quizzes;
    private TestLoader loader;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_starting);


        loader = new TestLoader(this);
        quizzes = loader.loadAllQuizzes(this.getResources());

        ListView quizzesListView = (ListView) this.findViewById(R.id.quizzesListView);
        QuizzesListViewAdapter quizzesListViewAdapter = new QuizzesListViewAdapter(this, quizzes);
        quizzesListViewAdapter.setOnQuizListItemClickListener(this);
        quizzesListView.setAdapter(quizzesListViewAdapter);

        View examButton = findViewById(R.id.examButton);
        examButton.setOnClickListener(this);
    }


    @Override
    public void onQuizClick(int index, int resId, boolean shouldRandomize) {
        Intent intent = new Intent(this, MainActivity.class);

        Quiz quizToLoad = quizzes.get(index);

        if (shouldRandomize) {
            quizToLoad.shuffleQuestions();
        }

        intent.putExtra(MainActivity.JSON_RES_ID_KEY, resId);
        intent.putExtra(MainActivity.QUIZ_JSON_KEY, quizToLoad.toJson().toString());
        intent.putExtra(MainActivity.SHOULD_RANDOMIZE_KEY, shouldRandomize);
        startActivity(intent);
        finish();
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent(this, ExamConfigActivity.class);

        Quiz combinedQuiz = loader.getCombinedQuiz(quizzes);

        intent.putExtra(MainActivity.JSON_RES_ID_KEY, -1);
        intent.putExtra(MainActivity.QUIZ_JSON_KEY, combinedQuiz.toJson().toString());
        startActivity(intent);
    }
}
<commit_msg>Fixed bug, causing application to be closed when pressing back in test<commit_after>package lt.vumifps.undzenastest;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ListView;

import java.util.LinkedList;


public class StartingActivity extends Activity implements
        OnQuizListItemClickListener,
        View.OnClickListener {

    private LinkedList<Quiz> quizzes;
    private TestLoader loader;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_starting);


        loader = new TestLoader(this);
        quizzes = loader.loadAllQuizzes(this.getResources());

        ListView quizzesListView = (ListView) this.findViewById(R.id.quizzesListView);
        QuizzesListViewAdapter quizzesListViewAdapter = new QuizzesListViewAdapter(this, quizzes);
        quizzesListViewAdapter.setOnQuizListItemClickListener(this);
        quizzesListView.setAdapter(quizzesListViewAdapter);

        View examButton = findViewById(R.id.examButton);
        examButton.setOnClickListener(this);
    }


    @Override
    public void onQuizClick(int index, int resId, boolean shouldRandomize) {
        Intent intent = new Intent(this, MainActivity.class);

        Quiz quizToLoad = quizzes.get(index);

        if (shouldRandomize) {
            quizToLoad.shuffleQuestions();
        }

        intent.putExtra(MainActivity.JSON_RES_ID_KEY, resId);
        intent.putExtra(MainActivity.QUIZ_JSON_KEY, quizToLoad.toJson().toString());
        intent.putExtra(MainActivity.SHOULD_RANDOMIZE_KEY, shouldRandomize);
        startActivity(intent);
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent(this, ExamConfigActivity.class);

        Quiz combinedQuiz = loader.getCombinedQuiz(quizzes);

        intent.putExtra(MainActivity.JSON_RES_ID_KEY, -1);
        intent.putExtra(MainActivity.QUIZ_JSON_KEY, combinedQuiz.toJson().toString());
        startActivity(intent);
    }
}

{'fraction_non_alphanumeric': 0.08795763297259959, 'fraction_numerical': 0.00046051116739580933, 'mean_word_length': 3.6559485530546625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2406211', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1208, 'n_words': 218}