<commit_before>package edu.pdx.oss.asthmacontrol;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;

public class ScoreActivity extends AppCompatActivity {
    EditText DAYS_ASTHMA_TIME_TEXT, SCORE_ASTHMA_TIME_TEXT, DAYS_ASTHMA_BREATH_TEXT, SCORE_ASTHMA_BREATH_TEXT,  DAYS_ASTHMA_SYMPTOMS_TEXT, SCORE_ASTHMA_SYMPTOMS_TEXT;
    Context ctx = this;
    Integer numberOfDays;
    Integer score;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_score);
        DatabaseOperations dop = new DatabaseOperations(ctx);

        DAYS_ASTHMA_TIME_TEXT = (EditText) findViewById(R.id.daysText1);
        SCORE_ASTHMA_TIME_TEXT = (EditText) findViewById(R.id.scoreText1);
        DAYS_ASTHMA_BREATH_TEXT = (EditText) findViewById(R.id.daysText2);
        SCORE_ASTHMA_BREATH_TEXT = (EditText) findViewById(R.id.scoreText2);
        DAYS_ASTHMA_SYMPTOMS_TEXT = (EditText) findViewById(R.id.daysText3);
        SCORE_ASTHMA_SYMPTOMS_TEXT = (EditText) findViewById(R.id.scoreText3);

        numberOfDays = dop.getNumberOfDaysFromAsthmaTime(dop);
        DAYS_ASTHMA_TIME_TEXT.setText(numberOfDays.toString());
        score = getScoreFromAsthmaTime();
        SCORE_ASTHMA_TIME_TEXT.setText(score.toString());

        numberOfDays = dop.getNumberOfDaysFromAsthmaBreath(dop);
        DAYS_ASTHMA_BREATH_TEXT.setText(numberOfDays.toString());
        score = getScoreFromAsthmaBreath();
        SCORE_ASTHMA_BREATH_TEXT.setText(score.toString());

        numberOfDays = dop.getNumberOfDaysFromAsthmaSymptoms(dop);
        DAYS_ASTHMA_SYMPTOMS_TEXT.setText(numberOfDays.toString());


    }

    public Integer getScoreFromAsthmaTime(){
       if (numberOfDays == 28)
           score = 1;
       else if ((numberOfDays >=22) && (numberOfDays<=27))
           score = 2;
       else if ((numberOfDays >=8) && (numberOfDays<=21))
           score = 3;
       else if ((numberOfDays >=1) && (numberOfDays<=20))
           score = 4;
       else
           score = 1;

       return score;
    }

    public Integer getScoreFromAsthmaBreath(){
        if (numberOfDays == 28)
            score = 1;
        else if ((numberOfDays >=9) && (numberOfDays<=27))
            score = 3;
        else if ((numberOfDays >=1) && (numberOfDays<=8))
            score = 4;
        else
            score = 5;

        return score;
    }


}
<commit_msg>Add a method for returning a score based on when symptoms (wheezing, coughing, shortness of breath, chest tightness, or pain) wake the patient up at night or earlier than usual in the morning<commit_after>package edu.pdx.oss.asthmacontrol;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;

public class ScoreActivity extends AppCompatActivity {
    EditText DAYS_ASTHMA_TIME_TEXT, SCORE_ASTHMA_TIME_TEXT, DAYS_ASTHMA_BREATH_TEXT, SCORE_ASTHMA_BREATH_TEXT,  DAYS_ASTHMA_SYMPTOMS_TEXT, SCORE_ASTHMA_SYMPTOMS_TEXT;
    Context ctx = this;
    Integer numberOfDays;
    Integer score;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_score);
        DatabaseOperations dop = new DatabaseOperations(ctx);

        DAYS_ASTHMA_TIME_TEXT = (EditText) findViewById(R.id.daysText1);
        SCORE_ASTHMA_TIME_TEXT = (EditText) findViewById(R.id.scoreText1);
        DAYS_ASTHMA_BREATH_TEXT = (EditText) findViewById(R.id.daysText2);
        SCORE_ASTHMA_BREATH_TEXT = (EditText) findViewById(R.id.scoreText2);
        DAYS_ASTHMA_SYMPTOMS_TEXT = (EditText) findViewById(R.id.daysText3);
        SCORE_ASTHMA_SYMPTOMS_TEXT = (EditText) findViewById(R.id.scoreText3);

        numberOfDays = dop.getNumberOfDaysFromAsthmaTime(dop);
        DAYS_ASTHMA_TIME_TEXT.setText(numberOfDays.toString());
        score = getScoreFromAsthmaTime();
        SCORE_ASTHMA_TIME_TEXT.setText(score.toString());

        numberOfDays = dop.getNumberOfDaysFromAsthmaBreath(dop);
        DAYS_ASTHMA_BREATH_TEXT.setText(numberOfDays.toString());
        score = getScoreFromAsthmaBreath();
        SCORE_ASTHMA_BREATH_TEXT.setText(score.toString());

        numberOfDays = dop.getNumberOfDaysFromAsthmaSymptoms(dop);
        DAYS_ASTHMA_SYMPTOMS_TEXT.setText(numberOfDays.toString());
        score = getScoreFromAsthmaSymptoms();
        SCORE_ASTHMA_SYMPTOMS_TEXT.setText(score.toString());


    }

    public Integer getScoreFromAsthmaTime(){
       if (numberOfDays == 28)
           score = 1;
       else if ((numberOfDays >=22) && (numberOfDays<=27))
           score = 2;
       else if ((numberOfDays >=8) && (numberOfDays<=21))
           score = 3;
       else if ((numberOfDays >=1) && (numberOfDays<=20))
           score = 4;
       else
           score = 5;

       return score;
    }

    public Integer getScoreFromAsthmaBreath(){
        if (numberOfDays == 28)
            score = 1;
        else if ((numberOfDays >=9) && (numberOfDays<=27))
            score = 3;
        else if ((numberOfDays >=1) && (numberOfDays<=8))
            score = 4;
        else
            score = 5;

        return score;
    }

    public Integer getScoreFromAsthmaSymptoms (){
        if ((numberOfDays >=16) && (numberOfDays<=28))
            score = 1;
        else if ((numberOfDays >=7) && (numberOfDays<=15))
            score = 2;
        else if ((numberOfDays >=3) && (numberOfDays<=6))
            score = 3;
        else if ((numberOfDays >=1) && (numberOfDays<=2))
            score = 4;
        else
            score = 5;

        return score;
    }



}

{'fraction_non_alphanumeric': 0.10154219372725698, 'fraction_numerical': 0.014902096690348293, 'mean_word_length': 3.0251046025104604, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '2559643', 'n_tokens_mistral': 2030, 'n_tokens_neox': 1835, 'n_words': 338}