Exemple #1
0
        public async Task <IActionResult> TakeMemorization(int id)
        {
            Memorization mem = new Memorization();

            mem.Student = _context.Students.SingleOrDefault(S => S.Id == id);
            mem.Time    = DateTime.Now;
            _context.Memorizations.Add(mem);
            _context.SaveChanges();
            TempData["Memorization"] = "taken";
            TempData["CheckButton"]  = id.ToString();
            return(RedirectToAction("Memorization"));
        }
Exemple #2
0
 public void Add(Memorization data)
 {
     using (var cnn = SimpleDbConnection())
     {
         cnn.Open();
         data.ID = cnn.Query <int>(
             @"INSERT INTO Memorization 
             ( SetsId ,WordId,UserId,MemorizationDate) VALUES 
             ( @SetsId ,@WordId,@UserId,@MemorizationDate );
             select last_insert_rowid()", data).First();
     }
 }
        public static Memorization Memorization(this UserWordPair userWordPair)
        {
            if (userWordPair == null)
            {
                throw new ArgumentNullException(nameof(userWordPair));
            }
            Memorization memorization = new Memorization
            {
                Period     = userWordPair.LearningPeriod,
                RepeatTime = userWordPair.TimeGap
            };

            return(memorization);
        }
Exemple #4
0
        public Memorization GetBySetsId(int SetsId)
        {
            if (!File.Exists(DbFile))
            {
                return(null);
            }

            using (var cnn = SimpleDbConnection())
            {
                cnn.Open();
                Memorization result = cnn.Query <Memorization>(
                    @"SELECT *
                    FROM Memorization
                    WHERE SetId = @SetsId", new { SetsId = SetsId }).FirstOrDefault();
                return(result);
            }
        }
Exemple #5
0
 public override Memorization Grant(Memorization currentMemorization, double complexity)
 {
     currentMemorization.Period += 1;
     return(base.Grant(currentMemorization, complexity));
 }
Exemple #6
0
 public override Memorization Grant(Memorization currentMemorization, double complexity)
 {
     currentMemorization.Period = Convert.ToInt16(Math.Truncate(0.2 * currentMemorization.Period));
     return(base.Grant(currentMemorization, complexity));
 }
Exemple #7
0
 public void Update(Memorization data)
 {
 }