Prechádzať zdrojové kódy

【+】
1.成绩上传提交

lxd 3 mesiacov pred
rodič
commit
bd061d60fe

+ 20 - 16
Framework/Scripts/Proxys/ExamProxy.cs

@@ -10,7 +10,7 @@ public class ExamProxy : DataProxy
     /// 考试科目
     /// </summary>
     private string curse;
- 
+
     /// <summary>
     /// 开始时间
     /// </summary>
@@ -26,10 +26,16 @@ public class ExamProxy : DataProxy
     /// <summary>
     /// 开始考试
     /// </summary>
-    public void StartExam() 
+    public void StartExam()
     {
         startTime = System.DateTime.Now;
         curse = GlobalConfig.m_SelectDevice;
+        Debug.LogError(curse);
+        UserProxy userProxy = DAL.Instance.Get<UserProxy>();
+
+        SearchInfoResponse searchInfoResponse = GrpcChannelContronller.Instance.client.StudentInfoSearch(new SearchRequest() { PhoneNumber = userProxy.userInfo.phoneNumber });
+
+        Debug.LogError(searchInfoResponse.StudentInfos.Count);
     }
 
 
@@ -40,26 +46,24 @@ public class ExamProxy : DataProxy
     {
         UserProxy userProxy = DAL.Instance.Get<UserProxy>();
 
-        //OperateResponse operateResponse = GrpcChannelContronller.Instance.client.StudentScoreAdd(new StudentScore()
-        //{
-        //    Answertime = (int)TimestampConvert.ConverOldTiemAndNewTiemDuration(startTime, System.DateTime.Now),
-        //    CourseName = curse,
-        //    Name = userProxy.userInfo.userName,
-        //    Score = score,
-        //    Starttime = GetCurrentTime(startTime),
-        //    PhoneNumber = userProxy.userInfo.phoneNumber
-        //});
-
-        //return operateResponse.Result;
+        OperateResponse operateResponse = GrpcChannelContronller.Instance.client.StudentScoreAdd(new StudentScore()
+        {
+            Answertime = (int)TimestampConvert.ConverOldTiemAndNewTiemDuration(startTime, System.DateTime.Now),
+            CourseName = curse,
+            Name = userProxy.userInfo.userName,
+            Score = score,
+            Starttime = GetCurrentTime(startTime),
+            PhoneNumber = userProxy.userInfo.phoneNumber
+        });
 
-        return true;
+        return operateResponse.Result;
     }
 
     /// <summary>
     /// 记录时间
     /// </summary>
-    private long GetCurrentTime(DateTime dateTime) 
-    {   
+    private long GetCurrentTime(DateTime dateTime)
+    {
         string formatStr = "yyyy年MM月dd日 HH : mm : ss";
         string curTimeStr = DateTime.Now.ToString(formatStr);
 

+ 72 - 0
Framework/Scripts/UI/PCController/OperateSetting.cs

@@ -183,6 +183,8 @@ public class OperateSetting : MonoSingleton<OperateSetting>
             m_CurrentOperationMode = GlobalData.m_CurrentOperationMode;
         }
 
+        ParseParameters();
+
         #region 本地化语言
         if (useLocalization)
         {
@@ -203,6 +205,76 @@ public class OperateSetting : MonoSingleton<OperateSetting>
         ProcessManagement.Instance.awakePlay = false;
     }
 
+    private void ParseParameters()
+    {
+        string[] args = System.Environment.GetCommandLineArgs();
+
+        ///临时测试数据
+        string para = $"b0e6098c7b65e46928b38e09a506234abb0b9a0/{m_CourseName}/访客/40008013900/47.92.0.243:15158/Exam/测试参数/这是第条参数/这是总平台参数";
+
+        string[] tmpArgs = para.Split('/');
+
+        // 文件各种:手机号/课程名/模式/地址
+        string tmpPhoneNumber = "";
+        string tmpCourseName = "";
+        string tmpMode = "";
+
+        UserProxy userProxy = DAL.Instance.Get<UserProxy>();
+        userProxy.userInfo.userName = tmpArgs[2];
+        userProxy.userInfo.phoneNumber = tmpArgs[3];
+
+        Debug.Log(tmpArgs.Length + "-asd-" + args[1]);
+        if (tmpArgs.Length < 4)
+        {
+            #region 电专平台接口解析
+
+            // 文件各种:手机号/课程名/模式/地址
+            tmpPhoneNumber = tmpArgs[0];
+            tmpCourseName = tmpArgs[1];
+            tmpMode = tmpArgs[2];
+            //if (tmpArgs.Length > 3)
+            //{
+            //    string tmpAddress = tmpArgs[3];
+            //    //GrpcChannelContronller.Instance.StartClient(tmpAddress);
+
+            //    GetInfoaboutSpecifiedUser(tmpPhoneNumber);
+            //}
+            #endregion
+        }
+        else
+        {
+            #region 通用平台接口解析 
+
+            tmpPhoneNumber = tmpArgs[5];
+            tmpCourseName = tmpArgs[1];
+            tmpMode = tmpArgs[2];
+
+            GrpcChannelContronller.Instance.StartClient(tmpArgs[4]);
+            tmpCourseName = tmpArgs[1];
+
+            GlobalConfig.m_SelectDevice = tmpCourseName;
+
+            switch (tmpArgs[5])
+            {
+                case "Learn":
+                    m_CurrentOperationMode = OperationMode.Learn;
+                    break;
+                case "Practice":
+                    m_CurrentOperationMode = OperationMode.Practice;
+                    break;
+                case "Exam":
+                    m_CurrentOperationMode = OperationMode.Exam;
+                    break;
+                default:
+                    tmpMode = "学习";
+                    break;
+            }
+
+            Debug.Log(tmpCourseName + " --" + tmpMode);
+            #endregion
+        }
+    }
+
     /// <summary>
     /// 初始化游戏设置
     /// </summary>