IEnumerator GetFullResult() { DialogLoading dialogLoading= GlobalUIManager.guim.CreateNewLoading(); GlobalUIManager.guim.CreateNewDialogTie("分析数据下载中..."); string url = GetPermisson.GetServerAddress + "/Grade/GetFullResult.php?ID="+baseExamId+"&token=" + LoginToKaoShi.userLoginCallback.data.token; UnityWebRequest uwr = UnityWebRequest.Get(url); yield return uwr.SendWebRequest(); if (uwr.isHttpError || uwr.isNetworkError) { ReloadTip("获取信息时网络出现异常!是否重试?"); } else { try { FullResultData frd = JsonUtility.FromJson<FullResultData>(uwr.downloadHandler.text); if (frd.code == 0) { partAClip=WavUtility.ToAudioClip(CheakerTools.Base64_Decode(frd.data.audioPartA),0,"PartA"); fullResultData = frd; // var soe = SOEWork.GetMyGrade(frd.data.audioPartA, frd.data.keywordPartA); if (string.IsNullOrWhiteSpace(frd.data.jsonPartA)) { GlobalUIManager.guim.CreateNewSelectBox("当前试卷并未批改,是否立即批改?", delegate(bool ok) { if (ok) { cheakingRequestPoster.GoCheak(); } else { SceneManager.LoadScene(1);//退出 } }); } else { CheakingRespondData.ResultClass resultClass = JsonUtility.FromJson<CheakingRespondData.ResultClass>(frd.data.jsonPartA); analyzeManager.LoadAnalyze(resultClass); } } else { ReloadTip(frd.msg+"是否重试?"); } } catch (Exception err) { ReloadTip("未知异常!是否重试?\n" + err.Message); Debug.LogError(err.ToString()); } } dialogLoading.DestoryThisLoad(); }
private IEnumerator GoCheaking(int ID) { DialogLoading loading = GlobalUIManager.guim.CreateNewLoading(); GlobalUIManager.guim.CreateNewDialogTie("服务器正在批改~请等待~等待时间不会超过120秒~"); string url = GetPermisson.GetServerAddress + "/SOE/AudioReadCheaker.php?ID=" + ID + "&token=" + LoginToKaoShi.userLoginCallback.data.token; UnityWebRequest uwr = UnityWebRequest.Get(url); uwr.timeout = 360; yield return(uwr.SendWebRequest()); if (uwr.isNetworkError || uwr.isHttpError) { GlobalUIManager.guim.CreateNewDialogBox("网络异常!"); Debug.LogError(uwr.error); // Debug.LogError(uwr.downloadHandler.text); } else { try { CheakingRespondData crd = JsonUtility.FromJson <CheakingRespondData>(uwr.downloadHandler.text); if (crd.code == 0) { analyzeManager.LoadAnalyze(crd.data.res); GlobalUIManager.guim.CreateNewDialogBox(crd.msg); } else { GlobalUIManager.guim.CreateNewDialogBox(crd.msg); SceneManager.LoadScene(1); } } catch (Exception err) { GlobalUIManager.guim.CreateNewDialogBox("数据包解析异常!请联系管理员!"); Debug.LogError(err); SceneManager.LoadScene(1); } } loading.DestoryThisLoad(); }