Skip to content

Commit df24b99

Browse files
committed
Merge branch 'release/1.1.0'
2 parents afde5cc + 956b857 commit df24b99

File tree

117 files changed

+956
-2755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+956
-2755
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions

codewof/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Configuration for Django system."""
22

3-
__version__ = "1.0.0"
3+
__version__ = "1.1.0"
44
__version_info__ = tuple(
55
[
66
int(num) if num.isdigit() else num

codewof/config/settings/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@
375375

376376
# Other
377377
# ------------------------------------------------------------------------------
378-
DEPLOYMENT_TYPE = 'local'
378+
DEPLOYMENT_TYPE = env("DEPLOYMENT", default='local')
379379
QUESTIONS_BASE_PATH = os.path.join(str(ROOT_DIR.path("programming")), "content")
380380
CUSTOM_VERTO_TEMPLATES = os.path.join(str(ROOT_DIR.path("utils")), "custom_converter_templates", "")
381381
SAMPLE_DATA_ADMIN_PASSWORD = env('SAMPLE_DATA_ADMIN_PASSWORD', default='password')

codewof/config/settings/production.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
GS_BUCKET_NAME = env('GOOGLE_CLOUD_STORAGE_BUCKET_MEDIA_NAME')
7575
GS_CREDENTIALS = service_account.Credentials.from_service_account_file(env('GOOGLE_APPLICATION_CREDENTIALS')) # noqa: F405,E501
7676
GS_FILE_OVERWRITE = False
77+
GS_DEFAULT_ACL = 'publicRead'
7778

7879
STATIC_URL = 'https://storage.googleapis.com/' + env('GOOGLE_CLOUD_STORAGE_BUCKET_STATIC_NAME') + '/static/' # noqa: F405,E501
7980

codewof/general/forms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from django.core.mail import send_mail, mail_managers
66
from crispy_forms.helper import FormHelper
77
from crispy_forms.layout import Submit
8+
from captcha.fields import ReCaptchaField
89

910
SUBJECT_TEMPLATE = "[CodeWOF] - {}"
1011
MESSAGE_TEMPLATE = "{}\n\n-----\nMessage sent from {}\n-----\ncodeWOF"
@@ -18,6 +19,7 @@ class ContactForm(forms.Form):
1819
subject = forms.CharField(required=True)
1920
message = forms.CharField(widget=forms.Textarea, required=True)
2021
cc_sender = forms.BooleanField(required=False, label='Send a copy to yourself')
22+
captcha = ReCaptchaField()
2123

2224
def send_email(self):
2325
"""Send email if form is valid."""

codewof/general/management/commands/sample-data/nz-schools.csv

Lines changed: 0 additions & 2548 deletions
This file was deleted.

codewof/general/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
app_name = 'general'
77
urlpatterns = [
88
path('', views.HomeView.as_view(), name='home'),
9-
path('about/', views.AboutView.as_view(), name='about'),
9+
# path('about/', views.AboutView.as_view(), name='about'),
10+
path('policies/', views.PolicyView.as_view(), name='policies'),
1011
path('contact-us/', views.ContactView.as_view(), name='contact'),
1112
path('contact-us/success/', views.ContactSuccessView.as_view(), name='contact-success'),
1213
path('faq/', views.FAQView.as_view(), name='faq'),

codewof/general/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ class AboutView(TemplateView):
2020
template_name = 'general/about.html'
2121

2222

23+
class PolicyView(TemplateView):
24+
"""View for website policies page."""
25+
26+
template_name = 'general/policies.html'
27+
28+
2329
class ContactView(FormView):
2430
"""View for website contact page."""
2531

Lines changed: 12 additions & 0 deletions
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def divisible_by_three(x):
2+
for num in x:
3+
if num % 3 == 0:
4+
print(num)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
divisible_by_three([6,97,43,27,99])
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
6
2+
27
3+
99
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
divisible_by_three([1,4,98])

codewof/programming/content/en/divisible-by-3/test-case-2-output.txt

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
divisible_by_three([-3,105,-936, 65, 33, 90])
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-3
2+
105
3+
-936
4+
33
5+
90
Lines changed: 1 addition & 1 deletion
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def smallest_number(numbers):
2+
smallest = numbers[0]
3+
for num in numbers:
4+
if num < smallest:
5+
smallest = num
6+
return smallest
Lines changed: 6 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def smallest_number(numbers):
2+
smallest = numbers[0]
3+
for num in numbers:
4+
if num < smallest:
5+
smallest = num
6+
return smallest
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(smallest_number([3, 5, 6, 7, 4, 2]))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(smallest_number([4, 5, 8, 3, 2, 1]))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(smallest_number([-1, 2, 3, 4, 5]))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(smallest_number([10, 4, 18, 5, 187]))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(smallest_number([-10, -20, -30, -18, -4]))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-30
Lines changed: 7 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
password = input("What is the password? ")
2+
while len(password) < 5:
3+
print("No, this password is not good enough")
4+
password = input("What is the password? ")
5+
print("Thank you, your password is good enough")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
add
2+
fall
3+
join
4+
name
5+
off
6+
on
7+
after
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
No, this password is not good enough
2+
No, this password is not good enough
3+
No, this password is not good enough
4+
No, this password is not good enough
5+
No, this password is not good enough
6+
No, this password is not good enough
7+
Thank you, your password is good enough
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
holiday
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Thank you, your password is good enough
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
job
2+
minute
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
No, this password is not good enough
2+
Thank you, your password is good enough
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
map
2+
open
3+
page
4+
put
5+
whiteboard
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
No, this password is not good enough
2+
No, this password is not good enough
3+
No, this password is not good enough
4+
No, this password is not good enough
5+
Thank you, your password is good enough
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
neck
2+
knee
3+
head
4+
structure
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
No, this password is not good enough
2+
No, this password is not good enough
3+
No, this password is not good enough
4+
Thank you, your password is good enough

codewof/programming/content/en/over-the-limit/question.md

Lines changed: 1 addition & 1 deletion
Lines changed: 8 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def reverse_string(string):
2+
reverse = ''
3+
for char in range(len(string) - 1, -1, -1):
4+
reverse += string[char]
5+
print(reverse)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
reverse_string('Mountain')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
niatnuoM
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
reverse_string('I love Python')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nohtyP evol I
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
reverse_string('')

codewof/programming/content/en/reverse-string/test-case-3-output.txt

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
words = input("Words please: ")
2+
for char in words:
3+
print(char)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Example
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
E
2+
x
3+
a
4+
m
5+
p
6+
l
7+
e
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello-World!
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
H
2+
e
3+
l
4+
l
5+
o
6+
-
7+
W
8+
o
9+
r
10+
l
11+
d
12+
!

codewof/programming/content/en/rotate-words/test-case-3-input.txt

Whitespace-only changes.

codewof/programming/content/en/rotate-words/test-case-3-output.txt

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Testing-testing...
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
T
2+
e
3+
s
4+
t
5+
i
6+
n
7+
g
8+
-
9+
t
10+
e
11+
s
12+
t
13+
i
14+
n
15+
g
16+
.
17+
.
18+
.
Lines changed: 1 addition & 1 deletion
Lines changed: 9 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def print_shopping_list(shopping_list):
2+
for item in shopping_list:
3+
print("[] " + item)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print_shopping_list(['Apples', 'Bananas', 'Taro'])
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[] Apples
2+
[] Bananas
3+
[] Taro
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print_shopping_list(['Oranges', 'Cereal', 'Broccoli', 'Gold Kumara'])
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[] Oranges
2+
[] Cereal
3+
[] Broccoli
4+
[] Gold Kumara
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print_shopping_list(['Bread', 'Mushrooms'])
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[] Bread
2+
[] Mushrooms
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print_shopping_list(['Onions', 'Garlic', 'Capsicum', 'Pineapple'])
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[] Onions
2+
[] Garlic
3+
[] Capsicum
4+
[] Pineapple
Lines changed: 14 additions & 0 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def triangle(x):
2+
if x <= 1:
3+
print("That isn't a triangle!")
4+
else:
5+
for i in range(1, x+1):
6+
print(i * '*')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
triangle(5)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
**
3+
***
4+
****
5+
*****
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
triangle(1)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
That isn't a triangle!

0 commit comments

Comments
 (0)