|
|
@@ -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);
|
|
|
|