fjlasjfos
This commit is contained in:
parent
56c0afbcea
commit
c18d22001e
|
|
@ -61,7 +61,7 @@ public class LoginPanel :XUIPanel
|
||||||
if (MyManage.instance.startMode != null && MyManage.instance.startMode.teachplanId>0)
|
if (MyManage.instance.startMode != null && MyManage.instance.startMode.teachplanId>0)
|
||||||
{
|
{
|
||||||
//参数启动
|
//参数启动
|
||||||
accountInput.text = "admin" + MyManage.instance.startMode.teachplanId;
|
accountInput.text = "admin" + MyManage.instance.examNum;
|
||||||
accountInput.interactable = false;
|
accountInput.interactable = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2e5cf2ce39559434da4d890cefcaf7bf
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
[{
|
||||||
|
"eventTitle": "巡检工器具",
|
||||||
|
"eventid": 1,
|
||||||
|
"totalscore": 3,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "排故工器具",
|
||||||
|
"eventid": 2,
|
||||||
|
"totalscore": 3,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "停电操作票",
|
||||||
|
"eventid": 3,
|
||||||
|
"totalscore": 5,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "送电操作票",
|
||||||
|
"eventid": 4,
|
||||||
|
"totalscore": 5,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "停电操作票步骤",
|
||||||
|
"eventid": 5,
|
||||||
|
"totalscore": 5,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "送电操作票步骤",
|
||||||
|
"eventid": 6,
|
||||||
|
"totalscore": 5,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "围栏",
|
||||||
|
"eventid": 7,
|
||||||
|
"totalscore": 2,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "验电",
|
||||||
|
"eventid": 8,
|
||||||
|
"totalscore": 2,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "时间分",
|
||||||
|
"eventid": 9,
|
||||||
|
"totalscore": 5,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "缺陷查找、缺陷处理、缺陷分类分值",
|
||||||
|
"eventid": 10,
|
||||||
|
"totalscore": 65,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eventTitle": "其它扣分项",
|
||||||
|
"eventid": 11,
|
||||||
|
"totalscore": 0,
|
||||||
|
"workconditions": "",
|
||||||
|
"veto": 0,
|
||||||
|
"stepArr": []
|
||||||
|
}]
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 41d89540806e0304aa5c956b273e5ae3
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
3
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cb8f0815514012f4c9010a1ef0aec93a
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
|
|
@ -11,6 +11,9 @@ using SGUnitySDK.Utils;
|
||||||
using System;
|
using System;
|
||||||
using RuralPower;
|
using RuralPower;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using System.Text;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
public class MyManage : MonoBehaviour
|
public class MyManage : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
@ -28,6 +31,10 @@ public class MyManage : MonoBehaviour
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PlayModeEnum playModeEnum;
|
public PlayModeEnum playModeEnum;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// °¸Àý±àºÅ
|
||||||
|
/// </summary>
|
||||||
|
public int examNum;
|
||||||
|
/// <summary>
|
||||||
/// 启动参数
|
/// 启动参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
List<string> infos;
|
List<string> infos;
|
||||||
|
|
@ -39,8 +46,8 @@ public class MyManage : MonoBehaviour
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
SGStartParamsService.GetInstance().setMode("eyJtb2RlIjo1LCJwbGFuTG9jYWxQYXRoIjoiRDpcXFVzZXJGaWxlc1xc5Yac55S156ue6LWb5a+55o6lXFzmoYjkvoszLnppcCIsInByYWN0aXNlSWQiOiI4Iiwic3R1VXNlcklkIjoiNzM0IiwiYXBwSWQiOiIyIiwiZXhhbUlkIjoiLTEiLCJ0ZWFjaHBsYW5JZCI6IjMiLCJjb3Vyc2VJZCI6Ii0xIn0=");
|
SGStartParamsService.GetInstance().setMode("eyJtb2RlIjo1LCJwbGFuTG9jYWxQYXRoIjoiRDpcXFVzZXJGaWxlc1xc5Yac55S156ue6LWb5a+55o6lXFzmoYjkvoszLnppcCIsInByYWN0aXNlSWQiOiI1NSIsInN0dVVzZXJJZCI6IjUzOSIsImFwcElkIjoiMTQiLCJleGFtSWQiOiItMSIsInRlYWNocGxhbklkIjoiMTIzIiwiY291cnNlSWQiOiItMSJ9");
|
||||||
SGStartParamsService.GetInstance().setToken("fad75ba1-541f-4d59-8366-fa5667abd615");
|
SGStartParamsService.GetInstance().setToken("f1ebee39-fd39-49f1-8da5-9c7110570f90");
|
||||||
#endif
|
#endif
|
||||||
SGUConfig config = new SGUConfig();
|
SGUConfig config = new SGUConfig();
|
||||||
SGUSdk.GetInstance().InitSDK(config);
|
SGUSdk.GetInstance().InitSDK(config);
|
||||||
|
|
@ -62,6 +69,7 @@ public class MyManage : MonoBehaviour
|
||||||
//考试
|
//考试
|
||||||
playModeEnum = PlayModeEnum.考试;
|
playModeEnum = PlayModeEnum.考试;
|
||||||
Debug.Log("考试模式:" + startMode.examId);
|
Debug.Log("考试模式:" + startMode.examId);
|
||||||
|
GetZip();
|
||||||
//HttpExamService getPractiseInfo = new HttpExamService();
|
//HttpExamService getPractiseInfo = new HttpExamService();
|
||||||
//ResponObject responObject = getPractiseInfo.GetExamQuestionList(startMode.examId);
|
//ResponObject responObject = getPractiseInfo.GetExamQuestionList(startMode.examId);
|
||||||
//if(responObject.code=="0")
|
//if(responObject.code=="0")
|
||||||
|
|
@ -79,6 +87,7 @@ public class MyManage : MonoBehaviour
|
||||||
//练习
|
//练习
|
||||||
playModeEnum = PlayModeEnum.练习;
|
playModeEnum = PlayModeEnum.练习;
|
||||||
Debug.Log("练习模式:" + startMode.practiseId);
|
Debug.Log("练习模式:" + startMode.practiseId);
|
||||||
|
GetZip();
|
||||||
//HttpPractiseService getPractiseInfo = new HttpPractiseService();
|
//HttpPractiseService getPractiseInfo = new HttpPractiseService();
|
||||||
//ResponObject responObject = getPractiseInfo.GetPractiseInfo(startMode.practiseId);
|
//ResponObject responObject = getPractiseInfo.GetPractiseInfo(startMode.practiseId);
|
||||||
//if(responObject.code=="0")
|
//if(responObject.code=="0")
|
||||||
|
|
@ -104,7 +113,7 @@ public class MyManage : MonoBehaviour
|
||||||
if(Input.GetKeyDown(KeyCode.O))
|
if(Input.GetKeyDown(KeyCode.O))
|
||||||
{
|
{
|
||||||
RuralPowerAPI ruralPowerAPI = new RuralPowerAPI();
|
RuralPowerAPI ruralPowerAPI = new RuralPowerAPI();
|
||||||
var tmps=ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, startMode.teachplanId);
|
var tmps=ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, examNum);
|
||||||
Debug.Log("当前答案=====================");
|
Debug.Log("当前答案=====================");
|
||||||
Debug.Log(JsonConvert.SerializeObject(DataBase.achievement_list));
|
Debug.Log(JsonConvert.SerializeObject(DataBase.achievement_list));
|
||||||
foreach (var tmp in tmps)
|
foreach (var tmp in tmps)
|
||||||
|
|
@ -130,6 +139,15 @@ public class MyManage : MonoBehaviour
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void GetZip()
|
||||||
|
{
|
||||||
|
string path = Application.streamingAssetsPath + "/tmpcxx";
|
||||||
|
Directory.Delete(path,true);
|
||||||
|
Directory.CreateDirectory(path);
|
||||||
|
System.IO.Compression.ZipFile.ExtractToDirectory(startMode.planLocalPath, path, Encoding.GetEncoding("GBK"));
|
||||||
|
examNum = int.Parse(File.ReadAllText(path + "/examNum.txt"));
|
||||||
|
Debug.Log("°¸Àý±àºÅ£º" + examNum);
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始练习
|
/// 开始练习
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -167,7 +185,7 @@ public class MyManage : MonoBehaviour
|
||||||
public void GetUploadPracticeAnswer()
|
public void GetUploadPracticeAnswer()
|
||||||
{
|
{
|
||||||
RuralPowerAPI ruralPowerAPI=new RuralPowerAPI();
|
RuralPowerAPI ruralPowerAPI=new RuralPowerAPI();
|
||||||
var answers=ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, startMode.teachplanId);
|
var answers=ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, examNum);
|
||||||
Debug.Log("结束练习:");
|
Debug.Log("结束练习:");
|
||||||
Debug.Log(JsonConvert.SerializeObject(answers));
|
Debug.Log(JsonConvert.SerializeObject(answers));
|
||||||
|
|
||||||
|
|
@ -235,7 +253,7 @@ public class MyManage : MonoBehaviour
|
||||||
public void GetUploadExamAnswer()
|
public void GetUploadExamAnswer()
|
||||||
{
|
{
|
||||||
RuralPowerAPI ruralPowerAPI = new RuralPowerAPI();
|
RuralPowerAPI ruralPowerAPI = new RuralPowerAPI();
|
||||||
var answers = ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, startMode.teachplanId);
|
var answers = ruralPowerAPI.GetAnswer(ScenesRecorder.user.ExamId, ScenesRecorder.user.user_id, examNum);
|
||||||
Debug.Log("结束考试:");
|
Debug.Log("结束考试:");
|
||||||
Debug.Log(JsonConvert.SerializeObject(answers));
|
Debug.Log(JsonConvert.SerializeObject(answers));
|
||||||
HttpExamService getPractiseInfo = new HttpExamService();
|
HttpExamService getPractiseInfo = new HttpExamService();
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ public class DataHandler : MonoBehaviour
|
||||||
{
|
{
|
||||||
Debug.Log("Load online data!");
|
Debug.Log("Load online data!");
|
||||||
RuralPowerAPI rpa = new RuralPowerAPI();
|
RuralPowerAPI rpa = new RuralPowerAPI();
|
||||||
var result = rpa.GetExam(_ip,ScenesRecorder.user.user_id,MyManage.instance.startMode.teachplanId.ToString(),Application.streamingAssetsPath+ "/zy");
|
var result = rpa.GetExam(_ip,ScenesRecorder.user.user_id,MyManage.instance.examNum.ToString(),Application.streamingAssetsPath+ "/zy");
|
||||||
InitData(result);
|
InitData(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ public class ScenesRecorder : MonoBehaviour
|
||||||
IsInit = true;
|
IsInit = true;
|
||||||
RuralPowerAPI rpa = new RuralPowerAPI();
|
RuralPowerAPI rpa = new RuralPowerAPI();
|
||||||
// »ñÈ¡¿¼ÊÔ
|
// »ñÈ¡¿¼ÊÔ
|
||||||
var resultstart = rpa.GetExam(_ip, ScenesRecorder.user.user_id,MyManage.instance.startMode.teachplanId.ToString(), Application.streamingAssetsPath + "/zy");
|
var resultstart = rpa.GetExam(_ip, ScenesRecorder.user.user_id,MyManage.instance.examNum.ToString(), Application.streamingAssetsPath + "/zy");
|
||||||
if (JObject.Parse(resultstart)["code"].ToObject<int>()!=0)
|
if (JObject.Parse(resultstart)["code"].ToObject<int>()!=0)
|
||||||
{
|
{
|
||||||
Debug.LogError("GetExamʧ°Ü");
|
Debug.LogError("GetExamʧ°Ü");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue