diff --git a/CTFd/plugins/dynamic_challenges/__init__.py b/CTFd/plugins/dynamic_challenges/__init__.py index 6af58ad8..e5d511bc 100644 --- a/CTFd/plugins/dynamic_challenges/__init__.py +++ b/CTFd/plugins/dynamic_challenges/__init__.py @@ -22,7 +22,7 @@ class DynamicChallenge(Challenges): def __init__(self, *args, **kwargs): super(DynamicChallenge, self).__init__(**kwargs) - self.initial = kwargs["value"] + self.value = kwargs["initial"] class DynamicValueChallenge(BaseChallenge): diff --git a/CTFd/plugins/dynamic_challenges/assets/create.html b/CTFd/plugins/dynamic_challenges/assets/create.html index 8dbda3a6..c6e261e8 100644 --- a/CTFd/plugins/dynamic_challenges/assets/create.html +++ b/CTFd/plugins/dynamic_challenges/assets/create.html @@ -15,7 +15,7 @@ This is how many points the challenge is worth initially. - + diff --git a/tests/challenges/test_challenge_types.py b/tests/challenges/test_challenge_types.py index b640eead..e2aa60f7 100644 --- a/tests/challenges/test_challenge_types.py +++ b/tests/challenges/test_challenge_types.py @@ -16,7 +16,7 @@ def test_missing_challenge_type(): "name": "name", "category": "category", "description": "description", - "value": 100, + "initial": 100, "decay": 20, "minimum": 1, "state": "visible", diff --git a/tests/challenges/test_dynamic.py b/tests/challenges/test_dynamic.py index e7ce3aeb..fd8995e2 100644 --- a/tests/challenges/test_dynamic.py +++ b/tests/challenges/test_dynamic.py @@ -26,7 +26,7 @@ def test_can_create_dynamic_challenge(): "name": "name", "category": "category", "description": "description", - "value": 100, + "initial": 100, "decay": 20, "minimum": 1, "state": "hidden", @@ -54,7 +54,7 @@ def test_can_update_dynamic_challenge(): "name": "name", "category": "category", "description": "description", - "value": 100, + "initial": 100, "decay": 20, "minimum": 1, "state": "hidden", @@ -102,7 +102,7 @@ def test_can_add_requirement_dynamic_challenge(): "name": "name", "category": "category", "description": "description", - "value": 100, + "initial": 100, "decay": 20, "minimum": 1, "state": "hidden", @@ -160,7 +160,7 @@ def test_can_delete_dynamic_challenge(): "name": "name", "category": "category", "description": "description", - "value": 100, + "initial": 100, "decay": 20, "minimum": 1, "state": "hidden", @@ -191,7 +191,7 @@ def test_dynamic_challenge_loses_value_properly(): "name": "name", "category": "category", "description": "description", - "value": 100, + "initial": 100, "decay": 20, "minimum": 1, "state": "visible", @@ -240,7 +240,7 @@ def test_dynamic_challenge_doesnt_lose_value_on_update(): "name": "name", "category": "category", "description": "description", - "value": 10000, + "initial": 10000, "decay": 4, "minimum": 10, "state": "visible", @@ -273,7 +273,7 @@ def test_dynamic_challenge_value_isnt_affected_by_hidden_users(): "name": "name", "category": "category", "description": "description", - "value": 100, + "initial": 100, "decay": 20, "minimum": 1, "state": "visible", @@ -330,7 +330,7 @@ def test_dynamic_challenges_reset(): "name": "name", "category": "category", "description": "description", - "value": 100, + "initial": 100, "decay": 20, "minimum": 1, "state": "hidden",