Skip to content

Commit

Permalink
add textcontent if usertext exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Yinnii committed Apr 15, 2024
1 parent 76994f1 commit 7e0ca16
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ public void run() {
System.out.println("Upload text");

try {
System.out.println("UserText is: ", userTexts);
// Store usertext with label
String wordspec = body.getWordSpec();
String fileName = createFileName(label1, body.getType());
Expand All @@ -463,11 +464,17 @@ public void run() {
ObjectId graphFileId = storeLocalFileRemote("comparison_" + label1 + "_vs_" + label2 + ".json",body.getTopic()+"-graph.json");

newText.put("userId", label1);
newText.put("studentInput", body.getText());

if (userTexts!=null) {
newText.put("studentInput", userTexts.get(label1));
} else {
newText.put("studentInput", body.getText());
}

newText.put("taskNr", courseAndTask[1]);
newText.put("timestamp", System.currentTimeMillis());
System.out.println("New Text is:" + newText);

try {
// get keywords from file
MongoDatabase database = mongoClient.getDatabase(mongoDB);
Expand Down

0 comments on commit 7e0ca16

Please sign in to comment.