예제 #1
0
    public void InitScoreValue(string part, int index, PaperCheakerCELSTBItemCtrl pccbic)
    {
        nowPartName  = part;
        nowPartIndex = index;
        nowPCCIC     = pccbic;
        switch (part)
        {
        case "A":
            if (CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBA[index] != -1)
            {
                scoreSlider.value = CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBA[index] * 10f;
            }
            else
            {
                scoreSlider.value = 10f;
            }


            break;

        case "B":
            if (CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBB[index] != -1)
            {
                scoreSlider.value = CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBB[index] * 10f;
            }
            else
            {
                scoreSlider.value = 10f;
            }
            break;
        }
    }
예제 #2
0
    public bool InitB(string partBA_Ansers, string partBA_Audios, string partBB_Ansers, string partBB_Audios)
    {
        try
        {
            //  System.Action tempAction = null;
            PaperCheakerCELSTBItemCtrl tempItemCtrl = null;
            if (!string.IsNullOrWhiteSpace(partBA_Ansers) && !string.IsNullOrWhiteSpace(partBA_Audios))//PartA不为空
            {
                string[] partBA_Ansers_strs = partBA_Ansers.Split('/');
                string[] partBA_Audios_strs = partBA_Audios.Split('|');


                // AudioClip[] clips = new AudioClip[partBA_Audios_strs.Length];
                for (int i = 0; i < partBA_Audios_strs.Length; i++)
                {
                    AudioClip clip = WavUtility.ToAudioClip(CheakerTools.Base64_Decode(partBA_Audios_strs[i]), 0, "ParBA_Audio_" + i);
                    PaperCheakerCELSTBItemCtrl pccbic = CommonTools.NewAnObjectA(perfabItemBtn, tarContent).GetComponent <PaperCheakerCELSTBItemCtrl>();
                    if (i < CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBA.Length)
                    {
                        if (CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBA[i] == -1)
                        {
                            pccbic.SetStatus(false);
                            pccbic.nowTitle  = "三问第" + (i + 1).ToString() + "题";
                            pccbic.text.text = pccbic.nowTitle;
                        }
                        else
                        {
                            pccbic.SetStatus(true);
                            pccbic.nowTitle  = "三问第" + (i + 1).ToString() + "题";
                            pccbic.text.text = pccbic.nowTitle + "-" +
                                               CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBA[i].ToString();
                        }



                        pccbic.clip = clip;
                        string anser = "";
                        if (i < partBA_Ansers_strs.Length)
                        {
                            anser = partBA_Ansers_strs[i];
                        }
                        pccbic.tarText = "三问第" + (i + 1).ToString() + "题答案:\n"
                                         + "<Color=Orange>" + anser + "</Color>"
                                         + "\n请依据关键词给分.";
                        pccbic.partName = "A";
                        pccbic.partID   = i;

                        if (tempItemCtrl == null)
                        {
                            tempItemCtrl = pccbic;
                        }
                    }
                    else
                    {
                        GlobalUIManager.guim.CreateNewDialogBox("PartB改卷系统出现异常!");
                    }
                }
            }



            if (!string.IsNullOrWhiteSpace(partBB_Ansers) && !string.IsNullOrWhiteSpace(partBB_Audios))//PartB不为空
            {
                string[] partBB_Ansers_strs = partBB_Ansers.Split('/');
                string[] partBB_Audios_strs = partBB_Audios.Split('|');


                // AudioClip[] clips = new AudioClip[partBB_Audios_strs.Length];
                for (int i = 0; i < partBB_Audios_strs.Length; i++)
                {
                    AudioClip clip = WavUtility.ToAudioClip(CheakerTools.Base64_Decode(partBB_Audios_strs[i]), 0, "ParBB_Audio_" + i);
                    PaperCheakerCELSTBItemCtrl pccbic = CommonTools.NewAnObjectA(perfabItemBtn, tarContent).GetComponent <PaperCheakerCELSTBItemCtrl>();
                    if (i < CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBB.Length)
                    {
                        if (CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBB[i] == -1)
                        {
                            pccbic.SetStatus(false);
                            pccbic.nowTitle  = "五答第" + (i + 1).ToString() + "题";
                            pccbic.text.text = pccbic.nowTitle;
                        }
                        else
                        {
                            pccbic.SetStatus(true);
                            pccbic.nowTitle  = "五答第" + (i + 1).ToString() + "题";
                            pccbic.text.text = pccbic.nowTitle + "-" + CheakerSceneManager.cheakerSceneManager.celstTempPaper.gradeBB[i].ToString();
                        }

                        pccbic.clip = clip;

                        string anser = "";
                        if (i < partBB_Ansers_strs.Length)
                        {
                            anser = partBB_Ansers_strs[i];
                        }
                        pccbic.tarText = "五答第" + (i + 1).ToString() + "题答案:\n"
                                         + "<Color=Orange>" + anser + "</Color>"
                                         + "\n请依据关键词给分.";
                        pccbic.partName = "B";
                        pccbic.partID   = i;

                        if (tempItemCtrl == null)
                        {
                            tempItemCtrl = pccbic;
                        }
                    }
                    else
                    {
                        GlobalUIManager.guim.CreateNewDialogBox("PartB改卷系统出现异常!");
                    }
                }
            }
            tempItemCtrl?.OnClick();
            if (tempItemCtrl != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        catch (System.Exception err)
        {
            Debug.Log(err.ToString());
            return(false);
        }
    }