Exemplo n.º 1
0
    void Start()
    {
        crudscore = GetComponent <CRUDScores>();

        studentscore = new StudentScores();

        world      = "world1";
        chap       = "chap1";
        difficulty = "easy";

        invalidworld           = "testingworld123";
        userid                 = "userid1159";
        userid2                = "user1";
        studentscore.attempt   = 1;
        studentscore.name      = "Sam";
        studentscore.scores    = 123;
        GameOwneruserid        = "student1";
        InvalidGameOwneruserid = "testinguser1234";
        UniqueQuestionId       = "3405934";


        Test_getLeaderBoard_WithValidValue(world, chap, difficulty);
        Test_getLeaderBoard_WithInvalidValue(invalidworld, chap, difficulty);

        Test_getUserScores_WithValidValue(world, chap, difficulty, userid);
        Test_getUserScores_WithInvalidValue(invalidworld, chap, difficulty, userid);

        Test_getUserScoreForStudentGame_WithValidValue(GameOwneruserid, userid2, UniqueQuestionId);
        Test_getUserScoreForStudentGame_WithInvalidValue(InvalidGameOwneruserid, userid2, UniqueQuestionId);
    }
    // Start is called before the first frame update
    void Start()
    {
        crudscore = GetComponent <CRUDScores>();


        world      = "world1";
        chap       = "chap1";
        difficulty = "easy";

        getLeaderBoard(world, chap, difficulty);
        getStatistics(world);
    }
Exemplo n.º 3
0
    // Start is called before the first frame update
    //
    IEnumerator Start()
    {
        chapter1Panel.SetActive(false);
        chapter2Panel.SetActive(false);
        chapter3Panel.SetActive(false);
        chapter4Panel.SetActive(false);
        lockedOrNot();
        var difficultyLevel = new List <string> {
            "easy", "medium", "hard"
        };
        var chapterLevel = new List <string> {
            "chap1", "chap2", "chap3", "chap4"
        };

        world  = StaticVariable.world;
        userid = StaticVariable.UserID;

        crudscore = GetComponent <CRUDScores>();
        foreach (string i in chapterLevel)
        {
            foreach (string d in difficultyLevel)
            {
                Debug.Log(i + " " + d);
                chap         = i;
                difficulty   = d;
                callbackdone = false;
                crudscore.getUserScore(world, chap, difficulty, userid, myCallbackFunction);
                yield return(new WaitUntil(() => callbackdone == true));

                Debug.Log(callbackdone);
                //Debug.Log(studentScores.scores);
                //getStudentScores(world, i, userid, d);
            }
        }
        lockedOrNot();

        /*
         * chap = "chap1";
         * world = "world1";
         * difficulty = "easy";
         * userid = "userid1159";
         * crudscore = GetComponent<CRUDScores>();
         * crudscore.getUserScore(world, chap, difficulty, userid, myCallbackFunction);
         *
         * getStudentScores(world, chap, userid, difficulty);
         * callbackdone = false;
         */
    }
    void Start()
    {
        crudscore = GetComponent <CRUDScores>();

        world            = "world1";
        chap             = "chap1";
        difficulty       = "easy";
        userid           = "userid1159";
        userid2          = "user1";
        GameOwneruserid  = "student1";
        UniqueQuestionId = "3405934";

        Preformancetest_getLeaderBoard(world, chap, difficulty);
        Preformancetest_getUserScores(world, chap, difficulty, userid);
        Preformancetest_getUserScoreForStudentGame(GameOwneruserid, userid2, UniqueQuestionId);
    }
Exemplo n.º 5
0
    string userID = StaticVariable.UserID;//"userid1159";


    // Start is called before the first frame update
    IEnumerator Start()
    {
        character = StaticVariable.characterSelect;
        setCharacterMovement(character, false);
        Time.timeScale = 0;
        crudscore      = GetComponent <CRUDScores>();
        crudscore.getUserScore(world, chap, difficulty, userID, callbackFunc);
        yield return(new WaitUntil(() => call == true));

        // Debug.Log(scoreList.scores);
        // 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);
    }
Exemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        crudscore = GetComponent <CRUDScores>();
        crudUser  = GetComponent <AddUser>();

        studentscore = new StudentScores();

        world                = "testworld";
        chap                 = "chap1";
        difficulty           = "easy";
        userid               = "user1";
        studentscore.attempt = 1;
        studentscore.name    = "Sam";
        studentscore.scores  = 123;
        GameOwneruserid      = "student1";
        UniqueQuestionId     = "3405934";

        AddNewScores(world, chap, difficulty, userid, studentscore);
        getUserScores(world, chap, difficulty, userid);
        updateUserScore(world, chap, difficulty, userid, studentscore);
        AddStudentGameNewScores(GameOwneruserid, userid, UniqueQuestionId, studentscore);
        getUserScoreForStudentGame(GameOwneruserid, userid, UniqueQuestionId);
    }