js/main.js
// update the questions, wrapped in function to remove bug of the side-loading that xml does!

update the questions, wrapped in function to remove bug of the side-loading that xml does!
update the questions wrapped in function to remove bug of the side - loading that xml does!
function updateQuestons() {
    var html = '<div class="btn-group" role="group">'
    for (var i in QuestionsArray) {
        var j = parseInt(i) + 1
        var check = QuestionProgress.indexOf(j)
        html = html + '<button id="btn-q' + j + '" class="btn btn-default' + (check > -1 ? ' btn-success' : '') + ((j == Math.abs(currQuestion)) ? ' active' : '') + '"' + (isSandboxMode() ? ' disabled="disabled"' : '') + '>' + j + '</button>'
    }
    html = html + '</div>'
    $('#questions-SQL').html(html)
    if (isCompleted(currQuestion) === true) {
        var cache = Cookies.get('Question-' + currQuestion)
        if (typeof cache !== 'undefined') {
            cache = Base64.decode(cache)
            cache = JSON.parse(cache)
            editableCodeMirror.setValue(cache.Answer)
        }
    }
    $('#status-SQL').toggle(QuestionProgress.indexOf(currQuestion) > -1 ? true : false)
    $('#currQuestionTitle-SQL').html((typeof QuestionsArray[currQuestion - 1] !== 'undefined') ? 'Question #' + currQuestion + ' ' + QuestionsArray[currQuestion - 1].type : 'Sandbox Mode')
    $('#currQuestion-SQL').html(isSandboxMode() ? 'Questions are <strong>disabled</strong> in sandbox mode.' : getQuestion(currQuestion))
}
function updateQuestons ( ) { var html = '<div class="btn-group" role="group">' for ( var i in QuestionsArray ) { var j = parseInt ( i ) + 1 var check = QuestionProgress . indexOf ( j ) html = html + '<button id="btn-q' + j + '" class="btn btn-default' + ( check > - 1 ? ' btn-success' : '' ) + ( ( j == Math . abs ( currQuestion ) ) ? ' active' : '' ) + '"' + ( isSandboxMode ( ) ? ' disabled="disabled"' : '' ) + '>' + j + '</button>' } html = html + '</div>' $ ( '#questions-SQL' ) . html ( html ) if ( isCompleted ( currQuestion ) === true ) { var cache = Cookies . get ( 'Question-' + currQuestion ) if ( typeof cache !== 'undefined' ) { cache = Base64 . decode ( cache ) cache = JSON . parse ( cache ) editableCodeMirror . setValue ( cache . Answer ) } } $ ( '#status-SQL' ) . toggle ( QuestionProgress . indexOf ( currQuestion ) > - 1 ? true : false ) $ ( '#currQuestionTitle-SQL' ) . html ( ( typeof QuestionsArray [ currQuestion - 1 ] !== 'undefined' ) ? 'Question #' + currQuestion + ' ' + QuestionsArray [ currQuestion - 1 ] . type : 'Sandbox Mode' ) $ ( '#currQuestion-SQL' ) . html ( isSandboxMode ( ) ? 'Questions are <strong>disabled</strong> in sandbox mode.' : getQuestion ( currQuestion ) ) }
update the questions, wrapped in function to remove bug of the side-loading that xml does!
update the questions wrapped in function to remove bug of the side - loading that xml does!
// Construct questions!
 //if(QuestionsArray[i].newgroup) {
 //html = html + '</div><div class="btn-group" role="group">'
 //}
 // start the questions at 1!
 // check if the question has been completed?
 // add the button to the questions block
 // add it to the DOM
 // show model answer!
 // if the answer isn't in the cache, dont try show answer
 // decode the cookie
 // parse the string into a JSON object
