| Línea 174... |
Línea 174... |
| 174 |
}
|
174 |
}
|
| 175 |
}
|
175 |
}
|
| Línea 176... |
Línea 176... |
| 176 |
|
176 |
|
| 177 |
func incompleteSlide (slide: SlideModel)
|
177 |
func incompleteSlide (slide: SlideModel)
|
| 178 |
{
|
178 |
{
|
| 179 |
print("Notification: \(Constants.NOTIFICATION_NAME_INCOMPLETED_SLIDE) ")
|
179 |
//print("Notification: \(Constants.NOTIFICATION_NAME_INCOMPLETED_SLIDE) ")
|
| 180 |
NotificationCenter.default.post(name:Constants.NOTIFICATION_NAME_INCOMPLETED_SLIDE,
|
180 |
NotificationCenter.default.post(name:Constants.NOTIFICATION_NAME_INCOMPLETED_SLIDE,
|
| 181 |
object: nil, userInfo: ["slideUuid": slide.uuid])
|
181 |
object: nil, userInfo: ["slideUuid": slide.uuid])
|
| Línea 182... |
Línea 182... |
| 182 |
}
|
182 |
}
|
| Línea 365... |
Línea 365... |
| 365 |
progressDao.update(record: progressCapsule)
|
365 |
progressDao.update(record: progressCapsule)
|
| Línea 366... |
Línea 366... |
| 366 |
|
366 |
|
| - |
|
367 |
|
| - |
|
368 |
|
| 367 |
|
369 |
appData.capsuleUuidOld = slide.capsuleUuid
|
| Línea 368... |
Línea 370... |
| 368 |
|
370 |
|
| 369 |
appData.capsuleUuidOld = slide.capsuleUuid
|
371 |
print("update query : 2")
|
| 370 |
appDao.update(model: appData)
|
372 |
appDao.update(model: appData)
|
| Línea 432... |
Línea 434... |
| 432 |
|
434 |
|
| 433 |
syncDao.insert(record : sync);
|
435 |
syncDao.insert(record : sync);
|
| Línea 434... |
Línea 436... |
| 434 |
}
|
436 |
}
|
| 435 |
|
437 |
|
| 436 |
|
438 |
|
| Línea 437... |
Línea 439... |
| 437 |
print("Notification: \(Constants.NOTIFICATION_NAME_COMPLETED_SLIDE) ")
|
439 |
// print("Notification: \(Constants.NOTIFICATION_NAME_COMPLETED_SLIDE) ")
|
| Línea 438... |
Línea 440... |
| 438 |
NotificationCenter.default.post(name:Constants.NOTIFICATION_NAME_COMPLETED_SLIDE,
|
440 |
NotificationCenter.default.post(name:Constants.NOTIFICATION_NAME_COMPLETED_SLIDE,
|
| 439 |
object: nil, userInfo: ["slideUuid": slide.uuid])
|
441 |
object: nil, userInfo: ["slideUuid": slide.uuid])
|
| Línea 440... |
Línea 442... |
| 440 |
|
442 |
|
| 441 |
if (changeProgress) {
|
443 |
if (changeProgress) {
|
| Línea 442... |
Línea 444... |
| 442 |
|
444 |
|
| Línea 443... |
Línea 445... |
| 443 |
print("Notification: \(Constants.NOTIFICATION_NAME_CHANGE_PERCENTAJE_COMPLETED_CAPSULE) ")
|
445 |
//print("Notification: \(Constants.NOTIFICATION_NAME_CHANGE_PERCENTAJE_COMPLETED_CAPSULE) ")
|
| Línea 492... |
Línea 494... |
| 492 |
|
494 |
|
| 493 |
|
495 |
|
| Línea 494... |
Línea 496... |
| 494 |
if json?["data"]["max_date_changes"] != "" {
|
496 |
if json?["data"]["max_date_changes"] != "" {
|
| Línea 495... |
Línea 497... |
| 495 |
let maxDateChanges = json?["data"]["max_date_changes"].string ?? ""
|
497 |
let maxDateChanges = json?["data"]["max_date_changes"].string ?? ""
|
| 496 |
|
498 |
|
| Línea 497... |
Línea 499... |
| 497 |
print("maxDateChanges : \(maxDateChanges)")
|
499 |
//print("maxDateChanges : \(maxDateChanges)")
|
| 498 |
|
500 |
|
| 499 |
appData.maxDateChanges = maxDateChanges
|
501 |
appData.maxDateChanges = maxDateChanges
|
| Línea 500... |
Línea 502... |
| 500 |
}
|
502 |
}
|
| 501 |
|
503 |
|
| 502 |
if !refresh && json?["data"]["device"] != "" {
|
504 |
if !refresh && json?["data"]["device"] != "" {
|
| 503 |
let deviceAes = json?["data"]["device"]["aes"].string ?? ""
|
505 |
let deviceAes = json?["data"]["device"]["aes"].string ?? ""
|
| Línea 504... |
Línea 506... |
| 504 |
let devicePassword = json?["data"]["device"]["password"].string ?? ""
|
506 |
let devicePassword = json?["data"]["device"]["password"].string ?? ""
|
| 505 |
|
507 |
|
| Línea 515... |
Línea 517... |
| 515 |
let userLastName = json?["data"]["user"]["last_name"].string ?? ""
|
517 |
let userLastName = json?["data"]["user"]["last_name"].string ?? ""
|
| 516 |
let userEmail = json?["data"]["user"]["email"].string ?? ""
|
518 |
let userEmail = json?["data"]["user"]["email"].string ?? ""
|
| 517 |
let userImage = json?["data"]["user"]["image"].string ?? ""
|
519 |
let userImage = json?["data"]["user"]["image"].string ?? ""
|
| Línea 518... |
Línea 520... |
| 518 |
|
520 |
|
| 519 |
|
521 |
|
| 520 |
print("userUuid : \(userUuid)")
|
522 |
//print("userUuid : \(userUuid)")
|
| 521 |
print("userFirstName : \(userFirstName)")
|
523 |
//print("userFirstName : \(userFirstName)")
|
| 522 |
print("userLastName: \(userLastName)")
|
524 |
//print("userLastName: \(userLastName)")
|
| Línea 523... |
Línea 525... |
| 523 |
print("userEmail : \(userEmail)")
|
525 |
//print("userEmail : \(userEmail)")
|
| 524 |
print("userImage : \(userImage)")
|
526 |
//print("userImage : \(userImage)")
|
| 525 |
|
527 |
|
| Línea 536... |
Línea 538... |
| 536 |
|
538 |
|
| 537 |
appData.topicUuidActive = ""
|
539 |
appData.topicUuidActive = ""
|
| 538 |
appData.capsuleUuidActive = ""
|
540 |
appData.capsuleUuidActive = ""
|
| 539 |
appData.capsuleUuidOld = ""
|
541 |
appData.capsuleUuidOld = ""
|
| - |
|
542 |
appData.slideUuidActive = ""
|
| - |
|
543 |
|
| 540 |
appData.slideUuidActive = ""
|
544 |
print("update query : 3")
|
| Línea 541... |
Línea 545... |
| 541 |
appDao.update(model: appData)
|
545 |
appDao.update(model: appData)
|
| 542 |
|
546 |
|
| Línea 552... |
Línea 556... |
| 552 |
companyModel = CompanyModel()
|
556 |
companyModel = CompanyModel()
|
| 553 |
companyModel.uuid = topic.1["company_uuid"].string ?? ""
|
557 |
companyModel.uuid = topic.1["company_uuid"].string ?? ""
|
| 554 |
companyModel.name = topic.1["company_name"].string ?? ""
|
558 |
companyModel.name = topic.1["company_name"].string ?? ""
|
| 555 |
companyModel.image = topic.1["company_image"].string ?? ""
|
559 |
companyModel.image = topic.1["company_image"].string ?? ""
|
| Línea 556... |
Línea 560... |
| 556 |
|
560 |
|
| 557 |
print("companyUuid : \(companyModel.uuid)")
|
561 |
// print("companyUuid : \(companyModel.uuid)")
|
| 558 |
print("companyName : \(companyModel.name)")
|
562 |
// print("companyName : \(companyModel.name)")
|
| Línea 559... |
Línea 563... |
| 559 |
print("companyImage : \(companyModel.image)")
|
563 |
// print("companyImage : \(companyModel.image)")
|
| 560 |
|
564 |
|
| 561 |
let company = companyDao.selectByUuid(uuid: companyModel.uuid)
|
565 |
let company = companyDao.selectByUuid(uuid: companyModel.uuid)
|
| 562 |
if(company.uuid.isEmpty) {
|
566 |
if(company.uuid.isEmpty) {
|
| Línea 574... |
Línea 578... |
| 574 |
topicModel.position = Int(topic.1["position"].string ?? "") ?? 1
|
578 |
topicModel.position = Int(topic.1["position"].string ?? "") ?? 1
|
| 575 |
topicModel.addedOn = topic.1["added_on"].string ?? ""
|
579 |
topicModel.addedOn = topic.1["added_on"].string ?? ""
|
| 576 |
topicModel.updatedOn = topic.1["updated_on"].string ?? ""
|
580 |
topicModel.updatedOn = topic.1["updated_on"].string ?? ""
|
| Línea 577... |
Línea 581... |
| 577 |
|
581 |
|
| 578 |
|
582 |
|
| 579 |
print("topiccompanyUuid: \(topicModel.companyUuid)")
|
583 |
// print("topiccompanyUuid: \(topicModel.companyUuid)")
|
| 580 |
print("topicUuid: \(topicModel.uuid)")
|
584 |
//print("topicUuid: \(topicModel.uuid)")//
|
| 581 |
print("topicName: \(topicModel.name)")
|
585 |
// print("topicName: \(topicModel.name)")
|
| 582 |
print("topicDescription: \(topicModel.description)")
|
586 |
//print("topicDescription: \(topicModel.description)")//
|
| Línea 583... |
Línea 587... |
| 583 |
print("topicImage: \(topicModel.image)")
|
587 |
//print("topicImage: \(topicModel.image)")
|
| 584 |
print("topicPosition: \(topicModel.position)")
|
588 |
//print("topicPosition: \(topicModel.position)")
|
| Línea 603... |
Línea 607... |
| 603 |
capsuleModel.totalComments = Int(capsule.1["total_comments"].string ?? "") ?? 1
|
607 |
capsuleModel.totalComments = Int(capsule.1["total_comments"].string ?? "") ?? 1
|
| 604 |
capsuleModel.totalRating = Decimal(Double(capsule.1["total_rating"].string ?? "") ?? 0)
|
608 |
capsuleModel.totalRating = Decimal(Double(capsule.1["total_rating"].string ?? "") ?? 0)
|
| 605 |
capsuleModel.addedOn = capsule.1["added_on"].string ?? ""
|
609 |
capsuleModel.addedOn = capsule.1["added_on"].string ?? ""
|
| 606 |
capsuleModel.updatedOn = capsule.1["updated_on"].string ?? ""
|
610 |
capsuleModel.updatedOn = capsule.1["updated_on"].string ?? ""
|
| Línea 607... |
Línea 611... |
| 607 |
|
611 |
|
| 608 |
print("capsuletopicUuid: \(capsuleModel.topicUuid)")
|
612 |
//print("capsuletopicUuid: \(capsuleModel.topicUuid)")
|
| 609 |
print("capsuleUuid: \(capsuleModel.uuid)")
|
613 |
//print("capsuleUuid: \(capsuleModel.uuid)")
|
| 610 |
print("capsuleName: \(capsuleModel.name)")
|
614 |
//print("capsuleName: \(capsuleModel.name)")
|
| 611 |
print("capsuleDescription: \(capsuleModel.description)")
|
615 |
//print("capsuleDescription: \(capsuleModel.description)")
|
| 612 |
print("capsuleImage: \(capsuleModel.image)")
|
616 |
//print("capsuleImage: \(capsuleModel.image)")
|
| 613 |
print("capsulePosition: \(capsuleModel.position)")
|
617 |
//print("capsulePosition: \(capsuleModel.position)")
|
| 614 |
print("capsuleLinkComments: \(capsuleModel.linkComments)")
|
618 |
//print("capsuleLinkComments: \(capsuleModel.linkComments)")
|
| 615 |
print("capsuleLinkCommentAdd: \(capsuleModel.linkCommentAdd)")
|
619 |
//print("capsuleLinkCommentAdd: \(capsuleModel.linkCommentAdd)")
|
| 616 |
print("capsuleTotalComments: \(capsuleModel.totalComments)")
|
620 |
//print("capsuleTotalComments: \(capsuleModel.totalComments)")
|
| Línea 617... |
Línea 621... |
| 617 |
print("capsuleTotalRating: \(capsuleModel.totalRating)")
|
621 |
//print("capsuleTotalRating: \(capsuleModel.totalRating)")
|
| 618 |
|
622 |
|
| Línea 635... |
Línea 639... |
| 635 |
slideModel.type = slide.1["type"].string ?? ""
|
639 |
slideModel.type = slide.1["type"].string ?? ""
|
| 636 |
slideModel.addedOn = slide.1["added_on"].string ?? ""
|
640 |
slideModel.addedOn = slide.1["added_on"].string ?? ""
|
| 637 |
slideModel.updatedOn = slide.1["updated_on"].string ?? ""
|
641 |
slideModel.updatedOn = slide.1["updated_on"].string ?? ""
|
| Línea 638... |
Línea 642... |
| 638 |
|
642 |
|
| 639 |
|
643 |
|
| 640 |
print("slidetopicUuid: \(slideModel.topicUuid)")
|
644 |
//print("slidetopicUuid: \(slideModel.topicUuid)")
|
| 641 |
print("slidecapsuleUuid: \(slideModel.capsuleUuid)")
|
645 |
//print("slidecapsuleUuid: \(slideModel.capsuleUuid)")
|
| 642 |
print("slideUuid: \(slideModel.uuid)")
|
646 |
//print("slideUuid: \(slideModel.uuid)")
|
| 643 |
print("slideQuizUuid: \(slideModel.quizUuid)")
|
647 |
//print("slideQuizUuid: \(slideModel.quizUuid)")
|
| 644 |
print("slideName: \(slideModel.name)")
|
648 |
//print("slideName: \(slideModel.name)")
|
| 645 |
print("slideDescription: \(slideModel.description)")
|
649 |
//print("slideDescription: \(slideModel.description)")
|
| 646 |
print("slidePosition: \(slideModel.position)")
|
650 |
//print("slidePosition: \(slideModel.position)")
|
| 647 |
print("slideBackground: \(slideModel.background)")
|
651 |
//print("slideBackground: \(slideModel.background)")
|
| Línea 648... |
Línea 652... |
| 648 |
print("slideFile: \(slideModel.file)")
|
652 |
//print("slideFile: \(slideModel.file)")
|
| 649 |
print("slideTye: \(slideModel.type)")
|
653 |
//print("slideTye: \(slideModel.type)")
|
| 650 |
|
654 |
|
| 651 |
// Insert Slides in DB
|
655 |
// Insert Slides in DB
|
| Línea 666... |
Línea 670... |
| 666 |
companyModel = CompanyModel()
|
670 |
companyModel = CompanyModel()
|
| 667 |
companyModel.uuid = quiz.1["company_uuid"].string ?? ""
|
671 |
companyModel.uuid = quiz.1["company_uuid"].string ?? ""
|
| 668 |
companyModel.name = quiz.1["company_name"].string ?? ""
|
672 |
companyModel.name = quiz.1["company_name"].string ?? ""
|
| 669 |
companyModel.image = quiz.1["company_image"].string ?? ""
|
673 |
companyModel.image = quiz.1["company_image"].string ?? ""
|
| Línea 670... |
Línea 674... |
| 670 |
|
674 |
|
| 671 |
print("companyUuid : \(companyModel.uuid)")
|
675 |
//print("companyUuid : \(companyModel.uuid)")
|
| 672 |
print("companyName : \(companyModel.name)")
|
676 |
//print("companyName : \(companyModel.name)")
|
| Línea 673... |
Línea 677... |
| 673 |
print("companyImage : \(companyModel.image)")
|
677 |
//print("companyImage : \(companyModel.image)")
|
| 674 |
|
678 |
|
| 675 |
let company = companyDao.selectByUuid(uuid: companyModel.uuid)
|
679 |
let company = companyDao.selectByUuid(uuid: companyModel.uuid)
|
| 676 |
if(company.uuid.isEmpty) {
|
680 |
if(company.uuid.isEmpty) {
|
| Línea 690... |
Línea 694... |
| 690 |
quizModel.maxTime = Int(quiz.1["max_time"].string ?? "") ?? 0
|
694 |
quizModel.maxTime = Int(quiz.1["max_time"].string ?? "") ?? 0
|
| 691 |
quizModel.addedOn = quiz.1["added_on"].string ?? ""
|
695 |
quizModel.addedOn = quiz.1["added_on"].string ?? ""
|
| 692 |
quizModel.updatedOn = quiz.1["updated_on"].string ?? ""
|
696 |
quizModel.updatedOn = quiz.1["updated_on"].string ?? ""
|
| Línea 693... |
Línea 697... |
| 693 |
|
697 |
|
| 694 |
|
698 |
|
| 695 |
print("quizcompanyUuid: \(quizModel.companyUuid)")
|
699 |
//print("quizcompanyUuid: \(quizModel.companyUuid)")
|
| 696 |
print("quizUuid: \(quizModel.uuid)")
|
700 |
//print("quizUuid: \(quizModel.uuid)")
|
| 697 |
print("quizName: \(quizModel.name)")
|
701 |
//print("quizName: \(quizModel.name)")
|
| 698 |
print("quizText: \(quizModel.text)")
|
702 |
//print("quizText: \(quizModel.text)")
|
| 699 |
print("quizFailed: \(quizModel.failed)")
|
703 |
//print("quizFailed: \(quizModel.failed)")
|
| 700 |
print("quizPoints: \(quizModel.points)")
|
704 |
//print("quizPoints: \(quizModel.points)")
|
| Línea 701... |
Línea 705... |
| 701 |
print("quizMinimumPointsRequired: \(quizModel.minimumPointsRequired)")
|
705 |
//print("quizMinimumPointsRequired: \(quizModel.minimumPointsRequired)")
|
| Línea 702... |
Línea 706... |
| 702 |
print("quizMaxTime: \(quizModel.maxTime)")
|
706 |
//print("quizMaxTime: \(quizModel.maxTime)")
|
| Línea 714... |
Línea 718... |
| 714 |
questionModel.points = Int(question.1["points"].string ?? "") ?? 0
|
718 |
questionModel.points = Int(question.1["points"].string ?? "") ?? 0
|
| 715 |
questionModel.max_length = Int(question.1["maxlength"].string ?? "") ?? 0
|
719 |
questionModel.max_length = Int(question.1["maxlength"].string ?? "") ?? 0
|
| 716 |
questionModel.addedOn = question.1["added_on"].string ?? ""
|
720 |
questionModel.addedOn = question.1["added_on"].string ?? ""
|
| 717 |
questionModel.updatedOn = question.1["updated_on"].string ?? ""
|
721 |
questionModel.updatedOn = question.1["updated_on"].string ?? ""
|
| Línea 718... |
Línea 722... |
| 718 |
|
722 |
|
| 719 |
print("questionQuizUuid: \(questionModel.quizUuid)")
|
723 |
//print("questionQuizUuid: \(questionModel.quizUuid)")
|
| 720 |
print("questionId: \(questionModel.uuid)")
|
724 |
//print("questionId: \(questionModel.uuid)")
|
| 721 |
print("questionText: \(questionModel.text)")
|
725 |
//print("questionText: \(questionModel.text)")
|
| 722 |
print("questionType: \(questionModel.type)")
|
726 |
//print("questionType: \(questionModel.type)")
|
| 723 |
print("questionPoints: \(questionModel.points)")
|
727 |
//print("questionPoints: \(questionModel.points)")
|
| Línea 724... |
Línea 728... |
| 724 |
print("questionMaxLength: \(questionModel.max_length)")
|
728 |
//print("questionMaxLength: \(questionModel.max_length)")
|
| Línea 725... |
Línea 729... |
| 725 |
|
729 |
|
| Línea 735... |
Línea 739... |
| 735 |
answerModel.correct = Int(answer.1["correct"].string ?? "") ?? 0
|
739 |
answerModel.correct = Int(answer.1["correct"].string ?? "") ?? 0
|
| 736 |
answerModel.points = Int(answer.1["points"].string ?? "") ?? 0
|
740 |
answerModel.points = Int(answer.1["points"].string ?? "") ?? 0
|
| 737 |
answerModel.addedOn = answer.1["added_on"].string ?? ""
|
741 |
answerModel.addedOn = answer.1["added_on"].string ?? ""
|
| 738 |
answerModel.updatedOn = answer.1["updated_on"].string ?? ""
|
742 |
answerModel.updatedOn = answer.1["updated_on"].string ?? ""
|
| Línea 739... |
Línea 743... |
| 739 |
|
743 |
|
| 740 |
print("answerQuestionUuid: \(answerModel.questionUuid)")
|
744 |
//print("answerQuestionUuid: \(answerModel.questionUuid)")
|
| 741 |
print("answerId: \(answerModel.uuid)")
|
745 |
//print("answerId: \(answerModel.uuid)")
|
| 742 |
print("answerText: \(answerModel.text)")
|
746 |
//print("answerText: \(answerModel.text)")
|
| Línea 743... |
Línea 747... |
| 743 |
print("answerCorrect: \(answerModel.correct)")
|
747 |
//print("answerCorrect: \(answerModel.correct)")
|