Created
May 24, 2015 02:39
-
-
Save jaseflow/3df07f35ec6a83968470 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| app.controller('SectionCtrl', function($scope, $ionicModal) { | |
| $scope.user = { | |
| name: 'Jason Corbett', | |
| activeCourse: 'Sports Turf Management', | |
| activeCourseLevel: 'Certificate III', | |
| activeCourseCode: 'AHC31310' | |
| }; | |
| $scope.quiz = [ | |
| { | |
| question: "How often should soil analysis be performed?", | |
| answers: [ | |
| { | |
| answer: "Every day", | |
| correct: false | |
| }, | |
| { | |
| answer: "Once a month", | |
| correct: false | |
| }, | |
| { | |
| answer: "Once a year", | |
| correct: true | |
| } | |
| ] | |
| }, | |
| { | |
| question: "Which of these factors cause stress for turf?", | |
| answers: [ | |
| { | |
| answer: "Weather", | |
| correct: false | |
| }, | |
| { | |
| answer: "Traffic", | |
| correct: false | |
| }, | |
| { | |
| answer: "Disease", | |
| correct: false | |
| }, | |
| { | |
| answer: "All of the above", | |
| correct: true | |
| } | |
| ] | |
| }, | |
| { | |
| question: "What does ASPAC stand for?", | |
| answers: [ | |
| { | |
| answer: "Australasian Standards for Packaging and Control", | |
| correct: false | |
| }, | |
| { | |
| answer: "Australasian Soil and Plant Analysis Council", | |
| correct: true | |
| }, | |
| { | |
| answer: "Australiasian Soil and Plant Admin Centre", | |
| correct: false | |
| } | |
| ] | |
| } | |
| ] | |
| $ionicModal.fromTemplateUrl('templates/quiz.html', { | |
| scope: $scope | |
| }).then(function(modal) { | |
| $scope.modal = modal | |
| }); | |
| $scope.openModal = function($event) { | |
| $scope.modal.show($event); | |
| }; | |
| $scope.closeModal = function($event) { | |
| $scope.modal.hide(); | |
| }; | |
| $scope.$on('$destroy', function() { | |
| $scope.modal.remove(); | |
| }); | |
| $scope.checkAnswer = function($event) { | |
| console.log(event.target.dataset.correct); | |
| currentQuestion ++; | |
| }; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment