AnsweredAssumed Answered

Module ID's using javascript

Question asked by Lalit Parashar on Mar 3, 2020
Latest reply on Apr 13, 2020 by Lalit Parashar

Hi, 

 

Can some one please help me with fetching the module id's and their start date using javascript?  I would like to use this data for activating and deactivating some links in canvas course. 

 

I'm using the below code to fetch data but its providing me only course id. 

 

if (/^\/courses\/\d+.*/.test(window.location.pathname)) {
$.getJSON(`/api/v1/courses/${ENV.COURSE_ID}`, function(r) {

      setInterval(function(){
            var start = new Date(r.start_at);
            var today = new Date();

 


         if(start <= today){

            console.log("Hello");
         }
}, 100);

})

}

Outcomes