Ejemplo n.º 1
0
        public async Task <Responce> RetreaveQuestionBlock()
        {
            UserObject QuestionsBlock = SingleUserObject.getObject();

            byte[] bytestream = Encoding.ASCII.GetBytes("{\"user\": { \"session\":\"{" + QuestionsBlock.SessionID + "}\",\"userobject\": { " + QuestionsBlock.GetObjectString() + "}}}");
            return(await APICall("PUT", "http://35.163.221.182:3002/api/q/request_block", bytestream));
        }
Ejemplo n.º 2
0
        private void CreateUserObject(JsonValue json)
        {
            UserObject userObj        = SingleUserObject.getObject();
            JsonValue  user           = json["user_object"];
            JsonValue  game           = user["game_data"];
            JsonArray  completeBlocks = (JsonArray)user["game_data"];

// TODO: Fix once implemented
            // m_userObject.CompletedBlocks = game["completed_blocks"];
            m_userObject.Difficulty        = game["difficulty"];
            userObj.Difficulty             = game["difficulty"];
            m_userObject.SubjectID         = game["subject_id"];
            userObj.SubjectID              = game["subject_id"];
            m_userObject.MoneyEarned       = game["totalDonated"];
            userObj.MoneyEarned            = game["totalDonated"];
            m_userObject.QuestionsAnswered = game["totalQuestions"];
            userObj.QuestionsAnswered      = game["totalQuestions"];
            m_userObject.Timestamp         = user["timestamp"];
            userObj.Timestamp              = user["timestamp"];
            user = user["user_data"];
            m_userObject.Charity   = user["charity_name"];
            userObj.Charity        = user["charity_name"];
            m_userObject.FirstName = user["first_name"];
            userObj.FirstName      = user["first_name"];
            m_userObject.LastName  = user["last_name"];
            userObj.LastName       = user["last_name"];
            m_userObject.Username  = user["username"];
            userObj.Username       = user["username"];
        }