Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".WordRecognition.WordRecogResult"></activity>
<activity android:name=".WordRecognition.WordRecogAns" />
<activity android:name=".WordRecognition.WordRecog" />
<activity android:name=".GuessingObjects.HighScoreActivity" />
<activity android:name=".GuessingObjects.StartImageGame" />
<activity android:name=".Constructional_Praxis.DrawingActivity" />
<activity android:name=".WordRecognition.WordRecogAns"></activity>
<activity android:name=".WordRecognition.WordRecognition" />
<activity android:name=".DelayedRecall.DelayedRecallResults" />
<activity android:name=".DelayedRecall.DelayedRecallAns" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import com.example.adas.SpeechComprehension.SpeechTask;
import com.example.adas.SpokenLanguage.SpokenLanguageActivity;
import com.example.adas.WordRecall.WordRecall;
import com.example.adas.WordRecognition.WordRecog;
import com.example.adas.WordRecognition.WordRecognition;


public class AssessmentLandingPageActivity extends AppCompatActivity {

Button btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn10, btn11,btn12;
Expand Down Expand Up @@ -89,20 +89,22 @@ private void setOnClickListeners() {
});


btn11.setOnClickListener(c ->{
navigateToActivity(WordRecog.class);


btn9.setOnClickListener(c ->{
navigateToActivity(IdeationalPraxisActivity.class);
});

btn11.setOnClickListener(view -> {
navigateToActivity(SpokenLanguageActivity.class);
});

btn12.setOnClickListener(c -> {
navigateToActivity(NumberCancellationActivity.class);
});

btn8.setOnClickListener(c ->{
navigateToActivity(WordRecognition.class);

});

}
Expand Down
66 changes: 66 additions & 0 deletions app/src/main/java/com/example/adas/WordRecognition/WordRecog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.example.adas.WordRecognition;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.adas.DelayedRecall.DelayedRecall;
import com.example.adas.DelayedRecall.DelayedRecallAns;
import com.example.adas.R;

import java.util.Random;

public class WordRecog extends AppCompatActivity {
TextView randtvWRC;
Button randbtnWRC;
private int count =0;


private String wordbank[] =
{
"COST",
"CHIMNEY",
"DAMAGES",
"SANDWICH",
"SOLUTION",
"TUBE",
"ENGINE",
"RICHES",
"GRAVITY",
"MEAL",
"PASSENGER",
"ACID"
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_word_recog);

randtvWRC = findViewById(R.id.randWordWRC);
randbtnWRC = findViewById(R.id.btn_generateWRC);

randbtnWRC.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

if (count != 12) {
Random random = new Random();
int num = random.nextInt(wordbank.length);
randtvWRC.setText(wordbank[num]);
count++;
} else {
Intent answerWR = new Intent(WordRecog.this, WordRecogAns.class);
startActivity(answerWR);
}
}

});
}

}


172 changes: 172 additions & 0 deletions app/src/main/java/com/example/adas/WordRecognition/WordRecogAns.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,188 @@

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;

import com.example.adas.DelayedRecall.DelayedRecallAns;
import com.example.adas.DelayedRecall.DelayedRecallResults;
import com.example.adas.R;

import java.util.ArrayList;

public class WordRecogAns extends AppCompatActivity {

ArrayList<String> selected = new ArrayList<String>();

Button sbmit;
TextView txt;
int count = 0, total = 0;

final String TAG = WordRecogAns.class.getSimpleName();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_word_recog_ans);


sbmit = findViewById(R.id.btnsub);
txt = findViewById(R.id.textView3);
txt.setEnabled(false);
System.out.println("TAG =" + TAG);

sbmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//finalAnswer(v);
Log.e(TAG, "running " + total);
Intent next = new Intent(WordRecogAns.this, DelayedRecallResults.class);
next.putExtra("COUNT", String.valueOf(total));
startActivity(next);
}
});


}

public void correctAns(View view) {
boolean checked = ((CheckBox) view).isChecked();
switch (view.getId()) {
//This is INCLUDED in the previous list
case R.id.checkBoxCost:
if (checked) {
selected.add("COST");
count++;
total = count + 0;
} else {
selected.remove("COST");
count--;
total = count + 0;
}
break;
//This is NOT included in the previous list
case R.id.checkBoxNation:
if (checked) {
selected.add("NATION");
count--;
total = count + 0;
} else {
selected.remove("NATION");
count++;
total = count + 0;
}
break;
//This is INCLUDED in the previous list
case R.id.checkBoxChimney:
if (checked) {
selected.add("CHIMNEY");
count++;
total = count + 0;
} else {
selected.remove("CHIMNEY");
count--;
total = count + 0;
}
break;
//This is NOT included in the previous list
case R.id.checkBoxSparrow:
if (checked) {
selected.add("SPARROW");
count--;
total = count + 0;
} else {
selected.remove("SPARROW");
count++;
total = count + 0;
}
break;
//This is INCLUDED in the previous list
case R.id.checkBoxDamages:
if (checked) {
selected.add("DAMAGES");
count++;
total = count + 0;
} else {
selected.remove("DAMAGES");
count--;
total = count + 0;
}
break;
//This is NOT included in the previous list
case R.id.checkBoxTraffic:
if (checked) {
selected.add("TRAFFIC");
count--;
total = count + 0;
} else {
selected.remove("TRAFFIC");
count++;
total = count + 0;
}
break;
//This is INCLUDED in the previous list
case R.id.checkBoxSandwich:
if (checked) {
selected.add("SANDWICH");
count++;
total = count + 0;
} else {
selected.remove("SANDWICH");
count--;
total = count + 0;
}
break;
//This is NOT included in the previous list
case R.id.checkBoxService:
if (checked) {
selected.add("SERVICE");
count--;
total = count + 0;
} else {
selected.remove("SERVICE");
count++;
total = count + 0;
}
break;
//This is NOT included in the previous list
case R.id.checkBoxShell:
if (checked) {
selected.add("SHELL");
count--;
total = count + 0;
} else {
selected.remove("SHELL");
count++;
total = count + 0;
}
break;
//This is INCLUDED in the previous list
case R.id.checkBoxSolutions:
if (checked) {
selected.add("SOLUTION");
count++;
total = count + 0;
} else {
selected.remove("SOLUTION");
count--;
total = count + 0;
}
break;
}


}
public void finalAnswer(View view){

String final_correct_ans = "Score:" + (total);
txt.setText(total);
txt.setEnabled(true);

}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.adas.WordRecognition;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

import com.example.adas.R;

public class WordRecogResult extends AppCompatActivity {

TextView tv1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_word_recog_result);tv1 = findViewById(R.id.trial1res);
tv1.setText(getIntent().getStringExtra("COUNT"));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
android:id="@+id/button_11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button11"
android:text="Word Recognition"
app:layout_constraintEnd_toStartOf="@+id/button_12"
app:layout_constraintStart_toEndOf="@+id/button_10"
app:layout_constraintTop_toTopOf="@+id/button_10" />
Expand Down
Loading