-
-
Notifications
You must be signed in to change notification settings - Fork 71
feat: letter-sound assessment event #2195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
93f04d2
feat: assessment event
jo-elimu 6a53986
feat: letter-sound assessment event
jo-elimu 27de084
feat: letter-sound assessment events - dao
jo-elimu bfd07fa
test: add ui test for /analytics/students/<id>
jo-elimu 19e2d46
feat: export csv with assessment events
jo-elimu 7a9c508
Update LetterSoundAssessmentEventCsvExportController.java
jo-elimu c30663a
feat: rest api for letter-sound assessment events
jo-elimu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/ai/elimu/entity/analytics/AssessmentEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| package ai.elimu.entity.analytics; | ||
|
|
||
| import ai.elimu.entity.BaseEntity; | ||
| import ai.elimu.entity.application.Application; | ||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.ManyToOne; | ||
| import jakarta.persistence.MappedSuperclass; | ||
| import jakarta.persistence.Temporal; | ||
| import jakarta.persistence.TemporalType; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import java.util.Calendar; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| @MappedSuperclass | ||
| public abstract class AssessmentEvent extends BaseEntity { | ||
|
|
||
| @NotNull | ||
| @Temporal(TemporalType.TIMESTAMP) | ||
| private Calendar timestamp; | ||
|
|
||
| /** | ||
| * See https://developer.android.com/reference/android/provider/Settings.Secure#ANDROID_ID | ||
| */ | ||
| @NotNull | ||
| private String androidId; | ||
|
|
||
| /** | ||
| * The package name of the {@link #application} where the assessment event occurred. | ||
| * E.g. <code>ai.elimu.soundcards</code>. | ||
| */ | ||
| @NotNull | ||
| private String packageName; | ||
|
|
||
| /** | ||
| * This field will only be populated if a corresponding {@link Application} can be | ||
| * found in the database for the {@link #packageName}. | ||
| */ | ||
| @ManyToOne | ||
| private Application application; | ||
|
|
||
| /** | ||
| * Any additional data should be stored in the format of a JSON object. | ||
| * | ||
| * Example: | ||
| * <pre> | ||
| * {'word_ids_presented': [1,2,3], 'word_id_selected': 2} | ||
| * </pre> | ||
| */ | ||
| @Column(length = 1024) | ||
| private String additionalData; | ||
| } |
39 changes: 39 additions & 0 deletions
39
src/main/java/ai/elimu/entity/analytics/LetterSoundAssessmentEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package ai.elimu.entity.analytics; | ||
|
|
||
| import jakarta.persistence.Entity; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| @Entity | ||
| public class LetterSoundAssessmentEvent extends AssessmentEvent { | ||
|
|
||
| /** | ||
| * The sequence of letters. E.g. <code>["s", "h"]</code>. | ||
| */ | ||
| private String[] letterSoundLetters; | ||
|
|
||
| /** | ||
| * The sequence of sounds (IPA values). E.g. <code>["ʃ"]</code>. | ||
| */ | ||
| private String [] letterSoundSounds; | ||
|
|
||
| /** | ||
| * This field might not be included, e.g. if the assessment task was done in a | ||
| * 3rd-party app that did not load the content from the elimu.ai Content Provider. | ||
| * In this case, the {@link #letterSoundId} will be {@code null}. | ||
| */ | ||
| private Long letterSoundId; | ||
|
|
||
| /** | ||
| * A value in the range [0.0, 1.0]. | ||
| */ | ||
| private Float masteryScore; | ||
|
|
||
| /** | ||
| * The number of milliseconds passed between the student opening the assessment task | ||
| * and submitting a response. E.g. <code>15000</code>. | ||
| */ | ||
| private Long timeSpentMs; | ||
|
Comment on lines
+34
to
+38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add validation for time measurement. Consider adding validation to ensure +import jakarta.validation.constraints.Min;
/**
* The number of milliseconds passed between the student opening the assessment task
* and submitting a response. E.g. <code>15000</code>.
*/
+@Min(value = 0, message = "Time spent must be non-negative")
private Long timeSpentMs;
🤖 Prompt for AI Agents |
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add validation constraint for mastery score range.
The JavaDoc specifies a range [0.0, 1.0] but there's no validation to enforce this constraint.
🤖 Prompt for AI Agents