Commit e06d96d6 authored by Anuththara18's avatar Anuththara18

UI Modification Sustained Attention

parent 2db93eb2
...@@ -73,14 +73,14 @@ public class AlternatingAttentionGame1 extends AppCompatActivity { ...@@ -73,14 +73,14 @@ public class AlternatingAttentionGame1 extends AppCompatActivity {
R.drawable.waving_dog, R.drawable.waving_dog,
R.drawable.dancing_cat, R.drawable.dancing_cat,
R.drawable.walking_unicorn, R.drawable.walking_unicorn,
R.drawable.yellow_bird_gif}; R.drawable.yellow_baby_bird_gif};
Integer[] right_images = { R.drawable.dancing_star, Integer[] right_images = { R.drawable.dancing_star,
R.drawable.blowing_crab, R.drawable.blowing_crab,
R.drawable.swimming_fish, R.drawable.swimming_fish,
R.drawable.blue_fishy, R.drawable.blue_fishy,
R.drawable.brown_octopus, R.drawable.brown_octopus,
R.drawable.yellow_bird_gif}; R.drawable.yellow_baby_bird_gif};
//Integer[] sequence1 = { 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0}; //Integer[] sequence1 = { 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0};
......
...@@ -177,7 +177,9 @@ public class SA1CompleteScreen extends AppCompatActivity { ...@@ -177,7 +177,9 @@ public class SA1CompleteScreen extends AppCompatActivity {
try { try {
writer = new CSVWriter(new FileWriter(csv)); writer = new CSVWriter(new FileWriter(csv));
String[] entries = {"id","child_gender","child_age","total_correct_responses","correct_responses","commission_errors","omission_errors","mean_reaction_time","total_duration","diagnosis"}; String[] entries = {"id","child_gender","child_age",
"stimulus", "colour", "sequence_of_responses",
"total_correct_responses","correct_responses","commission_errors","omission_errors","mean_reaction_time","total_duration","diagnosis"};
writer.writeNext(entries); writer.writeNext(entries);
List<String[]> data = new ArrayList<String[]>(); List<String[]> data = new ArrayList<String[]>();
...@@ -188,6 +190,11 @@ public class SA1CompleteScreen extends AppCompatActivity { ...@@ -188,6 +190,11 @@ public class SA1CompleteScreen extends AppCompatActivity {
data.add(new String[]{ String.valueOf(gameData.getId()), data.add(new String[]{ String.valueOf(gameData.getId()),
String.valueOf(String.valueOf(gameData.getChildID()).charAt(0)), String.valueOf(String.valueOf(gameData.getChildID()).charAt(0)),
String.valueOf(String.valueOf(gameData.getChildID()).charAt(1)), String.valueOf(String.valueOf(gameData.getChildID()).charAt(1)),
String.valueOf(SustainedAttentionGame1.stimulus),
String.valueOf(SustainedAttentionGame1.colour),
String.valueOf("null"),
String.valueOf(gameData.getTotalCorrectResponses()), String.valueOf(gameData.getTotalCorrectResponses()),
String.valueOf(gameData.getNoOfCorrectResponses()), String.valueOf(gameData.getNoOfCorrectResponses()),
String.valueOf(gameData.getNoOfCommissionErrors()), String.valueOf(gameData.getNoOfCommissionErrors()),
......
...@@ -55,6 +55,7 @@ public class SustainedAttentionGame1 extends AppCompatActivity { ...@@ -55,6 +55,7 @@ public class SustainedAttentionGame1 extends AppCompatActivity {
1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000,
1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, }; 1000, 4500, 2500, 5000, 2000, 3500, 6000, 1500, 3000, 5500, 4000, };
/*
Integer[] image = { R.drawable.red_bird_gif, Integer[] image = { R.drawable.red_bird_gif,
R.drawable.blue_bird_gif, R.drawable.blue_bird_gif,
R.drawable.green_bird_gif, R.drawable.green_bird_gif,
...@@ -62,8 +63,13 @@ public class SustainedAttentionGame1 extends AppCompatActivity { ...@@ -62,8 +63,13 @@ public class SustainedAttentionGame1 extends AppCompatActivity {
R.drawable.blue_bird2_gif, R.drawable.blue_bird2_gif,
R.drawable.yellow_bird_gif}; R.drawable.yellow_bird_gif};
*/
int correctImage, clickedImage; int correctImage, clickedImage;
public static String stimulus, colour, sequence_of_responses = "";
Random random = new Random(); Random random = new Random();
int randomImage = 0; int randomImage = 0;
int i = 1; int i = 1;
...@@ -145,8 +151,34 @@ public class SustainedAttentionGame1 extends AppCompatActivity { ...@@ -145,8 +151,34 @@ public class SustainedAttentionGame1 extends AppCompatActivity {
bird.setVisibility(View.INVISIBLE); bird.setVisibility(View.INVISIBLE);
gifImageView.setVisibility(View.VISIBLE); gifImageView.setVisibility(View.VISIBLE);
bird.setEnabled(true); bird.setEnabled(true);
gifImageView.setImageResource(image[randomImage]);
clickedImage = image[randomImage]; if (BirdChoosingActivity.birdSelected == 1) {
gifImageView.setImageResource(R.drawable.blue_bird_gif);
clickedImage = 1;
stimulus = "bird";
colour = "blue";
}
else if (BirdChoosingActivity.birdSelected == 2) {
gifImageView.setImageResource(R.drawable.yellow_baby_bird_gif);
clickedImage = 2;
stimulus = "bird";
colour = "yellow";
}
else if (BirdChoosingActivity.birdSelected == 3) {
gifImageView.setImageResource(R.drawable.red_bird_gif);
clickedImage = 3;
stimulus = "bird";
colour = "red";
}
else if (BirdChoosingActivity.birdSelected == 4) {
gifImageView.setImageResource(R.drawable.pink_bird_gif);
clickedImage = 4;
stimulus = "bird";
colour = "pink";
}
//gifImageView.setImageResource(image[randomImage]);
//clickedImage = image[randomImage];
updateInterval = isi[j]; updateInterval = isi[j];
Log.d("radomTimer", String.valueOf(i + " " + updateInterval)); Log.d("radomTimer", String.valueOf(i + " " + updateInterval));
gifImageView.postDelayed(this, updateInterval); gifImageView.postDelayed(this, updateInterval);
...@@ -161,8 +193,8 @@ public class SustainedAttentionGame1 extends AppCompatActivity { ...@@ -161,8 +193,8 @@ public class SustainedAttentionGame1 extends AppCompatActivity {
bird.setVisibility(View.VISIBLE); bird.setVisibility(View.VISIBLE);
if (BirdChoosingActivity.birdSelected == 1) { if (BirdChoosingActivity.birdSelected == 1) {
bird.setImageResource(R.drawable.blue_bird); bird.setImageResource(R.drawable.bluey);
clickedImage = R.drawable.blue_bird; clickedImage = R.drawable.bluey;
} }
else if (BirdChoosingActivity.birdSelected == 2) { else if (BirdChoosingActivity.birdSelected == 2) {
Log.d("******************************", "start 2"); Log.d("******************************", "start 2");
......
...@@ -100,8 +100,9 @@ ...@@ -100,8 +100,9 @@
<ImageView <ImageView
android:layout_width="180dp" android:layout_width="180dp"
android:padding="10dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/twety" /> android:src="@drawable/yellow_bird" />
</LinearLayout> </LinearLayout>
...@@ -138,6 +139,7 @@ ...@@ -138,6 +139,7 @@
<ImageView <ImageView
android:layout_width="180dp" android:layout_width="180dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="15dp"
android:src="@drawable/red_angry_bird" /> android:src="@drawable/red_angry_bird" />
</LinearLayout> </LinearLayout>
...@@ -165,7 +167,7 @@ ...@@ -165,7 +167,7 @@
android:layout_width="180dp" android:layout_width="180dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp" android:padding="10dp"
android:src="@drawable/woody" /> android:src="@drawable/woody_bird" />
</LinearLayout> </LinearLayout>
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
<ImageView <ImageView
android:id="@+id/bird" android:id="@+id/bird"
android:layout_width="200dp" android:layout_width="175dp"
android:layout_height="200dp" android:layout_height="175dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497" app:layout_constraintHorizontal_bias="0.497"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment