Beispiel #1
0
    public void LoadAnalyze(CheakingRespondData.ResultClass crdrc)
    {
        imgPronAccuracy.DOFillAmount(0f, 0f);
        imgPronFluency.DOFillAmount(0f, 0f);
        imgPronCompletion.DOFillAmount(0f, 0f);

        if (crdrc.PronAccuracy == -1f) //乱读不做处理~
        {
            txtAllCount.text       = "乱读?!";
            txtPronAccuracy.text   = "乱读!";
            txtPronFluency.text    = "乱读!";
            txtPronCompletion.text = "乱读!";

            return;
        }
        else
        {
            txtAllCount.text = "总分\n" + crdrc.SuggestedScore.ToString() + " / 100.0";
            imgPronAccuracy.DOFillAmount(crdrc.PronAccuracy / 100f, fadeTime);
            imgPronFluency.DOFillAmount(crdrc.PronFluency, fadeTime);
            imgPronCompletion.DOFillAmount(crdrc.PronCompletion, fadeTime);

            txtPronAccuracy.text   = crdrc.PronAccuracy.ToString() + " / 100.0";
            txtPronFluency.text    = (crdrc.PronFluency * 100f).ToString() + " / 100.0";
            txtPronCompletion.text = (crdrc.PronCompletion * 100f).ToString() + " / 100.0";
        }

        LoadWordList(crdrc.Words);
    }
 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();
 }