Canvas LMS Assignmnets Listing

CS450 Image Processing Welcome to the web pages for BYU's CS 450, an introductory course in digital signal and image processing. Reference: http://canvas.instructure.com/courses/24645/

HTML

<script src="http://www.datasciencetoolkit.org/scripts/jquery.dstk.js"></script>
  <script id="template" type="text/x-jquery-tmpl"> 
   <tr>
    <td>${position}</td>
       <td><a target="_blank" href='http://canvas.instructure.com/courses/24645/assignments/${id}'>${id}</a></td>
    <td>${name}</td>
    <td>${points_possible}</td>
    <td>${grading_type}</td>
  </script>

  <p>Assignments for BYU's CS 450, an introductory course in digital signal and image processing.</p>
       
<div id="mydiv">
  <table>
   <caption></caption>
   <thead>
    <tr>
     <th>Position</th>
     <th>ID</th>
     <th>Name</th>
     <th>Points Possible</th>
     <th>Grading Type</th>
    </tr>
   </thead>
   <tbody id="info">
   </tbody>
  </table>
</div>

<!-- -->

<script id="template" type="text/x-jquery-tmpl">
    <ul>
        <li>${position}</li>
        <li>${id}</li>
        <li>${name}</li>
        <li>${points_possible}</li>
        <li>${grading_type}</li>
    </ul>
    <hr/>
</script>

<div id="info"></div>

CSS

body {
    font-size: 12px;
}

table, th, td {
    border: 1px solid black;
}

th, td {
    padding: 5px;
}

JavaScript

var url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D%22https%3A%2F%2Fcanvas.instructure.com%2Fapi%2Fv1%2Fcourses%2F24645%2Fassignments.json%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys";

$.ajax({
    url: url,
    dataType: 'jsonp',
    success: function(data) {
        console.log(data.query.results.json.json);
        var courses=data.query.results.json.json;
        $("#template").tmpl(courses).appendTo("#info");
        $("tr:odd").css("background-color", "#F7F9BC");
    }
});


// YQL Query
// SELECT *
// FROM json
// WHERE url="https://canvas.instructure.com/api/v1/courses/24645/assignments.json"

// YQL Console Permalink
// http://developer.yahoo.com/yql/console/?q=select%20*%20from%20json%20where%20url%3D%22https%3A%2F%2Fcanvas.instructure.com%2Fapi%2Fv1%2Fcourses%2F24645%2Fassignments.json%22&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys

// YQL REST Query (JSONP Response)
// http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D%22https%3A%2F%2Fcanvas.instructure.com%2Fapi%2Fv1%2Fcourses%2F24645%2Fassignments.json%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=cbfunc