Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,11 @@
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- JSONObject -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Calendar;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.json.JSONObject;

/**
* Based on https://github.com/elimu-ai/webapp/blob/main/src/main/java/ai/elimu/entity/analytics/AssessmentEvent.java
Expand Down Expand Up @@ -48,7 +49,7 @@ public abstract class AssessmentEventGson extends BaseEntityGson {
* {'word_ids_presented': [1,2,3], 'word_id_selected': [2]}
* </pre>
*/
private String additionalData;
private JSONObject additionalData;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing import for JSONObject to fix compilation error.

The pipeline failure indicates that JSONObject cannot be resolved. For consistency with the LearningEventGson class and to leverage Gson's capabilities effectively, use JsonObject from Gson. This ensures robust data handling that supports elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months.

Add the appropriate import at the top of the file:

 import ai.elimu.model.v2.enums.analytics.AssessmentEventType;
 import ai.elimu.model.v2.gson.BaseEntityGson;
+import com.google.gson.JsonObject;
 import java.util.Calendar;

And update the field declaration:

-  private JSONObject additionalData;
+  private JsonObject additionalData;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private JSONObject additionalData;
// src/main/java/ai/elimu/model/v2/gson/analytics/AssessmentEventGson.java
import ai.elimu.model.v2.enums.analytics.AssessmentEventType;
import ai.elimu.model.v2.gson.BaseEntityGson;
import com.google.gson.JsonObject;
import java.util.Calendar;
public class AssessmentEventGson extends BaseEntityGson {
// … other fields …
private JsonObject additionalData;
// … rest of class …
}
🧰 Tools
🪛 GitHub Actions: Maven CI

[error] 12-51: Compilation error: cannot find symbol class JSONObject in AssessmentEventGson.java at lines 12 and 51.

🤖 Prompt for AI Agents
In src/main/java/ai/elimu/model/v2/gson/analytics/AssessmentEventGson.java at
line 51, the field additionalData is declared as JSONObject but the class
JSONObject is not imported, causing a compilation error. Replace JSONObject with
Gson's JsonObject for consistency and import com.google.gson.JsonObject at the
top of the file. Update the field declaration to use JsonObject instead of
JSONObject.


@Deprecated
private AssessmentEventType assessmentEventType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Calendar;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.json.JSONObject;

/**
* For documentation, see https://github.com/elimu-ai/webapp/tree/main/src/main/java/ai/elimu/entity
Expand All @@ -27,7 +28,7 @@ public abstract class LearningEventGson extends BaseEntityGson {
* {'spelling_consistency': 'HIGHLY_PHONEMIC'}
* </pre>
*/
private String additionalData;
private JSONObject additionalData;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing import for JSONObject to fix compilation error.

The pipeline failure indicates that JSONObject cannot be resolved. Since this class uses Gson (evident from the class name and existing imports), consider using JsonObject from Gson instead, which aligns better with elimu.ai's mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months by ensuring robust, type-safe data structures.

Add the appropriate import at the top of the file:

 import ai.elimu.model.v2.enums.analytics.LearningEventType;
 import ai.elimu.model.v2.gson.BaseEntityGson;
+import com.google.gson.JsonObject;
 import java.util.Calendar;

And update the field declaration:

-  private JSONObject additionalData;
+  private JsonObject additionalData;
🧰 Tools
🪛 GitHub Actions: Maven CI

[error] 12-30: Compilation error: cannot find symbol class JSONObject in LearningEventGson.java at lines 12 and 30.

🤖 Prompt for AI Agents
In src/main/java/ai/elimu/model/v2/gson/analytics/LearningEventGson.java at line
30, the field additionalData is declared as JSONObject but the class lacks the
necessary import, causing a compilation error. Replace the type JSONObject with
Gson's JsonObject to maintain consistency with the Gson usage in the class, then
add the import statement for com.google.gson.JsonObject at the top of the file.


@Deprecated
private LearningEventType learningEventType;
Expand Down