/// <summary>
    /// 加载CELST模块
    /// </summary>
    private void LoadCELST()
    {
        // CELSTTempPaper tempPaper = preData.dataMemory;
        memoryData = preData.dataMemory;
        LuoHaoExamPaper lhep = preData.dataPaper;
        string          file = File.ReadAllText(memoryData.dataPath);

        celstTempPaper = JsonUtility.FromJson <CELSTTempPaper>(file);

        if (paperCheakerCELSTACtrl.InitA(
                lhep.paper.path + "/" + lhep.paper.parta_video_name,
                celstTempPaper.partA,
                lhep.paper.parta_text))//初始化A
        {
            cheakingBehaviors.Add(paperCheakerCELSTACtrl);
        }


        if (paperCheakerCELSTBCtrl.InitB(lhep.paper.partb_keyword_question, celstTempPaper.partBA,
                                         lhep.paper.partb_keyword_anser, celstTempPaper.partBB
                                         ))
        {
            cheakingBehaviors.Add(paperCheakerCELSTBCtrl);
        }
        if (paperCheakerCELSTCCtrl.InitC(lhep.paper.partc_keyword_story, celstTempPaper.partC))
        {
            cheakingBehaviors.Add(paperCheakerCELSTCCtrl);
        }



        cheakingBehaviors.Add(paperCheakerCELSTFinish);//完成界面
        //Forward();
        InitGlobalNav();
    }
Ejemplo n.º 2
0
 public void CloseWindows()
 {
     reportText.text = "";
     ctrlPanel.SetActive(false);
     tempObject    = null;
     thisExamPaper = null;
     tempObjectID  = -1;
 }
Ejemplo n.º 3
0
    /// <summary>
    /// 插入一个数据
    /// </summary>
    /// <param name="uml"></param>
    public static void InsertIntoList(UserMemoryList.Common umlc)
    {
        UserMemoryList source = ReadList();

        if (source == null)
        {
            source = new UserMemoryList();
        }
        source.allMemorys.Add(umlc);
        WriteList(source);
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 加载列表
    /// </summary>
    public void LoadList()
    {
        CommonTools.ClearObjectChilds(content);


        PaperManager.GetFileList();//取得文件列表

        UserMemoryList uml = UserMemoryManager.ReadList();

        if (uml == null)
        {
        }
        else
        {
            for (int i = uml.allMemorys.Count - 1; i >= 0; i--)
            {
                MemoryInfoItemCtrl miic = CommonTools.NewAnObjectA(infoPrefab, content.transform).GetComponent <MemoryInfoItemCtrl>();

                UserMemoryList.Common common = uml.allMemorys[i]; //读取

                miic.common   = common;                           //文件
                miic.memoryID = i;                                //储存ID

                string endText = "";
                switch (common.type)
                {
                case UserMemoryList.MemoryType.GD_CELST:    //CELST
                    endText = "<Color='Orange'>#广东高考口语#" + i + "</Color>\n";


                    break;

                case UserMemoryList.MemoryType.CETB4B6:    //CETB4B6
                    endText = "<Color='Orange'>#英语四六级#" + i + "</Color>\n";


                    break;
                }
                endText           += "时间:" + common.time;
                miic.mainText.text = endText;
            }
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 读取
    /// </summary>
    /// <param name="miic"></param>
    public void OpenWindowsToRead(MemoryInfoItemCtrl miic)
    {
        try
        {
            ctrlPanel.SetActive(true);
            // reportText.text = "正在加载报告...";
            reportText.text = "";
            tempObject      = miic.common;
            tempObjectID    = miic.memoryID;
            switch (miic.common.type)
            {
            case UserMemoryList.MemoryType.GD_CELST:
                string file = File.ReadAllText(miic.common.dataPath);


                CELSTTempPaper  tempPaper = JsonUtility.FromJson <CELSTTempPaper>(file);
                LuoHaoExamPaper lhep      = PaperManager.allDownloadedPaperFile[tempPaper.id];
                lhep.paper.path = PaperManager.allDownloadedPath[tempPaper.id];
                thisExamPaper   = lhep;
                int totalGrade = 0;
                int maxGrade   = 0;
                reportText.text += "#" + lhep.paper.id + "#" + lhep.paper.name + "-" + lhep.paper.type + "\n";//头部信息
                if (!string.IsNullOrEmpty(tempPaper.partA))
                {
                    reportText.text += GetGradeDescript("PartA模仿朗读", tempPaper.gradeA) + "\n";
                    if (tempPaper.gradeA != -1)
                    {
                        totalGrade += tempPaper.gradeA;
                    }
                    maxGrade += 20;
                }

                string[] audioBA = tempPaper.partBA.Split('|');
                for (int i = 0; i < tempPaper.gradeBA.Length; i++)
                {
                    if (audioBA.Length > i && !string.IsNullOrEmpty(audioBA[i]))
                    {
                        reportText.text += GetGradeDescript("PartB三问第" + (i + 1).ToString() + "题", tempPaper.gradeBA[i]) + "\n";
                        if (tempPaper.gradeBA[i] != -1)
                        {
                            totalGrade += tempPaper.gradeBA[i];
                        }
                        maxGrade += 2;
                    }
                }
                string[] audioBB = tempPaper.partBB.Split('|');
                for (int i = 0; i < tempPaper.gradeBB.Length; i++)
                {
                    if (audioBB.Length > i && !string.IsNullOrEmpty(audioBB[i]))
                    {
                        reportText.text += GetGradeDescript("PartB五答第" + (i + 1).ToString() + "题", tempPaper.gradeBB[i]) + "\n";
                        if (tempPaper.gradeBB[i] != -1)
                        {
                            totalGrade += tempPaper.gradeBB[i];
                        }
                        maxGrade += 2;
                    }
                }
                if (!string.IsNullOrEmpty(tempPaper.partC))
                {
                    reportText.text += GetGradeDescript("PartC故事复述", tempPaper.gradeC) + "\n";
                    if (tempPaper.gradeC != -1)
                    {
                        totalGrade += tempPaper.gradeC;
                    }
                    maxGrade += 24;
                }
                reportText.text += "总分(左所得/右满分):" + totalGrade + " / " + maxGrade;

                break;

            case UserMemoryList.MemoryType.CETB4B6:
                GlobalUIManager.guim.CreateNewDialogBox("Sorry!该模式还在开发中!");

                break;

            default:
                GlobalUIManager.guim.CreateNewSelectBox("读取本地内存记录时出现错误!是否删除?", delegate(bool ok) {
                    if (ok)
                    {
                        DeleteObj();
                    }
                });
                break;
            }

            reportText.text += "";
        }
        catch
        {
            // CloseWindows();
            GlobalUIManager.guim.CreateNewSelectBox("读取本地内存记录失败!可能是由于试卷已被删除导致记录丢失!是否删除?", delegate(bool ok) {
                if (ok)
                {
                    DeleteObj();
                }

                else
                {
                    CloseWindows();
                }
            });
        }
    }