修改实验报告
This commit is contained in:
parent
cb23a56bb0
commit
a8f33794b0
@ -47,10 +47,16 @@ public class ScoreController : MonoSingleton<ScoreController>
|
||||
}
|
||||
|
||||
|
||||
public string GetModuleDictJson(string name = "")
|
||||
public string GetModuleDictJson(string name = "", string id = "", string sum = "")
|
||||
{
|
||||
var resultDict = new Dictionary<string, object>();
|
||||
DateTime curTime = DateTime.Now;
|
||||
resultDict.Add("name", name);
|
||||
resultDict.Add("id", id);
|
||||
resultDict.Add("sum", sum);
|
||||
resultDict.Add("time", curTime.ToString("yyyy.MM.dd"));
|
||||
resultDict.Add("year", curTime.Year);
|
||||
resultDict.Add("month", curTime.Month);
|
||||
foreach (var dataPair in moduleDict)
|
||||
{
|
||||
var data = dataPair.Value;
|
||||
@ -62,7 +68,12 @@ public class ScoreController : MonoSingleton<ScoreController>
|
||||
string key = $"{scoreStep.step}{scoreStep.name}";
|
||||
resultDict[key] = scoreStep.value;
|
||||
|
||||
resultDict.Add(key + "Time", string.IsNullOrEmpty(scoreStep.time) == true ? "" : scoreStep.time);
|
||||
string value = "\u00A0";
|
||||
if (string.IsNullOrEmpty(scoreStep.time) == false)
|
||||
{
|
||||
value = scoreStep.time;
|
||||
}
|
||||
resultDict.Add(key + "Time", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ namespace QFramework.Example
|
||||
|
||||
|
||||
|
||||
#if UNITY_WEBGL
|
||||
#if UNITY_WEBGL&&!UNITY_EDITOR
|
||||
ResLoader loader = ResLoader.Allocate();
|
||||
loader.Add2Load(Global.reportDemoPath.ToLocalBytesResName(), (success, res) =>
|
||||
{
|
||||
@ -45,7 +45,7 @@ namespace QFramework.Example
|
||||
}
|
||||
});
|
||||
loader.LoadAsync();
|
||||
#elif UNITY_STANDALONE_WIN
|
||||
#elif UNITY_STANDALONE_WIN||UNITY_EDITOR
|
||||
DownLoad.interactable = false;
|
||||
AsposeHelper.Writer(GetScoreDataJson(), () =>
|
||||
{
|
||||
@ -60,7 +60,7 @@ namespace QFramework.Example
|
||||
|
||||
public string GetScoreDataJson()
|
||||
{
|
||||
return ScoreController.Instance.GetModuleDictJson(InputName.text);
|
||||
return ScoreController.Instance.GetModuleDictJson(InputName.text, InputId.text, this.Sum.text);
|
||||
}
|
||||
|
||||
|
||||
@ -108,6 +108,7 @@ namespace QFramework.Example
|
||||
startTime = item.Value.time,
|
||||
endTime = item.Value.time,
|
||||
seq = seq,
|
||||
StepState = (int)item.Value.value == float.Parse(item.Value.sum) ? "全部正确" : "有错误"
|
||||
});
|
||||
seq++;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user