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")); }
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); }
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); } }
public override Memorization Grant(Memorization currentMemorization, double complexity) { currentMemorization.Period += 1; return(base.Grant(currentMemorization, complexity)); }
public override Memorization Grant(Memorization currentMemorization, double complexity) { currentMemorization.Period = Convert.ToInt16(Math.Truncate(0.2 * currentMemorization.Period)); return(base.Grant(currentMemorization, complexity)); }
public void Update(Memorization data) { }