ESova / esova.github.io

ESova Project - Teach kids programming
http://esova.github.io/
2 stars 3 forks source link

[SPRINT 4]: Lessons Page Frontend advanced #38

Closed serapath closed 8 years ago

serapath commented 8 years ago

TODO "Lessons Page Frontend advanced"

  /*
* Integrate JSBIN deeply -> data IO
* Integrate with BACKEND by commiting and validating stuff
  * api call

  var headers =         {
    'X-Requested-With'  :'XMLHttpRequest'
    "Content-Type"      : "application/json",
    "Accept"            : "application/json",
    "CSRF-token"        : "af0ae0f3kf0ak3fa0f3af9ja9raj93rjq93rjq39rj"
  }

  // GET
  var request = {
    url         : 'esova.com/username/lessonX',
    headers     : headers
  }
   minixhr(request, function (data) {
    //  var data = { // EXAMPLE
    //    step: 0 // user starts at beginning of lesson
    //    // step: 1 // user starts after <question 1>
    //  }
   })

   // POST
   var data = { // EXAMPLE
     step   : 0, // user starts at beginning
     step   : 1, // to N (but N+1 means: "successful GIT COMMIT")
     answer : 1  // to N (n is last possible answer)
   }
   var data = {
     finished: true
   }
  var request = {
    url         : 'esova.com/username/lessonX',
    headers     : headers,
    body        : data
  }
   minixhr(request, function response (data) {
     if (data) { console.log('correct answer') }
     else         { console.log('wrong answer')   }
   })

* populate questions/answers/jsbin with data from github or backend if user continues a lesson
  */

Improvement Requests

serapath commented 8 years ago

TODOs for Vasic Media