diff --git a/Assets/Script/Excel/ExcelManager.cs b/Assets/Script/Excel/ExcelManager.cs index 1eb62f6..5c58df6 100644 --- a/Assets/Script/Excel/ExcelManager.cs +++ b/Assets/Script/Excel/ExcelManager.cs @@ -70,6 +70,11 @@ public class ExcelManager : SingleManager } } + public void Remove_Player_Info(string id) + { + _playerData.Remove(id); + } + #region 存入内容并导出Excel文件 public void SaveAndExp(SaveExcelData data) // 目前弃用了 diff --git a/Assets/Script/Excel/Read/Player_Data.cs b/Assets/Script/Excel/Read/Player_Data.cs index d1944fc..289af5c 100644 --- a/Assets/Script/Excel/Read/Player_Data.cs +++ b/Assets/Script/Excel/Read/Player_Data.cs @@ -28,6 +28,25 @@ namespace ZXL.Excel // } } + public Player_DataInfo Remove(string id) + { + Player_DataInfo info = null; + if (_list.Count > 0) + { + for (var index = 0; index < _list.Count; index++) + { + var playerDataInfo = _list[index]; + if (playerDataInfo.id == id) + { + info = playerDataInfo; + _list.Remove(playerDataInfo); + } + } + } + + return info; + } + public Player_DataInfo GetAndRemove() { Player_DataInfo info = null; diff --git a/Assets/Script/File/FileManager.cs b/Assets/Script/File/FileManager.cs index 29888ce..86b79c1 100644 --- a/Assets/Script/File/FileManager.cs +++ b/Assets/Script/File/FileManager.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using Script.UI; using UnityEngine; using ZXL.ID; @@ -23,6 +24,7 @@ namespace Script // cache private string cachePath; + private string cachePlayerPath; public FileManager() { @@ -47,6 +49,13 @@ namespace Script fileStream.Dispose(); } + cachePlayerPath = Application.streamingAssetsPath + "/Cache/cachePlayer.txt"; + if (!File.Exists(cachePlayerPath)) + { + var fileStream = File.Create(cachePlayerPath); + fileStream.Dispose(); + } + // cacheBPath = Application.streamingAssetsPath + "/Cache/cache.txt"; // if (!File.Exists(cacheBPath)) // { @@ -80,6 +89,9 @@ namespace Script dic.Add(questionBankType, new List() { strings[1] }); } + string[] cachePlayer = File.ReadAllLines(cachePlayerPath); + + GlobalManager.Instance.playerIDs = cachePlayer.ToList(); GlobalManager.Instance.questionIDs = dic; } @@ -102,11 +114,25 @@ namespace Script File.WriteAllText(cachePath, s); else File.WriteAllText(cachePath, text + "\n" + s); + + ExcelManager.Instance.Remove_ABCD_Info(questionBankType, content); + } + + public void SavePlayerCacheData(string id) + { + var text = File.ReadAllText(cachePlayerPath); + if (text == "") + File.WriteAllText(cachePlayerPath, id); + else + File.WriteAllText(cachePlayerPath, text + "\n" + id); + + ExcelManager.Instance.Remove_Player_Info(id); } public void ClearAnsweredData() { File.WriteAllText(cachePath, ""); + File.WriteAllText(cachePlayerPath, ""); } public enum QuestionBankType diff --git a/Assets/Script/File/GlobalManager.cs b/Assets/Script/File/GlobalManager.cs index 350ee16..b7f1722 100644 --- a/Assets/Script/File/GlobalManager.cs +++ b/Assets/Script/File/GlobalManager.cs @@ -21,6 +21,8 @@ namespace Script /// public Dictionary> questionIDs = new Dictionary>(); + public List playerIDs = new List(); + public GlobalManager() { saveData = new SaveData(); diff --git a/Assets/Script/UI/Panel/AnsweringPanel.cs b/Assets/Script/UI/Panel/AnsweringPanel.cs index 9713c29..59d137a 100644 --- a/Assets/Script/UI/Panel/AnsweringPanel.cs +++ b/Assets/Script/UI/Panel/AnsweringPanel.cs @@ -83,6 +83,7 @@ namespace Script.UI FileManager.Instance.SaveAnsweredData(FileManager.QuestionBankType.C, _cDataInfos[0].id); FileManager.Instance.SaveAnsweredData(FileManager.QuestionBankType.C, _cDataInfos[1].id); FileManager.Instance.SaveAnsweredData(FileManager.QuestionBankType.D, _dDataInfos[0].id); + FileManager.Instance.SavePlayerCacheData(GlobalManager.Instance.CurrentInfo.id); _rightQuestionItems[0].SetData( 0, diff --git a/Assets/Script/UI/Panel/HomePanel.cs b/Assets/Script/UI/Panel/HomePanel.cs index 4dc17ab..3c3baef 100644 --- a/Assets/Script/UI/Panel/HomePanel.cs +++ b/Assets/Script/UI/Panel/HomePanel.cs @@ -35,8 +35,31 @@ namespace Script.UI public override void ResetPanelData() { base.ResetPanelData(); + txt_Title.text = FileManager.Instance.GetTitle.title; + if (isFirst) + { + var questionBankTypes = GlobalManager.Instance.questionIDs.Keys.ToList(); + + for (var i = 0; i < questionBankTypes.Count; i++) + { + var instanceQuestionID = GlobalManager.Instance.questionIDs[questionBankTypes[i]]; + for (var i1 = 0; i1 < instanceQuestionID.Count; i1++) + { + ExcelManager.Instance.Remove_ABCD_Info(questionBankTypes[i], instanceQuestionID[i1]); + } + } + + for (var i = 0; i < GlobalManager.Instance.playerIDs.Count; i++) + { + var playerID = GlobalManager.Instance.playerIDs[i]; + ExcelManager.Instance.Remove_Player_Info(playerID); + } + + isFirst = false; + } + var dataInfo = ExcelManager.Instance.GetPlayerInfo; if (dataInfo == null) { @@ -53,22 +76,6 @@ namespace Script.UI // info.subject = FileManager.Instance.GetTitle.subject; // GlobalManager.Instance.summaryInfo = info; GlobalManager.Instance.AddInfo(int.Parse(dataInfo.id), FileManager.Instance.GetTitle.title, FileManager.Instance.GetTitle.subject); - - if (isFirst) - { - var questionBankTypes = GlobalManager.Instance.questionIDs.Keys.ToList(); - - for (var i = 0; i < questionBankTypes.Count; i++) - { - var instanceQuestionID = GlobalManager.Instance.questionIDs[questionBankTypes[i]]; - for (var i1 = 0; i1 < instanceQuestionID.Count; i1++) - { - ExcelManager.Instance.Remove_ABCD_Info(questionBankTypes[i], instanceQuestionID[i1]); - } - } - - isFirst = false; - } } private void ClickEnter() diff --git a/Assets/StreamingAssets/Cache/cache.txt b/Assets/StreamingAssets/Cache/cache.txt index e69de29..b900a15 100644 --- a/Assets/StreamingAssets/Cache/cache.txt +++ b/Assets/StreamingAssets/Cache/cache.txt @@ -0,0 +1,5 @@ +A:348 +B:68 +C:235 +C:294 +D:122 \ No newline at end of file diff --git a/Assets/StreamingAssets/Cache/cachePlayer.txt b/Assets/StreamingAssets/Cache/cachePlayer.txt new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/Assets/StreamingAssets/Cache/cachePlayer.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/Assets/StreamingAssets/Cache/cachePlayer.txt.meta b/Assets/StreamingAssets/Cache/cachePlayer.txt.meta new file mode 100644 index 0000000..525c247 --- /dev/null +++ b/Assets/StreamingAssets/Cache/cachePlayer.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2d8547c29ba009547a9617fda4d769ac +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-1031096937.txt b/Assets/StreamingAssets/TXT/data-1031096937.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-1031096937.txt.meta b/Assets/StreamingAssets/TXT/data-1031096937.txt.meta new file mode 100644 index 0000000..d8778af --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-1031096937.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bd021aafdb89d724091543f546d4774a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-1145992048.txt b/Assets/StreamingAssets/TXT/data-1145992048.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-1145992048.txt.meta b/Assets/StreamingAssets/TXT/data-1145992048.txt.meta new file mode 100644 index 0000000..62e7aba --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-1145992048.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f4b001f8e6f780e4a805f91a5022fa40 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-1233994197.txt b/Assets/StreamingAssets/TXT/data-1233994197.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-1233994197.txt.meta b/Assets/StreamingAssets/TXT/data-1233994197.txt.meta new file mode 100644 index 0000000..be69554 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-1233994197.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0d8a687fcc15d5d45be439b9e9fd13de +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-1246845823.txt b/Assets/StreamingAssets/TXT/data-1246845823.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-1246845823.txt.meta b/Assets/StreamingAssets/TXT/data-1246845823.txt.meta new file mode 100644 index 0000000..75943e4 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-1246845823.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cd84a1d54d6843f40b21c0afcafb8708 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-1387285668.txt b/Assets/StreamingAssets/TXT/data-1387285668.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-1387285668.txt.meta b/Assets/StreamingAssets/TXT/data-1387285668.txt.meta new file mode 100644 index 0000000..e9258f7 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-1387285668.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 25fb8bee0401ead43a8c68775f7ec09d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-1733196123.txt b/Assets/StreamingAssets/TXT/data-1733196123.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-1733196123.txt.meta b/Assets/StreamingAssets/TXT/data-1733196123.txt.meta new file mode 100644 index 0000000..8f5b2ae --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-1733196123.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c2aabc660813a484ab4ef013c32fad15 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-1824959729.txt b/Assets/StreamingAssets/TXT/data-1824959729.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-1824959729.txt.meta b/Assets/StreamingAssets/TXT/data-1824959729.txt.meta new file mode 100644 index 0000000..2102007 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-1824959729.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5f7a3c71c8163ae4ea019a306490708a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-2109697038.txt b/Assets/StreamingAssets/TXT/data-2109697038.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-2109697038.txt.meta b/Assets/StreamingAssets/TXT/data-2109697038.txt.meta new file mode 100644 index 0000000..2825b1a --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-2109697038.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3395b95776ce3f34295f062c9cb206d1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-568262565.txt b/Assets/StreamingAssets/TXT/data-568262565.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-568262565.txt.meta b/Assets/StreamingAssets/TXT/data-568262565.txt.meta new file mode 100644 index 0000000..2d1acf1 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-568262565.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ade6b5684719d9e4598a478dc58ddab2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data-822689983.txt b/Assets/StreamingAssets/TXT/data-822689983.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data-822689983.txt.meta b/Assets/StreamingAssets/TXT/data-822689983.txt.meta new file mode 100644 index 0000000..018d782 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data-822689983.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7d2b2adf5a1ecc34f881f70139afb4a5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data1125377480.txt b/Assets/StreamingAssets/TXT/data1125377480.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data1125377480.txt.meta b/Assets/StreamingAssets/TXT/data1125377480.txt.meta new file mode 100644 index 0000000..891fec9 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data1125377480.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 50d4a2169eb4a0f42aa8187716e1c2f8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data1397064879.txt b/Assets/StreamingAssets/TXT/data1397064879.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data1397064879.txt.meta b/Assets/StreamingAssets/TXT/data1397064879.txt.meta new file mode 100644 index 0000000..b831048 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data1397064879.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 890e84916efe63d4196097561a790d3a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data312225347.txt b/Assets/StreamingAssets/TXT/data312225347.txt new file mode 100644 index 0000000..786cff8 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data312225347.txt @@ -0,0 +1,35 @@ + +选手ID:1 +赛项:2023年江西省职业院校技能大赛 高职组“导游服务”赛项 +科目:测试科目 +题目:珍贵文物中的孤品和易损品,禁止出境展览。 +选项:A:正确B:错误 +正确答案:B +作答结果: + +题目:商朝的司(后)母戊大方鼎是迄今发现的世界上最大古代青铜器。() +选项:A:正确B:错误 +正确答案:A +作答结果: + +题目:旅游团乘旅游车外出游览时,由于司机不慎,发生交通事故造成游客重伤。在交通事故的善后处理中,应遵循()为第一位的原则。 +选项:A:保护旅行社的利益B:保护旅游者的基本权益C:保护旅游车公司的利益D:协商解决 +正确答案:B +作答结果: + +题目:()生长着“摇钱树、同根生、连理枝”三棵奇树。 +选项:A:祝圣寺B:藏经阁C:南岳大庙D:忠烈祠 +正确答案:B +作答结果: + +题目:某旅行社安排导游员小张为在境内旅游的某旅行团提供导游服务,同时要求小张先行垫付旅游活动过程中的团队餐、住宿等费用。对此,由旅游主管部门对该旅行社实施行政处罚正确的有()。 +选项:A:责令改正B:没收违法所得C:处3000元以上3万元以下罚款D:情节严重的,吊销旅行社业务经营许可证E:情节严重的,责令停业整顿或者吊销旅行社业务经营许可证 +正确答案:ABE +作答结果: + +分数:0 +正确数量:0 +答错数量:0 +未答数量:5 +正确率:0% +用时:00:00:40 diff --git a/Assets/StreamingAssets/TXT/data312225347.txt.meta b/Assets/StreamingAssets/TXT/data312225347.txt.meta new file mode 100644 index 0000000..a65acd2 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data312225347.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 33cb4375febe9d04e95ea063f717fc10 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data566134847.txt b/Assets/StreamingAssets/TXT/data566134847.txt new file mode 100644 index 0000000..e69de29 diff --git a/Assets/StreamingAssets/TXT/data566134847.txt.meta b/Assets/StreamingAssets/TXT/data566134847.txt.meta new file mode 100644 index 0000000..615618f --- /dev/null +++ b/Assets/StreamingAssets/TXT/data566134847.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 073679aa93379424590fa146b4fb1eac +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/TXT/data910999403.txt b/Assets/StreamingAssets/TXT/data910999403.txt new file mode 100644 index 0000000..96346b5 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data910999403.txt @@ -0,0 +1,35 @@ + +选手ID:1 +赛项:2023年江西省职业院校技能大赛 高职组“导游服务”赛项 +科目:测试科目 +题目:我们要坚持一个中国原则和“九二共识”,实现祖国完全统一。 +选项:A:正确B:错误 +正确答案:A +作答结果: + +题目:国家级文化生态保护区指以保护非物质文化遗产为核心,对历史文化积淀丰厚、存续状态良好,具有重要价值的鲜明特色的文化形态进行整体性保护,并经文化和旅游部同意设立的特定区域。 +选项:A:正确B:错误 +正确答案:A +作答结果: + +题目:全国所有旅客列车从()1月1日起实行车票实名制。 +选项:A:2002年B:2004年C:2006年D:2012年 +正确答案:D +作答结果: + +题目:趵突泉内泺源堂抱厦柱上“云雾润蒸华不注,波涛声震大明湖”的对联,出自()的咏泉佳句。 +选项:A:何绍基B:赵孟頫C:铁保D:于书佃 +正确答案:B +作答结果: + +题目:食物中毒的常见症状有()。 +选项:A:恶心B:呕吐C:头痛D:腹痛E:腹泻 +正确答案:ABDE +作答结果: + +分数:0 +正确数量:0 +答错数量:0 +未答数量:5 +正确率:0% +用时:00:00:01 diff --git a/Assets/StreamingAssets/TXT/data910999403.txt.meta b/Assets/StreamingAssets/TXT/data910999403.txt.meta new file mode 100644 index 0000000..7e78ec0 --- /dev/null +++ b/Assets/StreamingAssets/TXT/data910999403.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fcef111e2b2ac2140a69c9af3de24529 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: