示例#1
0
    void Start()
    {
        crudQuestion = GetComponent <CRUDquestion>();

        world                        = "testworld";
        chap                         = "chap1";
        difficulty                   = "easy";
        oldDifficulty                = "easy";
        newDifficulty                = "hard";
        gameID                       = "1234";
        question                     = new GetQuestion();
        question.UniqueKey           = "123";
        question.question.question   = "1+1=?";
        question.question.ans1       = "1";
        question.question.ans2       = "2";
        question.question.ans3       = "3";
        question.question.ans4       = "4";
        question.question.correctAns = "2";
        userid                       = "user123";
        questions                    = new GetQuestion[1];
        questions[0]                 = question;
        AddNewQuestion(world, chap, difficulty, question.question);
        UpdateQuestion(world, chap, difficulty, question);
        UpdateQuestionDifficulty(world, chap, oldDifficulty, newDifficulty, question);
        getQuestion(world, chap, difficulty);
        studentAddNewQuestions(userid, questions, 1);
        getStudentGameIDList();
        getStudentGameQuestion(gameID);
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        crudQuestion = GetComponent <CRUDquestion>();
        world        = "world1";
        chap         = "chap1";
        difficulty   = "easy";
        gameID       = "3405934";

        PerformanceTest_getQuestion(world, chap, difficulty);
        PerformanceTest_getStudentGameIDList();
        PerformanceTest_getStudentGameQuestion(gameID);
    }
 // Start is called before the first frame update
 void Start()
 {
     crudQuestion  = GetComponent <CRUDquestion>();
     world         = "world1";
     invalidworld  = "wowowowow";
     chap          = "chap1";
     difficulty    = "easy";
     gameID        = "3405934";
     invalidGameID = "1";
     Test_getQuestion_WithValidValue(world, chap, difficulty);
     Test_getQuestion_WithInvalidValue(invalidworld, chap, difficulty);
     Test_getStudentGameIDList();
     Test_getStudentGameQuestion_WithValidValue(gameID);
     Test_getStudentGameQuestion_WithInvalidValue(invalidGameID);
 }
    string ownerID = StaticVariable.ownerID; //"userid1159";


    // Start is called before the first frame update
    IEnumerator Start()
    {
        shareButton.SetActive(false);
        character = StaticVariable.characterSelect;
        setCharacterMovement(character, false);
        Time.timeScale = 0;
        crudscore      = GetComponent <CRUDScores>();
        crudquestion   = GetComponent <CRUDquestion>();
        crudscore.getUserScoreForStudentGame(ownerID, userID, gameID, callbackFunc);
        yield return(new WaitUntil(() => call == true));

        // Set this before calling into the realtime database.
        // FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://ssadpancake.firebaseio.com/");
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://ssad-c9270.firebaseio.com/");
        // Get the root reference location of the database.
        mDatabaseRef = FirebaseDatabase.DefaultInstance.RootReference;
        Score.text   = "0";
        // point = GetComponent<AudioSource>();

        coroutine = GenerateQuestions();
        StartCoroutine(coroutine);
    }
    IEnumerator Start()
    {
        shareButton.SetActive(false);
        view.enabled          = false;
        successCanvas.enabled = false;
        loading.enabled       = true;
        errorList.enabled     = false;
        crudqn = GetComponent <CRUDquestion>();
        worldList.options.Clear();
        foreach (var item in worlds)
        {
            worldList.options.Add(new Dropdown.OptionData()
            {
                text = item
            });
        }
        worldList.RefreshShownValue();

        chapterList.options.Clear();
        foreach (var item in chapters)
        {
            chapterList.options.Add(new Dropdown.OptionData()
            {
                text = item
            });
        }
        chapterList.RefreshShownValue();

        difficultyList.options.Clear();
        foreach (var item in difficulty)
        {
            difficultyList.options.Add(new Dropdown.OptionData()
            {
                text = item
            });
        }
        difficultyList.RefreshShownValue();


        fullArray = new List <GetQuestion> [worlds.Length][][];
        for (int a = 0; a < worlds.Length; a++)
        {
            fullArray[a] = new List <GetQuestion> [chapters.Length][];
            for (int b = 0; b < chapters.Length; b++)
            {
                fullArray[a][b] = new List <GetQuestion> [difficulty.Length];
                for (int c = 0; c < difficulty.Length; c++)
                {
                    callback = false;
                    Debug.Log(worlds[a] + " " + chapters[b] + " " + difficulty[c]);
                    crudqn.getQuestion(worlds[a], chapters[b], difficulty[c], callbackFunc);

                    yield return(new WaitUntil(() => callback == true));

                    fullArray[a][b][c] = new List <GetQuestion>();
                    if (array != null)
                    {
                        foreach (var item in array)
                        {
                            if (item != null)
                            {
                                fullArray[a][b][c].Add(item);
                            }
                        }
                    }
                }
            }
        }
        loading.enabled = false;
        view.enabled    = true;
        callback        = false;

        updateQuestion();
    }
示例#6
0
 void Start()
 {
     error.enabled = false;
     crudqn        = GetComponent <CRUDquestion>();
 }