Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 11 | Rev 24 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 19
Línea 8... Línea 8...
8
import UIKit
8
import UIKit
9
import SQLite3
9
import SQLite3
Línea 10... Línea 10...
10
 
10
 
11
class ProgressDao {
11
class ProgressDao {
12
    private let SQLITE_TRANSIENT = unsafeBitCast(-1, to: sqlite3_destructor_type.self)
12
    private let SQLITE_TRANSIENT = unsafeBitCast(-1, to: sqlite3_destructor_type.self)
Línea 13... Línea 13...
13
    private var db : OpaquePointer?
13
    private var database = Database.sharedInstance
14
    
14
    
Línea 15... Línea 15...
15
    static let sharedInstance: ProgressDao = {
15
    static let sharedInstance: ProgressDao = {
16
           let instance = ProgressDao()
16
           let instance = ProgressDao()
17
           
17
           
18
           // setup code
18
           // setup code
19
           return instance
-
 
20
    }()
-
 
21
    
-
 
22
    init() {
-
 
23
        self.db = Database.sharedInstance.open()
19
           return instance
-
 
20
    }()
24
    }
21
 
25
    
22
    func selectByTopicUuid(topicUuid: String)-> ProgressModel {
26
    func selectByTopicUuid(topicUuid: String)-> ProgressModel {
23
        let db = database.open()
27
        //var records = [ProgressModel]()
24
        //var records = [ProgressModel]()
28
        var model = ProgressModel()
25
        var model = ProgressModel()
Línea 64... Línea 61...
64
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
61
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
65
                model.completed = Int(sqlite3_column_int(statement, 12))
62
                model.completed = Int(sqlite3_column_int(statement, 12))
66
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
63
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
67
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
64
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
68
            }
65
            }
-
 
66
        } else {
-
 
67
            database.printError()
69
        }
68
        }
70
        sqlite3_finalize(statement)
69
        sqlite3_finalize(statement)
71
        return model
70
        return model
72
    }
71
    }
Línea 73... Línea 72...
73
    
72
    
-
 
73
    
74
    
74
    func selectByTopicUuidAndUserUuid(topicUuid: String, userUuid : String)-> ProgressModel {
75
    func selectByTopicUuidAndUserUuid(topicUuid: String, userUuid : String)-> ProgressModel {
75
        let db = database.open()
76
        //var records = [ProgressModel]()
76
        //var records = [ProgressModel]()
77
        var model = ProgressModel()
77
        var model = ProgressModel()
78
        var query = "SELECT "
78
        var query = "SELECT "
Línea 114... Línea 114...
114
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
114
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
115
                model.completed = Int(sqlite3_column_int(statement, 12))
115
                model.completed = Int(sqlite3_column_int(statement, 12))
116
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
116
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
117
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
117
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
118
            }
118
            }
-
 
119
        } else {
-
 
120
            database.printError()
119
        }
121
        }
120
        sqlite3_finalize(statement)
122
        sqlite3_finalize(statement)
121
        return model
123
        return model
122
    }
124
    }
Línea 123... Línea 125...
123
    
125
    
-
 
126
    func selectByCapsuleUuid(capsuleUuid: String)-> ProgressModel {
124
    func selectByCapsuleUuid(capsuleUuid: String)-> ProgressModel {
127
        let db = database.open()
125
        //var records = [ProgressModel]()
128
        //var records = [ProgressModel]()
126
        var model = ProgressModel()
129
        var model = ProgressModel()
127
        var query = "SELECT "
130
        var query = "SELECT "
128
        query = query +  Constants.TABLE_PROGRESS_FIELD_ID + " , "
131
        query = query +  Constants.TABLE_PROGRESS_FIELD_ID + " , "
Línea 162... Línea 165...
162
                model.type = String(describing: String(cString: sqlite3_column_text(statement, 9)))
165
                model.type = String(describing: String(cString: sqlite3_column_text(statement, 9)))
163
                model.returning = Int(sqlite3_column_int(statement, 10))
166
                model.returning = Int(sqlite3_column_int(statement, 10))
164
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
167
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
165
                model.completed = Int(sqlite3_column_int(statement, 12))
168
                model.completed = Int(sqlite3_column_int(statement, 12))
166
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
169
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
167
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))            }
170
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
-
 
171
                
-
 
172
            }
-
 
173
        } else {
-
 
174
            database.printError()
168
        }
175
        }
169
        sqlite3_finalize(statement)
176
        sqlite3_finalize(statement)
170
        return model
177
        return model
Línea 171... Línea 178...
171
        
178
        
Línea 172... Línea 179...
172
    }
179
    }
-
 
180
    
173
    
181
    func selectByCapsuleUuidAndUserUuid(capsuleUuid: String, userUuid : String)-> ProgressModel {
174
    func selectByCapsuleUuidAndUserUuid(capsuleUuid: String, userUuid : String)-> ProgressModel {
182
        let db = database.open()
175
        //var records = [ProgressModel]()
183
        //var records = [ProgressModel]()
176
        var model = ProgressModel()
184
        var model = ProgressModel()
177
        var query  = "SELECT "
185
        var query  = "SELECT "
Línea 212... Línea 220...
212
                model.type = String(describing: String(cString: sqlite3_column_text(statement, 9)))
220
                model.type = String(describing: String(cString: sqlite3_column_text(statement, 9)))
213
                model.returning = Int(sqlite3_column_int(statement, 10))
221
                model.returning = Int(sqlite3_column_int(statement, 10))
214
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
222
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
215
                model.completed = Int(sqlite3_column_int(statement, 12))
223
                model.completed = Int(sqlite3_column_int(statement, 12))
216
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
224
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
217
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))            }
225
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
-
 
226
                
-
 
227
            }
-
 
228
        } else {
-
 
229
            database.printError()
218
        }
230
        }
219
        sqlite3_finalize(statement)
231
        sqlite3_finalize(statement)
220
        return model
232
        return model
Línea 221... Línea 233...
221
        
233
        
Línea 222... Línea 234...
222
    }
234
    }
-
 
235
 
223
 
236
    func selectBySlideUuid(slideUuid: String)-> ProgressModel {
224
    func selectBySlideUuid(slideUuid: String)-> ProgressModel {
237
        let db = database.open()
225
        //var records = [ProgressModel]()
238
        //var records = [ProgressModel]()
226
        var model = ProgressModel()
239
        var model = ProgressModel()
227
        var query = "SELECT "
240
        var query = "SELECT "
Línea 263... Línea 276...
263
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
276
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
264
                model.completed = Int(sqlite3_column_int(statement, 12))
277
                model.completed = Int(sqlite3_column_int(statement, 12))
265
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
278
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
266
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
279
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
267
            }
280
            }
-
 
281
        } else {
-
 
282
            database.printError()
268
        }
283
        }
269
        sqlite3_finalize(statement)
284
        sqlite3_finalize(statement)
270
        return model
285
        return model
271
    }
286
    }
Línea 272... Línea 287...
272
    
287
    
-
 
288
    
273
    
289
    func selectBySlideUuidAndUserUuid(slideUuid: String, userUuid : String)-> ProgressModel {
274
    func selectBySlideUuidAndUserUuid(slideUuid: String, userUuid : String)-> ProgressModel {
290
        let db = database.open()
275
        //var records = [ProgressModel]()
291
        //var records = [ProgressModel]()
276
        var model = ProgressModel()
292
        var model = ProgressModel()
277
        var query = "SELECT "
293
        var query = "SELECT "
Línea 314... Línea 330...
314
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
330
                model.returningAfterCompleted = Int(sqlite3_column_int(statement, 11))
315
                model.completed = Int(sqlite3_column_int(statement, 12))
331
                model.completed = Int(sqlite3_column_int(statement, 12))
316
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
332
                model.addedOn = String(describing: String(cString: sqlite3_column_text(statement, 13)))
317
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
333
                model.updatedOn = String(describing: String(cString: sqlite3_column_text(statement, 14)))
318
            }
334
            }
-
 
335
        } else {
-
 
336
            database.printError()
319
        }
337
        }
320
        sqlite3_finalize(statement)
338
        sqlite3_finalize(statement)
321
        return model
339
        return model
322
    }
340
    }
Línea 323... Línea -...
323
 
-
 
324
    /*
-
 
325
    func getCountBycapsuleUuid(capsuleUuid: String) -> Int {
-
 
326
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
-
 
327
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_ID + " = '\(capsuleUuid)' "  +
-
 
328
        " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)'"
-
 
329
 
-
 
330
        var statement : OpaquePointer? = nil
-
 
331
        var count = 0;
-
 
332
        
-
 
333
            
-
 
334
        
-
 
335
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
336
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
337
                count = Int(sqlite3_column_int(statement, 0))
-
 
338
                
-
 
339
            }
-
 
340
         }
-
 
341
        sqlite3_finalize(statement)
-
 
342
        return count;
-
 
343
    }
-
 
344
    
-
 
345
    func getCountWithoutBycapsuleUuid(capsuleUuid: String) -> Int {
-
 
346
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
-
 
347
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_ID + " = '\(capsuleUuid)' "  +
-
 
348
            " AND " + Constants.TABLE_PROGRESS_FIELD_RETURNING + " = 0 " +
-
 
349
        " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)'"
-
 
350
 
-
 
351
        var statement : OpaquePointer? = nil
-
 
352
        var count = 0;
-
 
353
        
-
 
354
            
-
 
355
        
-
 
356
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
357
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
358
                count = Int(sqlite3_column_int(statement, 0))
-
 
359
                
-
 
360
            }
-
 
361
         }
-
 
362
        sqlite3_finalize(statement)
-
 
363
        return count;
-
 
364
    }
-
 
365
    
-
 
366
    func getCountWithReturningBycapsuleUuid(capsuleUuid: String) -> Int {
-
 
367
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
-
 
368
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_ID + " = '\(capsuleUuid)' "  +
-
 
369
        " AND " + Constants.TABLE_PROGRESS_FIELD_RETURNING + " > 0 " +
-
 
370
        " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)'"
-
 
371
 
-
 
372
        var statement : OpaquePointer? = nil
-
 
373
        var count = 0;
-
 
374
        
-
 
375
            
-
 
376
        
-
 
377
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
378
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
379
                count = Int(sqlite3_column_int(statement, 0))
-
 
380
                
-
 
381
            }
-
 
382
         }
-
 
383
        sqlite3_finalize(statement)
-
 
384
        return count;
-
 
385
    }
-
 
386
    
-
 
387
    func getCountCompletedBycapsuleUuid(capsuleUuid: String) -> Int {
-
 
388
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
-
 
389
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_ID + " = '\(capsuleUuid)' "  +
-
 
390
        " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)'" +
-
 
391
        " AND " +  Constants.TABLE_PROGRESS_FIELD_COMPLETED + "  =  1 "
-
 
392
        
-
 
393
        var statement : OpaquePointer? = nil
-
 
394
        var count = 0;
-
 
395
        
-
 
396
            
-
 
397
        
-
 
398
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
399
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
400
                count = Int(sqlite3_column_int(statement, 0))
-
 
401
                
-
 
402
            }
-
 
403
         }
-
 
404
        sqlite3_finalize(statement)
-
 
405
        return count;
-
 
406
    }
-
 
407
    
-
 
408
    func getCountCompletedWithReturningBycapsuleUuid(capsuleUuid: String) -> Int {
-
 
409
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
-
 
410
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_ID + " = '\(capsuleUuid)' "  +
-
 
411
        " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)'" +
-
 
412
            " AND " +  Constants.TABLE_PROGRESS_FIELD_RETURNING_AFTER_COMPLETED + " > 0 " +
-
 
413
        " AND " +  Constants.TABLE_PROGRESS_FIELD_COMPLETED + "  =  1 "
-
 
414
        
-
 
415
        var statement : OpaquePointer? = nil
-
 
416
        var count = 0;
-
 
417
        
-
 
418
            
-
 
419
        
-
 
420
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
421
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
422
                count = Int(sqlite3_column_int(statement, 0))
-
 
423
                
-
 
424
            }
-
 
425
         }
-
 
426
        sqlite3_finalize(statement)
-
 
427
        return count;
-
 
428
    }
-
 
429
    
-
 
430
    func getCountCompletedWithoutReturningBycapsuleUuid(capsuleUuid: String) -> Int {
-
 
431
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
-
 
432
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_ID + " = '\(capsuleUuid)' "  +
-
 
433
        " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)'" +
-
 
434
            " AND " +  Constants.TABLE_PROGRESS_FIELD_RETURNING_AFTER_COMPLETED + " = 0 " +
-
 
435
        " AND " +  Constants.TABLE_PROGRESS_FIELD_COMPLETED + "  =  1 "
-
 
436
        
-
 
437
        var statement : OpaquePointer? = nil
-
 
438
        var count = 0;
-
 
439
        
-
 
440
            
-
 
441
        
-
 
442
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
443
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
444
                count = Int(sqlite3_column_int(statement, 0))
-
 
445
                
-
 
446
            }
-
 
447
         }
-
 
448
        sqlite3_finalize(statement)
-
 
449
        return count;
-
 
450
    }
-
 
451
    
-
 
452
    func getCountBytopicUuidWithReturning(topicUuid: String) -> Int {
-
 
453
        var count = 0
-
 
454
        var query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS
-
 
455
            query = query + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_ID + " = \(topicUuid) AND "
-
 
456
        +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)' AND " +  Constants.TABLE_PROGRESS_FIELD_RETURNING + " > 1 LIMIT 1"
-
 
457
 
-
 
458
        var statement : OpaquePointer? = nil
-
 
459
        
-
 
460
        
-
 
461
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK){
-
 
462
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
463
                count = Int(sqlite3_column_int(statement, 0))
-
 
464
                //print("\(count)")
-
 
465
            }
-
 
466
        }
-
 
467
        sqlite3_finalize(statement)
-
 
468
        return count
-
 
469
    }
-
 
470
 
-
 
471
    func getCountBytopicUuidWithoutReturning(topicUuid: String) -> Int{
-
 
472
 
-
 
473
        var count = 0
-
 
474
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_ID + " = \(topicUuid) AND "
-
 
475
        +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)' AND " +  Constants.TABLE_PROGRESS_FIELD_RETURNING + " = 0 LIMIT 1"
-
 
476
 
-
 
477
        var statement : OpaquePointer? = nil
-
 
478
        
-
 
479
        
-
 
480
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
481
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
482
                count = Int(sqlite3_column_int(statement, 0))
-
 
483
                //print("\(count)")/
-
 
484
            }
-
 
485
        }
-
 
486
        sqlite3_finalize(statement)
-
 
487
        return count
-
 
488
    }
-
 
489
    
-
 
490
    func getCountCompletedBytopicUuidWithoutReturning(topicUuid: String) -> Int{
-
 
491
 
-
 
492
        var count = 0
-
 
493
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_ID + " = \(topicUuid) " +
-
 
494
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)' " +
-
 
495
            " AND " +  Constants.TABLE_PROGRESS_FIELD_COMPLETED + "=  1 " +
-
 
496
            " AND " +  Constants.TABLE_PROGRESS_FIELD_RETURNING_AFTER_COMPLETED + " = 0 LIMIT 1"
-
 
497
 
-
 
498
        var statement : OpaquePointer? = nil
-
 
499
        
-
 
500
        
-
 
501
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
502
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
503
                count = Int(sqlite3_column_int(statement, 0))
-
 
504
                //print("\(count)")
-
 
505
            }
-
 
506
        }
-
 
507
        sqlite3_finalize(statement)
-
 
508
        return count
-
 
509
    }
-
 
510
    
-
 
511
    func getCountCompletedBytopicUuidWithReturning(topicUuid: String) -> Int{
-
 
512
 
-
 
513
        var count = 0
-
 
514
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_ID + " = \(topicUuid) " +
-
 
515
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_SLIDE)' " +
-
 
516
            " AND " +  Constants.TABLE_PROGRESS_FIELD_COMPLETED + "= 1 " +
-
 
517
            " AND " +  Constants.TABLE_PROGRESS_FIELD_RETURNING_AFTER_COMPLETED + " > 0 LIMIT 1"
-
 
518
 
-
 
519
        var statement : OpaquePointer? = nil
-
 
520
        
-
 
521
        
-
 
522
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
523
            if(sqlite3_step(statement) == SQLITE_ROW){
-
 
524
                count = Int(sqlite3_column_int(statement, 0))
-
 
525
                //print("\(count)")
-
 
526
            }
-
 
527
        }
-
 
528
        sqlite3_finalize(statement)
-
 
529
        return count
-
 
530
    }
-
 
531
    */
341
 
-
 
342
    func getCountSlideCompletedByCapsuleUuidAndUserUuid(capsuleUuid: String, userUuid: String) -> Int {
532
    func getCountSlideCompletedByCapsuleUuidAndUserUuid(capsuleUuid: String, userUuid: String) -> Int {
343
        let db = database.open()
533
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
344
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
534
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_UUID + " = '\(capsuleUuid)' "  +
345
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_UUID + " = '\(capsuleUuid)' "  +
535
        " AND " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + "= '\(userUuid)'" +
346
        " AND " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + "= '\(userUuid)'" +
536
        " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\(Constants.PROGRESS_TYPE_SLIDE)'" +
347
        " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\(Constants.PROGRESS_TYPE_SLIDE)'" +
Línea 544... Línea 355...
544
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
355
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
545
            if(sqlite3_step(statement) == SQLITE_ROW){
356
            if(sqlite3_step(statement) == SQLITE_ROW){
546
                count = Int(sqlite3_column_int(statement, 0))
357
                count = Int(sqlite3_column_int(statement, 0))
Línea 547... Línea 358...
547
                
358
                
-
 
359
            }
-
 
360
        } else {
548
            }
361
            database.printError()
549
         }
362
        }
550
        sqlite3_finalize(statement)
363
        sqlite3_finalize(statement)
551
        return count;
364
        return count;
Línea 552... Línea 365...
552
    }
365
    }
-
 
366
    
553
    
367
    func getCountSlideCompletedByTopicUuidAndUserUuid(topicUuid: String, userUuid: String) -> Int {
554
    func getCountSlideCompletedByTopicUuidAndUserUuid(topicUuid: String, userUuid: String) -> Int {
368
        let db = database.open()
555
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
369
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
556
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + " = '\(topicUuid)' "  +
370
        " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + " = '\(topicUuid)' "  +
557
        " AND " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + "= '\(userUuid)'" +
371
        " AND " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + "= '\(userUuid)'" +
Línea 566... Línea 380...
566
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
380
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
567
            if(sqlite3_step(statement) == SQLITE_ROW){
381
            if(sqlite3_step(statement) == SQLITE_ROW){
568
                count = Int(sqlite3_column_int(statement, 0))
382
                count = Int(sqlite3_column_int(statement, 0))
Línea 569... Línea 383...
569
                
383
                
-
 
384
            }
-
 
385
        } else {
570
            }
386
            database.printError()
571
         }
387
        }
572
        sqlite3_finalize(statement)
388
        sqlite3_finalize(statement)
573
        return count;
389
        return count;
Línea 574... Línea 390...
574
    }
390
    }
-
 
391
    
575
    
392
    func getCountCapsulesCompletedByUserUuid(userUuid : String) -> Int {
576
    func getCountCapsulesCompletedByUserUuid(userUuid : String) -> Int {
393
        let db = database.open()
577
        var count = 0
394
        var count = 0
578
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
395
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
579
            " WHERE " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + " = '\(userUuid)' " +
396
            " WHERE " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + " = '\(userUuid)' " +
Línea 586... Línea 403...
586
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
403
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
587
            if(sqlite3_step(statement) == SQLITE_ROW){
404
            if(sqlite3_step(statement) == SQLITE_ROW){
588
                count = Int(sqlite3_column_int(statement, 0))
405
                count = Int(sqlite3_column_int(statement, 0))
589
                //print("\(count)")
406
                //print("\(count)")
590
            }
407
            }
-
 
408
        } else {
-
 
409
            database.printError()
591
        }
410
        }
592
        sqlite3_finalize(statement)
411
        sqlite3_finalize(statement)
593
        return count
412
        return count
594
    }
413
    }
Línea 595... Línea 414...
595
    
414
    
-
 
415
    func getCountCapsulesIncompletedByUserUuid(userUuid : String) -> Int {
596
    func getCountCapsulesIncompletedByUserUuid(userUuid : String) -> Int {
416
        let db = database.open()
597
        var count = 0
417
        var count = 0
598
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
418
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
599
            " WHERE " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + " = '\(userUuid)' " +
419
            " WHERE " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + " = '\(userUuid)' " +
600
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
420
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
Línea 606... Línea 426...
606
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
426
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
607
            if(sqlite3_step(statement) == SQLITE_ROW){
427
            if(sqlite3_step(statement) == SQLITE_ROW){
608
                count = Int(sqlite3_column_int(statement, 0))
428
                count = Int(sqlite3_column_int(statement, 0))
609
                //print("\(count)")
429
                //print("\(count)")
610
            }
430
            }
-
 
431
        } else {
-
 
432
            database.printError()
611
        }
433
        }
612
        sqlite3_finalize(statement)
434
        sqlite3_finalize(statement)
613
        return count
435
        return count
614
    }
436
    }
Línea 615... Línea 437...
615
    
437
    
-
 
438
    func getCountCapsulesCompletedByTopicUuid(topicUuid : String) -> Int {
616
    func getCountCapsulesCompletedByTopicUuid(topicUuid : String) -> Int {
439
        let db = database.open()
617
        var count = 0
440
        var count = 0
618
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
441
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS +
619
            " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + " = '\(topicUuid)' " +
442
            " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + " = '\(topicUuid)' " +
620
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
443
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
Línea 626... Línea 449...
626
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
449
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
627
            if(sqlite3_step(statement) == SQLITE_ROW){
450
            if(sqlite3_step(statement) == SQLITE_ROW){
628
                count = Int(sqlite3_column_int(statement, 0))
451
                count = Int(sqlite3_column_int(statement, 0))
629
                //print("\(count)")
452
                //print("\(count)")
630
            }
453
            }
-
 
454
        } else {
-
 
455
            database.printError()
631
        }
456
        }
632
        sqlite3_finalize(statement)
457
        sqlite3_finalize(statement)
633
        return count
458
        return count
634
    }
459
    }
Línea 635... Línea 460...
635
    
460
    
-
 
461
    func getCountCapsulesCompletedWithReturningByUserUuid(userUuid : String) -> Int {
636
    func getCountCapsulesCompletedWithReturningByUserUuid(userUuid : String) -> Int {
462
        let db = database.open()
637
        var count = 0
463
        var count = 0
638
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS
464
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS
639
            + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + " = '\(userUuid)' " +
465
            + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + " = '\(userUuid)' " +
640
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
466
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
Línea 647... Línea 473...
647
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
473
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
648
            if(sqlite3_step(statement) == SQLITE_ROW){
474
            if(sqlite3_step(statement) == SQLITE_ROW){
649
                count = Int(sqlite3_column_int(statement, 0))
475
                count = Int(sqlite3_column_int(statement, 0))
650
                //print("\(count)")
476
                //print("\(count)")
651
            }
477
            }
-
 
478
        } else {
-
 
479
            database.printError()
652
        }
480
        }
653
        sqlite3_finalize(statement)
481
        sqlite3_finalize(statement)
654
        return count
482
        return count
655
    }
483
    }
Línea 656... Línea 484...
656
    
484
    
-
 
485
    func getCountCapsulesCompletedWithoutReturningByUserUuid(userUuid : String) -> Int {
657
    func getCountCapsulesCompletedWithoutReturningByUserUuid(userUuid : String) -> Int {
486
        let db = database.open()
658
        var count = 0
487
        var count = 0
659
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS + " WHERE "
488
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS + " WHERE "
660
            +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + " = '\(userUuid)' " +
489
            +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + " = '\(userUuid)' " +
661
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
490
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
Línea 668... Línea 497...
668
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
497
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
669
            if(sqlite3_step(statement) == SQLITE_ROW){
498
            if(sqlite3_step(statement) == SQLITE_ROW){
670
                count = Int(sqlite3_column_int(statement, 0))
499
                count = Int(sqlite3_column_int(statement, 0))
671
                //print("\(count)")
500
                //print("\(count)")
672
            }
501
            }
-
 
502
        } else {
-
 
503
            database.printError()
673
        }
504
        }
674
        sqlite3_finalize(statement)
505
        sqlite3_finalize(statement)
675
        return count
506
        return count
676
    }
507
    }
Línea 677... Línea 508...
677
    
508
    
-
 
509
    func getCountCapsulesCompletedWithReturningByTopicUuid(topicUuid : String) -> Int {
678
    func getCountCapsulesCompletedWithReturningByTopicUuid(topicUuid : String) -> Int {
510
        let db = database.open()
679
        var count = 0
511
        var count = 0
680
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS
512
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS
681
            + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + " = '\(topicUuid)' " +
513
            + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + " = '\(topicUuid)' " +
682
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
514
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
Línea 689... Línea 521...
689
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
521
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
690
            if(sqlite3_step(statement) == SQLITE_ROW){
522
            if(sqlite3_step(statement) == SQLITE_ROW){
691
                count = Int(sqlite3_column_int(statement, 0))
523
                count = Int(sqlite3_column_int(statement, 0))
692
                //print("\(count)")
524
                //print("\(count)")
693
            }
525
            }
-
 
526
        } else {
-
 
527
            database.printError()
694
        }
528
        }
695
        sqlite3_finalize(statement)
529
        sqlite3_finalize(statement)
696
        return count
530
        return count
697
    }
531
    }
Línea 698... Línea 532...
698
    
532
    
-
 
533
    func getCountCapsulesCompletedWithoutReturningByTopicUuid(topicUuid : String) -> Int {
699
    func getCountCapsulesCompletedWithoutReturningByTopicUuid(topicUuid : String) -> Int {
534
        let db = database.open()
700
        var count = 0
535
        var count = 0
701
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS + " WHERE "
536
        let query = "SELECT COUNT(*) AS total FROM " +  Constants.TABLE_PROGRESS + " WHERE "
702
            +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + " = '\(topicUuid)' " +
537
            +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + " = '\(topicUuid)' " +
703
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
538
            " AND " +  Constants.TABLE_PROGRESS_FIELD_TYPE + "= '\( Constants.PROGRESS_TYPE_CAPSULE)' " +
Línea 710... Línea 545...
710
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
545
        if (sqlite3_prepare(db, query, -1, &statement, nil) == SQLITE_OK) {
711
            if(sqlite3_step(statement) == SQLITE_ROW){
546
            if(sqlite3_step(statement) == SQLITE_ROW){
712
                count = Int(sqlite3_column_int(statement, 0))
547
                count = Int(sqlite3_column_int(statement, 0))
713
                //print("\(count)")
548
                //print("\(count)")
714
            }
549
            }
-
 
550
        } else {
-
 
551
            database.printError()
715
        }
552
        }
716
        sqlite3_finalize(statement)
553
        sqlite3_finalize(statement)
717
        return count
554
        return count
718
    }
555
    }
Línea 719... Línea 556...
719
        
556
        
-
 
557
        
720
        
558
    func insert( record : ProgressModel) {
721
    func insert( record : ProgressModel) {
559
        let db = database.open()
722
        var query = "INSERT INTO " +  Constants.TABLE_PROGRESS + " ( "
560
        var query = "INSERT INTO " +  Constants.TABLE_PROGRESS + " ( "
723
        query = query +  Constants.TABLE_PROGRESS_FIELD_COMPANY_UUID + ", "
561
        query = query +  Constants.TABLE_PROGRESS_FIELD_COMPANY_UUID + ", "
724
        query = query +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + ", "
562
        query = query +  Constants.TABLE_PROGRESS_FIELD_USER_UUID + ", "
Línea 755... Línea 593...
755
            sqlite3_bind_int(statement, 12, Int32(record.completed))
593
            sqlite3_bind_int(statement, 12, Int32(record.completed))
756
            sqlite3_bind_text(statement, 13, record.addedOn, -1, SQLITE_TRANSIENT)
594
            sqlite3_bind_text(statement, 13, record.addedOn, -1, SQLITE_TRANSIENT)
757
            sqlite3_bind_text(statement, 14, record.updatedOn, -1, SQLITE_TRANSIENT)
595
            sqlite3_bind_text(statement, 14, record.updatedOn, -1, SQLITE_TRANSIENT)
Línea 758... Línea 596...
758
            
596
            
759
           if sqlite3_step(statement) != SQLITE_DONE {
597
           if sqlite3_step(statement) != SQLITE_DONE {
-
 
598
                print("No se pudo insertar un registro en la tabla: \(Constants.TABLE_PROGRESS)")
Línea 760... Línea 599...
760
            print("No se pudo insertar un registro en la tabla: \(Constants.TABLE_PROGRESS)")
599
                database.printError()
761
               
600
               
762
           } else {
601
           } else {
763
             print("insertamos un registro de progreso")
602
             print("insertamos un registro de progreso")
764
           }
603
           }
-
 
604
        } else {
765
        } else {
605
            print("No se pudo preparar insertar un registro en la tabla: \(Constants.TABLE_PROGRESS)")
Línea 766... Línea 606...
766
            print("No se pudo preparar insertar un registro en la tabla: \(Constants.TABLE_PROGRESS)")
606
            database.printError()
767
        }
607
        }
Línea 768... Línea 608...
768
       
608
       
-
 
609
        sqlite3_finalize(statement)
769
        sqlite3_finalize(statement)
610
    }
770
    }
611
 
771
 
612
    func update(record : ProgressModel) {
772
    func update(record : ProgressModel) {
613
        let db = database.open()
773
        var query = "UPDATE " +  Constants.TABLE_PROGRESS
614
        var query = "UPDATE " +  Constants.TABLE_PROGRESS
Línea 781... Línea 622...
781
        
622
        
782
        var statement : OpaquePointer? = nil
623
        var statement : OpaquePointer? = nil
783
        if (sqlite3_prepare_v2(db, query, -1, &statement, nil) == SQLITE_OK) {
624
        if (sqlite3_prepare_v2(db, query, -1, &statement, nil) == SQLITE_OK) {
784
            if sqlite3_step(statement) != SQLITE_DONE {
625
            if sqlite3_step(statement) != SQLITE_DONE {
-
 
626
                print("No se pudo actualizar un registro en la tabla: \(Constants.TABLE_PROGRESS)")
785
                print("No se pudo actualizar un registro en la tabla: \(Constants.TABLE_PROGRESS)")
627
                database.printError()
786
            }
628
            }
787
        } else {
629
        } else {
-
 
630
            print("Fallo la preparación de actualizar un registro en la tabla: \(Constants.TABLE_PROGRESS)")
788
            print("Fallo la preparación de actualizar un registro en la tabla: \(Constants.TABLE_PROGRESS)")
631
            database.printError()
789
        }
632
        }
790
        sqlite3_finalize(statement)
633
        sqlite3_finalize(statement)
Línea 791... Línea 634...
791
    }
634
    }
-
 
635
 
792
 
636
    func remove(id: Int) {
793
    func remove(id: Int) {
637
        let db = database.open()
794
        let query = "DELETE FROM " +  Constants.TABLE_PROGRESS + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_ID + " = " + "\(id) ;"
638
        let query = "DELETE FROM " +  Constants.TABLE_PROGRESS + " WHERE " +  Constants.TABLE_PROGRESS_FIELD_ID + " = " + "\(id) ;"
795
        var statement : OpaquePointer? = nil
639
        var statement : OpaquePointer? = nil
796
        if (sqlite3_prepare_v2(db, query, -1, &statement, nil) == SQLITE_OK) {
640
        if (sqlite3_prepare_v2(db, query, -1, &statement, nil) == SQLITE_OK) {
-
 
641
            if sqlite3_step(statement) != SQLITE_DONE {
797
            if sqlite3_step(statement) != SQLITE_DONE {
642
                print("No se pudo borrar un registro con el id: \(id) en la tabla: \(Constants.TABLE_PROGRESS)")
798
                print("No se pudo borrar un registro con el id: \(id) en la tabla: \(Constants.TABLE_PROGRESS)")
643
                database.printError()
799
            }
644
            }
-
 
645
        } else {
800
        } else {
646
            print("Fallo la preparación de borrar un registro con el id: \(id) en la tabla: \(Constants.TABLE_PROGRESS)")
801
            print("Fallo la preparación de borrar un registro con el id: \(id) en la tabla: \(Constants.TABLE_PROGRESS)")
647
            database.printError()
802
        }
648
        }
Línea 803... Línea 649...
803
        sqlite3_finalize(statement)
649
        sqlite3_finalize(statement)
-
 
650
    }
804
    }
651
 
805
 
652
    func removeAll() {
806
    func removeAll() {
653
        let db = database.open()
807
        let query = "DELETE FROM " +  Constants.TABLE_PROGRESS + ";"
654
        let query = "DELETE FROM " +  Constants.TABLE_PROGRESS + ";"
808
        var statement : OpaquePointer? = nil
655
        var statement : OpaquePointer? = nil
-
 
656
        if (sqlite3_prepare_v2(db, query, -1, &statement, nil) == SQLITE_OK) {
809
        if (sqlite3_prepare_v2(db, query, -1, &statement, nil) == SQLITE_OK) {
657
            if sqlite3_step(statement) != SQLITE_DONE {
810
            if sqlite3_step(statement) != SQLITE_DONE {
658
                print("No se pudo borrar todos los registros en la tabla: \(Constants.TABLE_PROGRESS)")
811
                print("No se pudo borrar todos los registros en la tabla: \(Constants.TABLE_PROGRESS)")
659
                database.printError()
-
 
660
            }
812
            }
661
        } else {
813
        } else {
662
            print("Fallo la preparación de borrar todos los registros en la tabla: \(Constants.TABLE_PROGRESS)")
814
            print("Fallo la preparación de borrar todos los registros en la tabla: \(Constants.TABLE_PROGRESS)")
663
            database.printError()
Línea 815... Línea 664...
815
        }
664
        }
816
        sqlite3_finalize(statement)
665
        sqlite3_finalize(statement)
-
 
666
    }
817
    }
667
    
818
    
668
    func removeAllUserUuidNotEqual(userUuid : String)
819
    func removeAllUserUuidNotEqual(userUuid : String)
669
    {
820
    {
670
        let db = database.open()
821
        let query = "DELETE FROM " +  Constants.TABLE_PROGRESS +
671
        let query = "DELETE FROM " +  Constants.TABLE_PROGRESS +
822
            " WHERE " + Constants.TABLE_PROGRESS_FIELD_USER_UUID + " <> '\(userUuid)' ;"
672
            " WHERE " + Constants.TABLE_PROGRESS_FIELD_USER_UUID + " <> '\(userUuid)' ;"
823
        var statement : OpaquePointer? = nil
673
        var statement : OpaquePointer? = nil
-
 
674
        if (sqlite3_prepare_v2(db, query, -1, &statement, nil) == SQLITE_OK) {
824
        if (sqlite3_prepare_v2(db, query, -1, &statement, nil) == SQLITE_OK) {
675
            if sqlite3_step(statement) != SQLITE_DONE {
825
            if sqlite3_step(statement) != SQLITE_DONE {
676
                print("No se pudo borrar todos los registros en la tabla: \(Constants.TABLE_PROGRESS)" +
826
                print("No se pudo borrar todos los registros en la tabla: \(Constants.TABLE_PROGRESS)" +
677
                " de los usuarios diferentes de : \(userUuid)" )
-
 
678
                database.printError()
827
                " de los usuarios diferentes de : \(userUuid)" )
679
            }
828
            }
680
        } else {
829
        } else {
681
            print("Fallo la preparación de borrar todos los registros en la tabla: \(Constants.TABLE_PROGRESS) de los usuarios diferentes de : \(userUuid) ")
Línea 830... Línea 682...
830
            print("Fallo la preparación de borrar todos los registros en la tabla: \(Constants.TABLE_PROGRESS) de los usuarios diferentes de : \(userUuid) ")
682
            database.printError()