/+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: Gustav Hartvigsson
  • Date: 2011-01-10 18:31:12 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20110110183112-x8lk1f7va1c33wyh
added the beginings of the "plotter"

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
 
        
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
 
        
 
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("""
22
40
        sqlStringEnd = ");"
23
41
        
24
42
        
208
226
                else:
209
227
                        awnserSheet.addToSqlString(q)
210
228
                
211
 
        
212
229
        def question18():
213
230
                print("Fråga 18:")
214
231
                print("Blir du deprimerad/nedstämd på våren?")
219
236
                        awnserSheet.addToSqlString(q)
220
237
                
221
238
        
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
 
        
243
239
        def questionI():
244
240
                print("Fråga I:")
245
241
                print("Är du gäststuderande här i Sverige?")
249
245
                else:
250
246
                        awnserSheet.addToSqlString(q)
251
247
                
252
 
        
253
248
        def questionII():
254
249
                print("Fråga II")
255
250
                print("Är du född i Sverige?")
259
254
                else:
260
255
                        awnserSheet.addToSqlString(q)
261
256
                
262
 
        
263
257
        def questionIII():
264
258
                print("Fråga III")
265
259
                print("Är en eller båda av dina föreldrar inte födda i Sverige?")
269
263
                else:
270
264
                        awnserSheet.addToSqlString(q)
271
265
                
272
 
        
273
266
        def questionCommentry():
274
267
                print("Komentarer:")
275
268
                print("Skriv en komentar på denna undörsökning:")
276
 
                q = str(input(">>>>>> "))
 
269
                q = str(input(">>>>>>"))
277
270
                awnserSheet.sqlString = awnserSheet.sqlString + " \" " + str(q) + "\" "
278
271
        #
279
272
###
297
290
                awnserSheet.question16()
298
291
                awnserSheet.question17()
299
292
                awnserSheet.question18()
300
 
                awnserSheet.question19()
301
 
                awnserSheet.question20()
302
293
                awnserSheet.questionI()
303
294
                awnserSheet.questionII()
304
295
                awnserSheet.questionIII()