diff --git a/api/serializers.py b/api/serializers.py index ef067d36..5c58de1d 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -191,6 +191,7 @@ class Meta: "info_detail_level_on_failure", "order_reviews_by_level", "burn_reviews", + "repeat_until_correct" ) read_only_fields = ( diff --git a/kw_webapp/migrations/0004_add_repeat_until_correct_setting.py b/kw_webapp/migrations/0004_add_repeat_until_correct_setting.py new file mode 100644 index 00000000..afb516da --- /dev/null +++ b/kw_webapp/migrations/0004_add_repeat_until_correct_setting.py @@ -0,0 +1,16 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('kw_webapp', '0003_vocabulary_manual_reading_whitelist'), + ] + + operations = [ + migrations.AddField( + model_name='profile', + name='repeat_until_correct', + field=models.BooleanField(default=False), + ), + ] diff --git a/kw_webapp/models.py b/kw_webapp/models.py index c07289bf..def829e3 100644 --- a/kw_webapp/models.py +++ b/kw_webapp/models.py @@ -115,6 +115,9 @@ class Profile(models.Model): auto_advance_on_success_delay_milliseconds = models.PositiveIntegerField( default=1000 ) + + repeat_until_correct = models.BooleanField(default=False) + auto_expand_answer_on_success = models.BooleanField(default=True) auto_expand_answer_on_failure = models.BooleanField(default=False) info_detail_level_on_success = models.PositiveIntegerField( diff --git a/kw_webapp/tests/serializers/test_profile_api.py b/kw_webapp/tests/serializers/test_profile_api.py index 3c38eb42..ebe845dd 100644 --- a/kw_webapp/tests/serializers/test_profile_api.py +++ b/kw_webapp/tests/serializers/test_profile_api.py @@ -54,6 +54,7 @@ def test_profile_contains_expected_fields(self): self.assertIsNotNone(data["show_kanji_svg_stroke_order"]) self.assertIsNotNone(data["show_kanji_svg_grid"]) self.assertIsNotNone(data["kanji_svg_draw_speed"]) + self.assertIsNotNone(data["repeat_until_correct"]) def test_updating_profile_triggers_srs_correctly(self): self.client.force_login(user=self.user)