Skip to content

Commit 395edd9

Browse files
authored
Merge pull request #395 from elimu-ai/379-move-masteryscore-and-timespentms-to-parent-class
refactor: move masteryscore and timespentms to parent class
2 parents 91a6b3f + 27d1e50 commit 395edd9

9 files changed

+43
-24
lines changed

app/src/main/java/ai/elimu/analytics/entity/AssessmentEvent.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ abstract class AssessmentEvent : BaseEntity() {
1616

1717
lateinit var time: Calendar
1818

19+
/**
20+
* A value in the range [0.0, 1.0].
21+
*/
22+
var masteryScore: Float = -1f
23+
24+
/**
25+
* The number of milliseconds passed between the student opening the assessment task
26+
* and submitting a response. E.g. `15000`.
27+
*/
28+
var timeSpentMs: Long = 0L
29+
1930
/**
2031
* Any additional data should be stored in the format of a JSON object.
2132
*

app/src/main/java/ai/elimu/analytics/entity/LetterSoundAssessmentEvent.kt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,8 @@ class LetterSoundAssessmentEvent : AssessmentEvent() {
1818
lateinit var letterSoundSounds: String
1919

2020
/**
21-
* This field might not be included, e.g. if the assessment task was done in a
22-
* 3rd-party app that did not load the content from the elimu.ai Content Provider.
23-
* In this case, the `letterSoundId` will be `null`.
21+
* This field might not be included, e.g. if the event occurred in a 3rd-party app that did not
22+
* load the content from the elimu.ai Content Provider. In that case, this field will be {@code null}.
2423
*/
2524
var letterSoundId: Long? = null
26-
27-
/**
28-
* A value in the range [0.0, 1.0].
29-
*/
30-
var masteryScore: Float = 0f
31-
32-
/**
33-
* The number of milliseconds passed between the student opening the assessment task
34-
* and submitting a response. E.g. `15000`.
35-
*/
36-
var timeSpentMs: Long = 0L
3725
}

app/src/main/java/ai/elimu/analytics/entity/LetterSoundLearningEvent.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ import androidx.room.Entity
77
*/
88
@Entity
99
class LetterSoundLearningEvent : LearningEvent() {
10-
var letterSoundId: Long? = null
11-
1210
lateinit var letterSoundLetterTexts: Array<String>
1311

1412
lateinit var letterSoundSoundValuesIpa: Array<String>
13+
14+
/**
15+
* This field might not be included, e.g. if the event occurred in a 3rd-party app that did not
16+
* load the content from the elimu.ai Content Provider. In that case, this field will be {@code null}.
17+
*/
18+
var letterSoundId: Long? = null
1519
}

app/src/main/java/ai/elimu/analytics/entity/NumberAssessmentEvent.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import androidx.room.Entity
77
*/
88
@Entity
99
class NumberAssessmentEvent : AssessmentEvent() {
10-
var masteryScore: Float = -1f
11-
12-
var timeSpentMs: Long = 0
13-
1410
var numberValue: Int = Int.MIN_VALUE
1511

1612
// TODO: numberSymbol
1713

14+
/**
15+
* This field might not be included, e.g. if the event occurred in a 3rd-party app that did not
16+
* load the content from the elimu.ai Content Provider. In that case, this field will be {@code null}.
17+
*/
1818
var numberId: Long? = null
1919
}

app/src/main/java/ai/elimu/analytics/entity/NumberLearningEvent.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ class NumberLearningEvent (val numberValue: Int) : LearningEvent() {
1212

1313
var numberSymbol: String? = null
1414

15+
/**
16+
* This field might not be included, e.g. if the event occurred in a 3rd-party app that did not
17+
* load the content from the elimu.ai Content Provider. In that case, this field will be {@code null}.
18+
*/
1519
var numberId: Long? = null
1620

1721
@Deprecated("Will be replaced by `additionalData`")

app/src/main/java/ai/elimu/analytics/entity/StoryBookLearningEvent.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import androidx.room.Entity
1010
class StoryBookLearningEvent : LearningEvent() {
1111
lateinit var storyBookTitle: String
1212

13+
/**
14+
* This field might not be included, e.g. if the event occurred in a 3rd-party app that did not
15+
* load the content from the elimu.ai Content Provider. In that case, this field will be {@code null}.
16+
*/
1317
var storyBookId: Long = 0L
1418

1519
@Deprecated("Will be replaced by `additionalData`")

app/src/main/java/ai/elimu/analytics/entity/VideoLearningEvent.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import androidx.room.Entity
1010
class VideoLearningEvent : LearningEvent() {
1111
lateinit var videoTitle: String
1212

13+
/**
14+
* This field might not be included, e.g. if the event occurred in a 3rd-party app that did not
15+
* load the content from the elimu.ai Content Provider. In that case, this field will be {@code null}.
16+
*/
1317
var videoId: Long? = null
1418

1519
@Deprecated("Will be replaced by `additionalData`")

app/src/main/java/ai/elimu/analytics/entity/WordAssessmentEvent.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import androidx.room.Entity
99
class WordAssessmentEvent : AssessmentEvent() {
1010
lateinit var wordText: String
1111

12+
/**
13+
* This field might not be included, e.g. if the event occurred in a 3rd-party app that did not
14+
* load the content from the elimu.ai Content Provider. In that case, this field will be {@code null}.
15+
*/
1216
var wordId: Long? = null
13-
14-
var masteryScore: Float = 0f
15-
16-
var timeSpentMs: Long = 0L
1717
}

app/src/main/java/ai/elimu/analytics/entity/WordLearningEvent.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import androidx.room.Entity
1010
class WordLearningEvent : LearningEvent() {
1111
lateinit var wordText: String
1212

13+
/**
14+
* This field might not be included, e.g. if the learning was done in a 3rd-party app that did
15+
* not load the content from the elimu.ai Content Provider. In that case, this field will be {@code null}.
16+
*/
1317
var wordId: Long? = null
1418

1519
@Deprecated("Will be replaced by `additionalData`")

0 commit comments

Comments
 (0)