· 8 years ago · Nov 27, 2017, 03:56 AM
1String sql = "CREATE TABLE IF NOT EXISTS " + TABLE_QUEST + " ( "
2 + KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_QUES
3 + " TEXT, " + KEY_ANSWER+ " TEXT, "+KEY_LVL+" INTEGER, "+KEY_OPTA +" TEXT, "
4 +KEY_OPTB +" TEXT,"+KEY_OPTC+" TEXT,"+KEY_OPTD+" TEXT)";
5 db.execSQL(sql);
6
7Question q1=new Question("10Which company is the largest manufacturer" +
8 " of network equipment?","HP3", "IBM", "CISCO", "Y","C", 1);
9 this.addQuestion(q1);
10 Log.d("LogPedro","Q2");
11 Question q2=new Question("10Which of the following is NOT " +
12 "an operating system?", "SuSe", "BIOS", "DOS", "Y","B",1);
13 this.addQuestion(q2);
14 Log.d("LogPedro","Q3");
15 Question q3=new Question("10Which of the following is the fastest" +
16 " writable memory?","RAM", "FLASH","Register","Y","C",1);
17 this.addQuestion(q3);
18 Log.d("LogPedro","Q4");
19 Question q4=new Question("10Which of the following device" +
20 " regulates internet traffic?", "Router", "Bridge", "Hub","Y","A",1);
21 this.addQuestion(q4);
22 Log.d("LogPedro","Q5");
23 Question q5=new Question("10Which of the following is NOT an" +
24 " interpreted language?","Ruby","Python","BASIC","Y","C",1);
25 this.addQuestion(q5);
26 Log.d("LogPedro","Q6");
27 Question q6=new Question("20Which company is the largest manufacturer" +
28 " of network equipment?","HP3", "IBM", "CISCO", "Y","C", 1);
29 this.addQuestion(q6);
30 Log.d("LogPedro","Q7");
31 Question q7=new Question("20Which of the following is NOT " +
32 "an operating system?", "SuSe", "BIOS", "DOS", "Y","B",1);
33 this.addQuestion(q7);
34 Log.d("LogPedro","Q8");
35 Question q8=new Question("20Which of the following is the fastest" +
36 " writable memory?","RAM", "FLASH","Register","Y","C",1);
37 this.addQuestion(q8);
38 Log.d("LogPedro","Q9");
39 Question q9=new Question("20Which of the following device" +
40 " regulates internet traffic?", "Router", "Bridge", "Hub","Y","A",1);
41 this.addQuestion(q9);
42 Log.d("LogPedro","Q10");
43 Question q10=new Question("20Which of the following is NOT an" +
44 " interpreted language?","Ruby","Python","BASIC","Y","C",1);
45 this.addQuestion(q10);
46
47SQLiteStatement s = dbase.compileStatement("SELECT COUNT(*) FROM " + TABLE_QUEST
48 + " WHERE " + KEY_LVL + "=" + level);
49 lvlQtdQ = (int) s.simpleQueryForLong();