/+junk/Dataanalys

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/Dataanalys

« back to all changes in this revision

Viewing changes to awnser_sheet.py

  • Committer: Gusatv Hartvigsson
  • Date: 2011-01-17 13:05:47 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20110117130547-mt3opoh1ktoe08vo
Added a few questions to the program, made use of the sqlAwnsersStart.sql"
file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
class awnserSheet:
13
13
        """" This returns the sql string that is built up during the prosses """
14
14
        sqlString = str(" ") # the strin that is going to be commited.
15
 
        sqlStringStart = """insert into awnsers(
16
 
"gudar",
17
 
"spoken",
18
 
"religos",
19
 
"sekulart",
20
 
"vegan",
21
 
"mars",
22
 
"globaluppvarmning",
23
 
"manen",
24
 
"motion",
25
 
"sund",
26
 
"deprimerad_host",
27
 
"sno",
28
 
"oppet",
29
 
"dodsstraff",
30
 
"kvinnors_rattigheter",
31
 
"abort",
32
 
"kvinnors_kropp",
33
 
"deprimerad_var",
34
 
"gast_sverige",
35
 
"fodd_sverige",
36
 
"foraldrar_sverige",
37
 
"komentarer"
38
 
)
39
 
values("""
 
15
        
 
16
        ##This brings in the values and the sql string from sqlAwnsersStrat
 
17
        # and uses them as a string.
 
18
        f = open("./sqlAwnsersStrat.sql")
 
19
        sqlStringStart = f.read()
 
20
        f.close()
 
21
        
40
22
        sqlStringEnd = ");"
41
23
        
42
24
        
226
208
                else:
227
209
                        awnserSheet.addToSqlString(q)
228
210
                
 
211
        
229
212
        def question18():
230
213
                print("Fråga 18:")
231
214
                print("Blir du deprimerad/nedstämd på våren?")
236
219
                        awnserSheet.addToSqlString(q)
237
220
                
238
221
        
 
222
        def question19():
 
223
                print("Fråga 19:")
 
224
                print("Tror du på den vetenskapliga metoden?")
 
225
                q = awnserSheet.qinput()
 
226
                if(q == " -1"):
 
227
                        awnserSheet.question18()
 
228
                else:
 
229
                        awnserSheet.addToSqlString(q)
 
230
                
 
231
        
 
232
        def question20():
 
233
                print("Fråga 20:")
 
234
                print("""Tror du att evolutionen som beskrivs i den morerna
 
235
                vetenskapen är ursprunget till de många arterna på denna planet?""")
 
236
                q = awnserSheet.qinput()
 
237
                if(q == " -1"):
 
238
                        awnserSheet.question18()
 
239
                else:
 
240
                        awnserSheet.addToSqlString(q)
 
241
                
 
242
        
239
243
        def questionI():
240
244
                print("Fråga I:")
241
245
                print("Är du gäststuderande här i Sverige?")
245
249
                else:
246
250
                        awnserSheet.addToSqlString(q)
247
251
                
 
252
        
248
253
        def questionII():
249
254
                print("Fråga II")
250
255
                print("Är du född i Sverige?")
254
259
                else:
255
260
                        awnserSheet.addToSqlString(q)
256
261
                
 
262
        
257
263
        def questionIII():
258
264
                print("Fråga III")
259
265
                print("Är en eller båda av dina föreldrar inte födda i Sverige?")
263
269
                else:
264
270
                        awnserSheet.addToSqlString(q)
265
271
                
 
272
        
266
273
        def questionCommentry():
267
274
                print("Komentarer:")
268
275
                print("Skriv en komentar på denna undörsökning:")
269
 
                q = str(input(">>>>>>"))
 
276
                q = str(input(">>>>>> "))
270
277
                awnserSheet.sqlString = awnserSheet.sqlString + " \" " + str(q) + "\" "
271
278
        #
272
279
###
290
297
                awnserSheet.question16()
291
298
                awnserSheet.question17()
292
299
                awnserSheet.question18()
 
300
                awnserSheet.question19()
 
301
                awnserSheet.question20()
293
302
                awnserSheet.questionI()
294
303
                awnserSheet.questionII()
295
304
                awnserSheet.questionIII()