|
|
@@ -0,0 +1,92 @@
|
|
|
+// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
+
|
|
|
+#pragma once
|
|
|
+
|
|
|
+#include "CoreMinimal.h"
|
|
|
+#include "Kismet/BlueprintFunctionLibrary.h"
|
|
|
+#include "Dom/JsonObject.h"
|
|
|
+#include "MyBlueprintFunctionLibrary.generated.h"
|
|
|
+//#include <Runtime/Engine/Classes/GameFramework/GameState.h>
|
|
|
+
|
|
|
+
|
|
|
+typedef TSharedPtr<FJsonObject> JsonObjectPtr;
|
|
|
+/**
|
|
|
+ *
|
|
|
+ */
|
|
|
+UCLASS()
|
|
|
+class COMMUNICATION_ORG_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
|
|
|
+{
|
|
|
+ GENERATED_BODY()
|
|
|
+
|
|
|
+public:
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "UnixTimestamp")
|
|
|
+ static FDateTime UnixTimestampToDateTime(int64 UnixTime);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "UnixTimestamp")
|
|
|
+ static int64 DateTimeToUnixTimestamp(FDateTime DateTime);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString GetTempScoresStr(FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString CreateExamJson(FString UserID, FString ExamId, FString DataJsonStr);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString ParseExamIdFromCreateExam(FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString GetExamUsingId(FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString GetScoresStr(FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static TArray<int32> GetScores(FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static int64 GetStartTimestamp(FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString ParseAndGetScores(FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static int32 GetScore(FString RawDataJson, int32 ScoreIndex);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString SetScoreJson(FString RawDataJson, FString ExamId, FString UserID, int32 Score, int32 ScoreIndex);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString SetOtherScoreJson(FString UserID, FString ExamId, FString ScoresStr, TArray<int32> Scores);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FDateTime GetStartTime(FString RawDataJson, int32 ScoreIndex);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FDateTime GetExpectTime(FString RawDataJson, int32 ScoreIndex);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static bool IsOverTime(FString RawDataJson, int32 ScoreIndex);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString SetStartTimeJson(FString ScoresStr, FString ExamId, FString UserID, FDateTime StartTime, int32 ScoreIndex);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString SetEndTimeJson(FString ScoresStr, FString ExamId, FString UserID, FDateTime EndTime, int32 ScoreIndex);
|
|
|
+
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString SetScoreAndEndTimeJson(FString ScoresStr, FString ExamId, FString UserID, FDateTime EndTime, int32 Score, int32 ScoreIndex);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static bool IsSubmit(FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString GetSubmitJsonString(FString UserID, FString ProjectName, FString RawDataJson);
|
|
|
+
|
|
|
+ UFUNCTION(BlueprintPure, Category = "Json")
|
|
|
+ static FString GetRestartJsonString(FString UserID,FString RawDataJson);
|
|
|
+
|
|
|
+};
|