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
5ae42c2c
Commit
5ae42c2c
authored
Mar 07, 2022
by
Anuththara18
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Selective Attention - Total Duration Recalculation
parent
f2879e78
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
42 deletions
+14
-42
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+4
-4
app/src/main/java/com/anuththara18/attentionassessment/dividedattention/DividedAttentionGame1.java
...ionassessment/dividedattention/DividedAttentionGame1.java
+0
-1
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveAttentionGame1.java
...ttentionassessment/selective/SelectiveAttentionGame1.java
+9
-36
app/src/main/res/values-si/strings(si).xml
app/src/main/res/values-si/strings(si).xml
+1
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
5ae42c2c
...
...
@@ -114,11 +114,7 @@
android:name=
".dividedattention.DividedAttentionGame1"
android:screenOrientation=
"portrait"
android:theme=
"@style/Theme.AppCompat.NoActionBar"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".sustained.SustainedAttentionGame1"
...
...
@@ -181,7 +177,11 @@
android:name=
".splashscreen.SplashActivity"
android:screenOrientation=
"landscape"
android:theme=
"@style/Theme.AppCompat.NoActionBar"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
</application>
...
...
app/src/main/java/com/anuththara18/attentionassessment/dividedattention/DividedAttentionGame1.java
View file @
5ae42c2c
...
...
@@ -105,7 +105,6 @@ public class DividedAttentionGame1 extends AppCompatActivity {
mDatabase
=
openOrCreateDatabase
(
DATABASE_NAME
,
MODE_PRIVATE
,
null
);
totalCorrectResponses
=
8
;
AgeActivity
.
age
=
4
;
new
Runnable
()
{
...
...
app/src/main/java/com/anuththara18/attentionassessment/selective/SelectiveAttentionGame1.java
View file @
5ae42c2c
...
...
@@ -87,6 +87,7 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
int
age
=
AgeActivity
.
age
;
int
level
=
Map2Activity
.
level
;
Random
random
;
long
gameEnd
;
MediaPlayer
mp
;
int
clickCount
=
0
;
...
...
@@ -114,6 +115,9 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
mp
=
MediaPlayer
.
create
(
getApplicationContext
(),
R
.
raw
.
selective
);
mp
.
start
();
long
gameStart
=
System
.
currentTimeMillis
();
Log
.
d
(
"startTime"
,
String
.
valueOf
(
gameStart
));
//creating a database
mDatabase
=
openOrCreateDatabase
(
DATABASE_NAME
,
MODE_PRIVATE
,
null
);
...
...
@@ -395,22 +399,19 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
if
(
clickCount
==
0
)
{
try
{
calendar
=
Calendar
.
getInstance
();
simpleDateFormat
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
endDate
=
simpleDateFormat
.
parse
(
String
.
valueOf
(
simpleDateFormat
.
format
(
calendar
.
getTime
())));
Log
.
d
(
"endTime"
,
String
.
valueOf
(
simpleDateFormat
.
format
(
calendar
.
getTime
())));
}
catch
(
ParseException
parseException
)
{
gameEnd
=
System
.
currentTimeMillis
();
Log
.
d
(
"endTime"
,
String
.
valueOf
(
gameEnd
));
}
catch
(
Exception
parseException
)
{
parseException
.
printStackTrace
();
}
completionTime
=
gameEnd
-
gameStart
;
// missed clicks
noOfOmmissionErrors
=
totalCorrectResponses
-
noOfCorrectResponses
;
Log
.
d
(
"total"
,
String
.
valueOf
(
totalCorrectResponses
));
Log
.
d
(
"correctResponses"
,
String
.
valueOf
(
noOfCorrectResponses
));
Log
.
d
(
"omissionErrors"
,
String
.
valueOf
(
totalCorrectResponses
-
noOfCorrectResponses
));
Log
.
d
(
"commissionErrors"
,
String
.
valueOf
(
noOfCommissionErrors
));
Log
.
d
(
"duration"
,
String
.
valueOf
(
getCompletionTime
()));
completionTime
=
getCompletionTime
();
Log
.
d
(
"duration"
,
String
.
valueOf
(
completionTime
));
GVAdapter2
adapter
=
new
GVAdapter2
(
getApplicationContext
(),
gridModelArrayList
);
gridView
.
setAdapter
(
adapter
);
...
...
@@ -689,34 +690,6 @@ public class SelectiveAttentionGame1 extends AppCompatActivity {
/*************************************************************************************************/
public
long
getCompletionTime
()
{
long
difference
=
0
;
try
{
difference
=
endDate
.
getTime
()
-
startDate
.
getTime
();
if
(
difference
<
0
)
{
Date
dateMax
=
simpleDateFormat
.
parse
(
"24:00:00"
);
Date
dateMin
=
simpleDateFormat
.
parse
(
"00:00:00"
);
difference
=(
dateMax
.
getTime
()
-
startDate
.
getTime
()
)+(
endDate
.
getTime
()-
dateMin
.
getTime
());
}
int
days
=
(
int
)
(
difference
/
(
1000
*
60
*
60
*
24
));
int
hours
=
(
int
)
((
difference
-
(
1000
*
60
*
60
*
24
*
days
))
/
(
1000
*
60
*
60
));
int
min
=
(
int
)
(
difference
-
(
1000
*
60
*
60
*
24
*
days
)
-
(
1000
*
60
*
60
*
hours
))
/
(
1000
*
60
);
int
sec
=
(
int
)
(
difference
-
(
1000
*
60
*
60
*
24
*
days
)
-
(
1000
*
60
*
60
*
hours
)
-
(
1000
*
60
*
min
))
/
(
1000
);
Log
.
i
(
"log_tag"
,
"Hours: "
+
hours
+
", Mins: "
+
min
+
", Secs: "
+
sec
+
"diff: "
+
difference
);
completionTime
=
difference
;
}
catch
(
ParseException
parseException
)
{
parseException
.
printStackTrace
();
}
return
difference
;
}
/*************************************************************************************************/
private
void
saveDataToOnlineDB
()
{
String
child
=
String
.
valueOf
(
GenderActivity
.
gender
)
+
String
.
valueOf
(
AgeActivity
.
age
)
+
String
.
valueOf
(
Map2Activity
.
level
);
...
...
app/src/main/res/values-si/strings(si).xml
View file @
5ae42c2c
...
...
@@ -24,7 +24,7 @@
<string
name=
"birdselect"
>
ඔබ වඩාත්ම කැමති චරිතය තෝරන්න
</string>
<string
name=
"focg1"
>
වඳුරු පැටවා දිස්වන විට රතු බොත්තම ඔබන්න
</string>
<string
name=
"divg1"
>
වර්ණ ගැලපෙන විට රතු බොත්තම ඔබන්න
</string>
<string
name=
"divg2"
>
Press the red button when the animals match
</string>
<string
name=
"divg2"
>
සතුන් ගැලපෙන විට රතු බොත්තම ඔබන්න
</string>
<string
name=
"susg1"
>
කුරුල්ලා අත්ත මත වාඩි වූ විට රතු බොත්තම ඔබන්න
</string>
<string
name=
"altg1"
>
සතා පෙනෙන පැත්තේ ඇති රතු බොත්තම ඔබන්න
</string>
...
...
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