Пример #1
0
    public void SetSelectedWord(WordProgressModel word)
    {
        selectedWord = word.word;
        WordCategoryModel categoryFound = db.WordCategories.Find(
            (cat) => cat.id == word.categoryId);

        Debug.Log(categoryFound);
        selectedWordCategory = categoryFound.categoryName;
    }
Пример #2
0
        public IHttpActionResult RemoveWordProgress(WordProgressModel wordProgress)
        {
            if (wordProgress == null)
            {
                throw new ArgumentNullException("wordProgress", "WordProgress can't be null");
            }

            return(wordProgressService.RemoveByStudent(wordProgressMapper.Map(wordProgress))
                ? Ok() as IHttpActionResult
                : BadRequest() as IHttpActionResult);
        }
Пример #3
0
        public void UpdateWordProgress(WordProgressModel wordProgress)
        {
            IDbCommand cmd = GetDbCommand();

            cmd.CommandText =
                $@"UPDATE {TABLE_NAME}
                SET
                    {TIMES_HIT}={wordProgress.timesHit},
                    {TIMES_ATTEMPTED}={wordProgress.timesAttempted}
                WHERE id={wordProgress.id}";
            cmd.ExecuteNonQuery();
        }
Пример #4
0
    private void InitializeWordButton(int wordIndex)
    {
        WordProgressModel wordProgress = gm.GetWordProgressData(wordList[wordIndex]);

        currentWord.GetComponent <WordSelectionController>().SetWordProgress(wordProgress);
        currentWord.GetComponent <Button>().onClick.AddListener(() =>
        {
            string selectedWord = wordList[wordIndex];
            gm.SetSelectedWord(wordProgress);
            SetVideoDetails(selectedWord);
        });
    }
Пример #5
0
        public void Create(WordProgressModel wordProgress)
        {
            IDbCommand cmd = GetDbCommand();

            cmd.CommandText =
                $@"INSERT INTO {TABLE_NAME}
                (
                    {WORD},
                    {TIMES_HIT},
                    {TIMES_ATTEMPTED},
                    {USER_ID},
                    {CATEGORY_ID}
                )
                VALUES
                (
                    '{wordProgress.word}',
                    {wordProgress.timesHit},
                    {wordProgress.timesAttempted},
                    {wordProgress.userId},
                    {wordProgress.categoryId}
                );";
            cmd.ExecuteNonQuery();
        }
Пример #6
0
 public void SetWordProgress(WordProgressModel wordProgress)
 {
     word = wordProgress;
     wordText.SetText(wordProgress.word);
     AssignStarsBasedOnHits();
 }