コード例 #1
0
    void getAwardFP()
    {
        NoticeQuizFPort fport = FPortManager.Instance.getFPort("NoticeQuizFPort") as NoticeQuizFPort;

        fport.getAward(examSample.quizId, () => {
            TextTipWindow.Show(LanguageConfigManager.Instance.getLanguage("s0120"));
            instance.updateExamSampleAwardType(notice, true);
            buttonGetAward.disableButton(true);
            this.examSample = QuizManagerment.Instance.getExamSampleBySid(notice);
            initNormalUI();
        });
    }
コード例 #2
0
    void answerFP(int buttonId)
    {
        NoticeQuizFPort fport = FPortManager.Instance.getFPort("NoticeQuizFPort") as NoticeQuizFPort;

        fport.answer(examSample.quizId, buttonId, (int num) => {
            //系统调查没有正确答案,直接下一题
            if (num == -1)
            {
                instance.updateExamSampleScore(notice, 0, false);
                initAnswerUI();
            }
            else if (num == 1 && buttonId == quizSample.rightAnswer)
            {
                instance.updateExamSampleScore(notice, quizSample.rightScore, true);
                string str = LanguageConfigManager.Instance.getLanguage("quiz04", "\n", quizSample.rightScore.ToString());
                UiManager.Instance.createMessageWindowByOneButton(str, (MessageHandle msg) => {
                    this.examSample = QuizManagerment.Instance.getExamSampleBySid(notice);
                    initAnswerUI();
                });
            }
            else
            {
                instance.updateExamSampleScore(notice, quizSample.wrongScore, false);
                string rightAnswer = "";
                if (quizSample.rightAnswer == 1)
                {
                    rightAnswer = "A";
                }
                else if (quizSample.rightAnswer == 2)
                {
                    rightAnswer = "B";
                }
                else if (quizSample.rightAnswer == 3)
                {
                    rightAnswer = "C";
                }
                string str = LanguageConfigManager.Instance.getLanguage("quiz05", rightAnswer, "\n", quizSample.wrongScore.ToString());
                UiManager.Instance.createMessageWindowByOneButton(str, (MessageHandle msg) => {
                    this.examSample = QuizManagerment.Instance.getExamSampleBySid(notice);
                    initAnswerUI();
                });
            }
        });
    }
コード例 #3
0
    /** 初始化题库数据 */
    public void getQuestions(CallBack _callback)
    {
        NoticeQuizFPort fport = FPortManager.Instance.getFPort("NoticeQuizFPort") as NoticeQuizFPort;

        fport.getQuestions(_callback);
    }