-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopulate_challenges.py
More file actions
175 lines (168 loc) · 5.1 KB
/
populate_challenges.py
File metadata and controls
175 lines (168 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import os
import django
# Set up Django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'funbit.settings')
django.setup()
from challenges.models import Challenge
# Sample challenges
challenges = [
{
'title': 'Take a Funny Selfie',
'description': 'Make a silly face and take a selfie.',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Draw a Cat',
'description': 'Draw a cat, even if it looks funny!',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Say Hello in 3 Languages',
'description': 'Write how to say "Hello" in three different languages.',
'points': 10,
'requires_image': False,
'requires_text': True,
},
{
'title': 'Make a Sock Puppet',
'description': 'Make a quick sock puppet and show it.',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Describe Your Mood with an Emoji',
'description': 'Use just emojis to show how you feel today.',
'points': 10,
'requires_image': False,
'requires_text': True,
},
{
'title': 'Take a Picture of Your Shoes',
'description': 'Snap a photo of whatever shoes you’re wearing.',
'points': 5,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Write a 2-line Poem',
'description': 'Make a short and simple 2-line poem.',
'points': 10,
'requires_image': False,
'requires_text': True,
},
{
'title': 'Show Your Favorite Mug',
'description': 'Take a picture of your favorite mug or cup.',
'points': 5,
'requires_image': True,
'requires_text': False,
},
{
'title': 'What’s for Lunch?',
'description': 'Take a photo of your lunch today.',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'One Word to Describe Today',
'description': 'Write one word that sums up your day.',
'points': 5,
'requires_image': False,
'requires_text': True,
},
{
'title': 'Take a Picture of the Sky',
'description': 'Look up! Take a photo of the sky where you are.',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Make a Face with Food',
'description': 'Arrange food to look like a face and take a photo.',
'points': 15,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Favorite Color',
'description': 'Show something that’s your favorite color.',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Write a Joke',
'description': 'Make up a simple joke and write it down.',
'points': 10,
'requires_image': False,
'requires_text': True,
},
{
'title': 'Pretend You’re a Superhero',
'description': 'What would your superhero name and power be?',
'points': 10,
'requires_image': False,
'requires_text': True,
},
{
'title': 'Show Your Pet (or a Toy)',
'description': 'Take a photo of your pet. No pet? Use a toy!',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Dance Pose!',
'description': 'Strike a dance pose and snap a picture.',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Draw a Happy Face',
'description': 'Draw a smiley face however you like!',
'points': 5,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Write Your Name Backwards',
'description': 'Can you write your name backwards?',
'points': 5,
'requires_image': False,
'requires_text': True,
},
{
'title': 'Show a Book You Like',
'description': 'Take a picture of a book you enjoy or want to read.',
'points': 10,
'requires_image': True,
'requires_text': False,
},
{
'title': 'Draw a House',
'description': 'Draw a simple house—stick figures welcome!',
'points': 10,
'requires_image': True,
'requires_text': False,
},
]
# Create challenges
for challenge_data in challenges:
Challenge.objects.get_or_create(
title=challenge_data['title'],
defaults={
'description': challenge_data['description'],
'points': challenge_data['points'],
'requires_image': challenge_data['requires_image'],
'requires_text': challenge_data['requires_text'],
}
)
print(f"Added {len(challenges)} challenges to the database!")