Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
Research-Project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jayakody J.A.D.K.A - IT19114040
Research-Project
Commits
39ddc7eb
Commit
39ddc7eb
authored
May 07, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding analysing factors - Focused Attention
parent
e06d96d6
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
202 additions
and
70 deletions
+202
-70
app/src/main/java/com/anuththara18/attentionassessment/focused/FACompleteScreen.java
...thara18/attentionassessment/focused/FACompleteScreen.java
+18
-12
app/src/main/java/com/anuththara18/attentionassessment/focused/Focused.java
...com/anuththara18/attentionassessment/focused/Focused.java
+73
-1
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame1.java
...18/attentionassessment/focused/FocusedAttentionGame1.java
+95
-55
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame2.java
...18/attentionassessment/focused/FocusedAttentionGame2.java
+16
-2
No files found.
app/src/main/java/com/anuththara18/attentionassessment/focused/FACompleteScreen.java
View file @
39ddc7eb
...
...
@@ -80,6 +80,7 @@ public class FACompleteScreen extends AppCompatActivity {
String
stimulus
;
String
colour
;
String
responses
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -158,12 +159,16 @@ public class FACompleteScreen extends AppCompatActivity {
dataList
.
add
(
new
Focused
(
cursorEmployees
.
getInt
(
0
),
cursorEmployees
.
getInt
(
1
),
cursorEmployees
.
get
Int
(
2
),
cursorEmployees
.
get
Int
(
3
),
cursorEmployees
.
get
Int
(
4
),
cursorEmployees
.
get
String
(
2
),
cursorEmployees
.
get
String
(
3
),
cursorEmployees
.
get
String
(
4
),
cursorEmployees
.
getInt
(
5
),
cursorEmployees
.
getInt
(
6
),
cursorEmployees
.
getInt
(
7
)
cursorEmployees
.
getInt
(
7
),
cursorEmployees
.
getInt
(
8
),
cursorEmployees
.
getInt
(
9
),
cursorEmployees
.
getInt
(
10
),
cursorEmployees
.
getString
(
11
)
));
}
while
(
cursorEmployees
.
moveToNext
());
}
...
...
@@ -191,14 +196,17 @@ public class FACompleteScreen extends AppCompatActivity {
if
(
Map1Activity
.
level
==
1
||
Map1Activity
.
level
==
2
)
{
stimulus
=
"bear head"
;
colour
=
"brown"
;
responses
=
String
.
valueOf
(
FocusedAttentionGame2
.
sequence_of_responses
);
}
else
if
(
Map1Activity
.
level
==
2
||
Map1Activity
.
level
==
3
)
{
else
if
(
Map1Activity
.
level
==
3
||
Map1Activity
.
level
==
4
)
{
stimulus
=
FocusedAttentionGame1
.
stimulus
;
colour
=
FocusedAttentionGame1
.
colour
;
responses
=
String
.
valueOf
(
FocusedAttentionGame1
.
sequence_of_responses
);
}
else
if
(
Map1Activity
.
level
==
5
)
{
stimulus
=
FocusedAttentionGame1
.
stimulus
;
colour
=
FocusedAttentionGame1
.
colour
;
responses
=
String
.
valueOf
(
FocusedAttentionGame1
.
sequence_of_responses
);
}
for
(
int
i
=
0
;
i
<
dataList
.
size
();
i
++)
{
...
...
@@ -207,19 +215,17 @@ public class FACompleteScreen extends AppCompatActivity {
data
.
add
(
new
String
[]{
String
.
valueOf
(
gameData
.
getId
()),
String
.
valueOf
(
String
.
valueOf
(
gameData
.
getChildID
()).
charAt
(
0
)),
String
.
valueOf
(
String
.
valueOf
(
gameData
.
getChildID
()).
charAt
(
1
)),
String
.
valueOf
(
Map1Activity
.
level
),
String
.
valueOf
(
stimulus
),
String
.
valueOf
(
colour
),
String
.
valueOf
(
"null"
),
String
.
valueOf
(
String
.
valueOf
(
gameData
.
getChildID
()).
charAt
(
2
)),
String
.
valueOf
(
gameData
.
getStimulus
()),
String
.
valueOf
(
gameData
.
getColour
()),
String
.
valueOf
(
gameData
.
getSequence_of_responses
()),
String
.
valueOf
(
gameData
.
getTotalCorrectResponses
()),
String
.
valueOf
(
gameData
.
getNoOfCorrectResponses
()),
String
.
valueOf
(
gameData
.
getNoOfCommissionErrors
()),
String
.
valueOf
(
gameData
.
getNoOfOmmissionErrors
()),
String
.
valueOf
(
gameData
.
getMeanReactionTime
()),
String
.
valueOf
(
gameData
.
getTotalDuration
()),
String
.
valueOf
(
ParentDetailsActivity
.
diagnosis
)
String
.
valueOf
(
gameData
.
getDiagnosis
()
)
});
}
...
...
app/src/main/java/com/anuththara18/attentionassessment/focused/Focused.java
View file @
39ddc7eb
...
...
@@ -4,56 +4,128 @@ public class Focused {
private
int
id
;
private
int
childID
;
private
String
stimulus
;
private
String
colour
;
private
String
sequence_of_responses
;
private
int
totalCorrectResponses
;
private
int
noOfCorrectResponses
;
private
int
noOfCommissionErrors
;
private
int
noOfOmmissionErrors
;
private
int
meanReactionTime
;
private
int
totalDuration
;
private
String
diagnosis
;
public
Focused
(
int
id
,
int
childID
,
int
totalCorrectResponses
,
int
noOfCorrectResponses
,
int
noOfCommissionErrors
,
int
noOfOmmissionErrors
,
int
meanReactionTime
,
int
totalDuration
)
{
public
Focused
(
int
id
,
int
childID
,
String
stimulus
,
String
colour
,
String
sequence_of_responses
,
int
totalCorrectResponses
,
int
noOfCorrectResponses
,
int
noOfCommissionErrors
,
int
noOfOmmissionErrors
,
int
meanReactionTime
,
int
totalDuration
,
String
diagnosis
)
{
this
.
id
=
id
;
this
.
childID
=
childID
;
this
.
stimulus
=
stimulus
;
this
.
colour
=
colour
;
this
.
sequence_of_responses
=
sequence_of_responses
;
this
.
totalCorrectResponses
=
totalCorrectResponses
;
this
.
noOfCorrectResponses
=
noOfCorrectResponses
;
this
.
noOfCommissionErrors
=
noOfCommissionErrors
;
this
.
noOfOmmissionErrors
=
noOfOmmissionErrors
;
this
.
meanReactionTime
=
meanReactionTime
;
this
.
totalDuration
=
totalDuration
;
this
.
diagnosis
=
diagnosis
;
}
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
int
getChildID
()
{
return
childID
;
}
public
void
setChildID
(
int
childID
)
{
this
.
childID
=
childID
;
}
public
String
getStimulus
()
{
return
stimulus
;
}
public
void
setStimulus
(
String
stimulus
)
{
this
.
stimulus
=
stimulus
;
}
public
String
getColour
()
{
return
colour
;
}
public
void
setColour
(
String
colour
)
{
this
.
colour
=
colour
;
}
public
String
getSequence_of_responses
()
{
return
sequence_of_responses
;
}
public
void
setSequence_of_responses
(
String
sequence_of_responses
)
{
this
.
sequence_of_responses
=
sequence_of_responses
;
}
public
int
getTotalCorrectResponses
()
{
return
totalCorrectResponses
;
}
public
void
setTotalCorrectResponses
(
int
totalCorrectResponses
)
{
this
.
totalCorrectResponses
=
totalCorrectResponses
;
}
public
int
getNoOfCorrectResponses
()
{
return
noOfCorrectResponses
;
}
public
void
setNoOfCorrectResponses
(
int
noOfCorrectResponses
)
{
this
.
noOfCorrectResponses
=
noOfCorrectResponses
;
}
public
int
getNoOfCommissionErrors
()
{
return
noOfCommissionErrors
;
}
public
void
setNoOfCommissionErrors
(
int
noOfCommissionErrors
)
{
this
.
noOfCommissionErrors
=
noOfCommissionErrors
;
}
public
int
getNoOfOmmissionErrors
()
{
return
noOfOmmissionErrors
;
}
public
void
setNoOfOmmissionErrors
(
int
noOfOmmissionErrors
)
{
this
.
noOfOmmissionErrors
=
noOfOmmissionErrors
;
}
public
int
getMeanReactionTime
()
{
return
meanReactionTime
;
}
public
void
setMeanReactionTime
(
int
meanReactionTime
)
{
this
.
meanReactionTime
=
meanReactionTime
;
}
public
int
getTotalDuration
()
{
return
totalDuration
;
}
public
void
setTotalDuration
(
int
totalDuration
)
{
this
.
totalDuration
=
totalDuration
;
}
public
String
getDiagnosis
()
{
return
diagnosis
;
}
public
void
setDiagnosis
(
String
diagnosis
)
{
this
.
diagnosis
=
diagnosis
;
}
/*
CREATE TABLE sustainedAttention (
id int NOT NULL AUTO_INCREMENT,
...
...
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame1.java
View file @
39ddc7eb
This diff is collapsed.
Click to expand it.
app/src/main/java/com/anuththara18/attentionassessment/focused/FocusedAttentionGame2.java
View file @
39ddc7eb
...
...
@@ -32,6 +32,7 @@ import com.anuththara18.attentionassessment.map.Map1Activity;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
...
...
@@ -52,6 +53,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
Random
random
=
new
Random
();
int
radomTimer
=
0
;
int
rand
=
0
;
int
missed
=
0
;
int
i
=
1
;
private
long
startTime
,
clickedTime
=
0
;
...
...
@@ -71,11 +73,12 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
String
clicked
=
"null"
;
public
static
ArrayList
<
String
>
sequence_of_responses
;
Integer
[]
isi
=
{
3000
,
3500
,
4000
,
4500
,
5000
,
5500
,
6000
};
MediaPlayer
mp
,
mp2
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -103,6 +106,8 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
mp
=
MediaPlayer
.
create
(
getApplicationContext
(),
R
.
raw
.
focused
);
mp
.
start
();
sequence_of_responses
=
new
ArrayList
<>();
mp
.
setOnCompletionListener
(
new
MediaPlayer
.
OnCompletionListener
()
{
@Override
...
...
@@ -140,6 +145,11 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
bear3
.
setEnabled
(
true
);
bear4
.
setEnabled
(
true
);
if
(
missed
==
0
)
{
sequence_of_responses
.
add
(
"M"
);
Log
.
d
(
"%%%%%%%%%%%%%%%%%%"
,
String
.
valueOf
(
sequence_of_responses
));
}
radomTimer
=
random
.
nextInt
(
5
);
updateInterval
=
isi
[
radomTimer
];
bear1
.
postDelayed
(
this
,
updateInterval
);
...
...
@@ -221,7 +231,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
Log
.
d
(
"commissionErrors"
,
String
.
valueOf
(
noOfCommissionErrors
));
Log
.
d
(
"meanReactionTime"
,
String
.
valueOf
(
meanReactionTime
));
Log
.
d
(
"duration"
,
String
.
valueOf
(
duration
));
saveDataToOnlineDB
();
//
saveDataToOnlineDB();
createTable
();
saveDataToLocalDB
();
if
(
Map1Activity
.
level
==
1
){
...
...
@@ -256,6 +266,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
totalReactionTime
=
totalReactionTime
+
reactionTime
;
Log
.
d
(
"correct "
,
startTime
+
" "
+
clickedTime
+
" "
+
reactionTime
);
noOfCorrectResponses
++;
sequence_of_responses
.
add
(
"C"
);
bear1
.
setEnabled
(
false
);
}
else
{
Log
.
d
(
"wrong"
,
startTime
+
" "
+
clickedTime
+
" "
+
reactionTime
);
...
...
@@ -277,6 +288,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
totalReactionTime
=
totalReactionTime
+
reactionTime
;
Log
.
d
(
"correct "
,
startTime
+
" "
+
clickedTime
+
" "
+
reactionTime
);
noOfCorrectResponses
++;
sequence_of_responses
.
add
(
"C"
);
bear2
.
setEnabled
(
false
);
}
else
{
Log
.
d
(
"wrong"
,
startTime
+
" "
+
clickedTime
+
" "
+
reactionTime
);
...
...
@@ -298,6 +310,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
totalReactionTime
=
totalReactionTime
+
reactionTime
;
Log
.
d
(
"correct "
,
startTime
+
" "
+
clickedTime
+
" "
+
reactionTime
);
noOfCorrectResponses
++;
sequence_of_responses
.
add
(
"C"
);
bear3
.
setEnabled
(
false
);
}
else
{
Log
.
d
(
"wrong"
,
startTime
+
" "
+
clickedTime
+
" "
+
reactionTime
);
...
...
@@ -320,6 +333,7 @@ public class FocusedAttentionGame2 extends AppCompatActivity {
totalReactionTime
=
totalReactionTime
+
reactionTime
;
Log
.
d
(
"correct "
,
startTime
+
" "
+
clickedTime
+
" "
+
reactionTime
);
noOfCorrectResponses
++;
sequence_of_responses
.
add
(
"C"
);
bear4
.
setEnabled
(
false
);
}
else
{
Log
.
d
(
"wrong"
,
startTime
+
" "
+
clickedTime
+
" "
+
reactionTime
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment