mardi 16 février 2016

I have array containing 50 questions. How can I choose and display them at random? [on hold]

app.factory('$questions', function () {

    var questions = [

        //ALADDIN AND THE MAGIC LAMP
        {
            question : 'Aladdin lives with his...',
            answers : ['Mother.', 'Father.', 'Uncle.', 'Grandmother.'],
            correct_index : 0
        }, {
            question : 'Aladdin\'s uncle is called...',
            answers : ['Mustafa', 'Sultan', 'Abanazar', 'Zimbal'],
            correct_index : 2
        }
    ];

    return {

        GetQuestions : function () {
            return questions;
        }
    }
})




Aucun commentaire:

Enregistrer un commentaire