Skip to content

Commit c474883

Browse files
committed
feat(orm): add entity for number assessment events
#2236
1 parent fcf0726 commit c474883

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package ai.elimu.entity.analytics;
2+
3+
import jakarta.persistence.Entity;
4+
import jakarta.validation.constraints.NotNull;
5+
import lombok.Getter;
6+
import lombok.Setter;
7+
8+
@Getter
9+
@Setter
10+
@Entity
11+
public class NumberAssessmentEvent extends AssessmentEvent {
12+
13+
/**
14+
* The number represented as an Integer. E.g. <code>10</code>.
15+
*/
16+
@NotNull
17+
private Integer numberValue;
18+
19+
/**
20+
* The number represented as a symbol specific to the language. E.g. <code>"१०"</code>.
21+
*/
22+
private String numberSymbol;
23+
24+
/**
25+
* This field might not be included, e.g. if the assessment task was done in a
26+
* 3rd-party app that did not load the content from the elimu.ai Content Provider.
27+
* In that case, this field will be {@code null}.
28+
*/
29+
private Long numberId;
30+
}

src/main/resources/META-INF/jpa-schema-export.sql

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555

5656
drop table if exists Number_Word;
5757

58+
drop table if exists NumberAssessmentEvent;
59+
5860
drop table if exists NumberContributionEvent;
5961

6062
drop table if exists NumberLearningEvent;
@@ -377,6 +379,23 @@
377379
primary key (Number_id, words_ORDER)
378380
) type=MyISAM;
379381

382+
create table NumberAssessmentEvent (
383+
id bigint not null auto_increment,
384+
additionalData text,
385+
androidId varchar(255),
386+
experimentGroup smallint,
387+
masteryScore float(23),
388+
packageName varchar(255),
389+
researchExperiment smallint,
390+
timeSpentMs bigint,
391+
timestamp datetime,
392+
numberId bigint,
393+
numberSymbol varchar(255),
394+
numberValue integer,
395+
application_id bigint,
396+
primary key (id)
397+
) type=MyISAM;
398+
380399
create table NumberContributionEvent (
381400
id bigint not null auto_increment,
382401
comment text,
@@ -863,6 +882,11 @@
863882
foreign key (Number_id)
864883
references Number (id);
865884

885+
alter table NumberAssessmentEvent
886+
add constraint FKec7ikjyqnxjnkcmjfcv9iy67r
887+
foreign key (application_id)
888+
references Application (id);
889+
866890
alter table NumberContributionEvent
867891
add constraint FK8tr84kkqmavan1jxfmc1pq8h6
868892
foreign key (contributor_id)

0 commit comments

Comments
 (0)