Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store "repeat until correct" user setting #505

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class Meta:
"info_detail_level_on_failure",
"order_reviews_by_level",
"burn_reviews",
"repeat_until_correct"
)

read_only_fields = (
Expand Down
16 changes: 16 additions & 0 deletions kw_webapp/migrations/0004_add_repeat_until_correct_setting.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
3 changes: 3 additions & 0 deletions kw_webapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions kw_webapp/tests/serializers/test_profile_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down