blob: 6cd2cc4fd5b7c620ad710745ac4106848503c756 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: dtpsLMS</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: dtpsLMS</h1>
<section>
<header>
<h2>dtpsLMS</h2>
</header>
<article>
<div class="container-overview">
<div class="description">Global DTPS LMS integration object. All LMS-related tasks, such as fetching data, are handled by this object. This is always loaded first. Please read the guide docs for instructions on implementing a custom LMS.</div>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">Full LMS name</td>
</tr>
<tr>
<td class="name"><code>shortName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">Short LMS name</td>
</tr>
<tr>
<td class="name"><code>legalName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">Legal name (or names) to show in the "Welcome to Power+" disclaimer</td>
</tr>
<tr>
<td class="name"><code>description</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">A short description of the LMS integration provided</td>
</tr>
<tr>
<td class="name"><code>logo</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">LMS logo image URL</td>
</tr>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">URL to the LMS' website</td>
</tr>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">URL to the LMS integration's source code</td>
</tr>
<tr>
<td class="name"><code>institutionSpecific</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">True if the LMS is designed for a specific institution</td>
</tr>
<tr>
<td class="name"><code>preferRubricGrades</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">True if DTPS should prefer rubric grades for assignments</td>
</tr>
<tr>
<td class="name"><code>genericGradebook</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">True if DTPS should show the generic gradebook. Ignored if dtpsLMS.gradebook defined.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1350">line 1350</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".calculateGrade"><span class="type-signature">(static) </span>calculateGrade<span class="signature">(course, assignments)</span><span class="type-signature"> &rarr; {undefined|object}</span></h4>
<div class="description">
[OPTIONAL] Calculates class grades with a custom grade calculation formula. Used for unique grading systems.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>course</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Class">Class</a></span>
</td>
<td class="description last">Class to calculate grades for [DO NOT USE COURSE.ASSIGNMENTS to access assignments for grade calculation. Use the assignments parameter instead.]</td>
</tr>
<tr>
<td class="name"><code>assignments</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#Assignment">Assignment</a>></span>
</td>
<td class="description last">Assignments used for grade calculation. Use this instead of course.assignments for hypothetical/what-if grade calculation.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1430">line 1430</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The letter grade should be returned in the "letter" property as a string and the percentage in the "grade" property as a number. Other custom properties can be set if they need to be accessed by dtpsLMS.gradebook. Return undefined if there is no grade for the class.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">undefined</span>
|
<span class="param-type">object</span>
</dd>
</dl>
<h4 class="name" id=".fetchAssignments"><span class="type-signature">(static) </span>fetchAssignments<span class="signature">(classID)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="global.html#Assignment">Assignment</a>>>}</span></h4>
<div class="description">
[REQUIRED] Fetches assignment data for a course from the LMS
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>classID</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The class ID to fetch assignments for</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1380">line 1380</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise which resolves to an array of Assignment objects
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;<a href="global.html#Assignment">Assignment</a>>></span>
</dd>
</dl>
<h4 class="name" id=".fetchClasses"><span class="type-signature">(static) </span>fetchClasses<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="global.html#Class">Class</a>>>}</span></h4>
<div class="description">
[REQUIRED] Fetches class data from the LMS
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1373">line 1373</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise which resolves to an array of Class objects
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;<a href="global.html#Class">Class</a>>></span>
</dd>
</dl>
<h4 class="name" id=".fetchDiscussionPosts"><span class="type-signature">(static) </span>fetchDiscussionPosts<span class="signature">(classID, threadID)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="global.html#DiscussionPost">DiscussionPost</a>>>}</span></h4>
<div class="description">
[REQUIRED IF dtpsLMS.fetchDiscussionThreads IS IMPLEMENTED] Fetches discussion posts in a thread from the LMS
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>classID</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The class ID to fetch discussion posts for</td>
</tr>
<tr>
<td class="name"><code>threadID</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The discussion thread ID to fetch discussion posts for</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1396">line 1396</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise which resolves to an array of Discussion Post objects
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;<a href="global.html#DiscussionPost">DiscussionPost</a>>></span>
</dd>
</dl>
<h4 class="name" id=".fetchDiscussionThreads"><span class="type-signature">(static) </span>fetchDiscussionThreads<span class="signature">(classID)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="global.html#DiscussionThread">DiscussionThread</a>>>}</span></h4>
<div class="description">
[OPTIONAL] Fetches discussion threads for a course from the LMS
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>classID</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The class ID to fetch discussion threads for</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1388">line 1388</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise which resolves to an array of Discussion Thread objects
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;<a href="global.html#DiscussionThread">DiscussionThread</a>>></span>
</dd>
</dl>
<h4 class="name" id=".fetchPageContent"><span class="type-signature">(static) </span>fetchPageContent<span class="signature">(classID, pageID)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
<div class="description">
[REQUIRED IF dtpsLMS.fetchPages IS IMPLEMENTED] Fetches content for a page from the LMS
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>classID</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The class ID to fetch page content for</td>
</tr>
<tr>
<td class="name"><code>pageID</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The page ID to fetch page content for</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1413">line 1413</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise which resolves to the page's content as HTML
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;string></span>
</dd>
</dl>
<h4 class="name" id=".fetchPages"><span class="type-signature">(static) </span>fetchPages<span class="signature">(classID)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="global.html#Page">Page</a>>>}</span></h4>
<div class="description">
[OPTIONAL] Fetches pages for a course from the LMS
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>classID</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The class ID to fetch pages for</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1405">line 1405</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise which resolves to an array of Page objects
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;<a href="global.html#Page">Page</a>>></span>
</dd>
</dl>
<h4 class="name" id=".fetchUser"><span class="type-signature">(static) </span>fetchUser<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="global.html#User">User</a>>}</span></h4>
<div class="description">
[REQUIRED] Fetches user data from the LMS
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1366">line 1366</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise which resolves to a User object
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;<a href="global.html#User">User</a>></span>
</dd>
</dl>
<h4 class="name" id=".gradebook"><span class="type-signature">(static) </span>gradebook<span class="signature">(course)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
<div class="description">
[OPTIONAL] Renders custom gradebook HTML for unique grading systems or for a more tailored experience. The gradebook only shows for classes with a grade and with at least 1 assignment.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>course</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Class">Class</a></span>
</td>
<td class="description last">Class to render the gradebook for. If custom grade calculation is enabled (dtpsLMS.calculateGrade), those results can be accessed at course.gradeCalculation.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1422">line 1422</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A promise which resolves to HTML to render for the class gradebook
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;string></span>
</dd>
</dl>
<h4 class="name" id=".updateAssignments"><span class="type-signature">(static) </span>updateAssignments<span class="signature">(assignments)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Assignment">Assignment</a>>}</span></h4>
<div class="description">
[OPTIONAL, INSTITUTION ONLY] This function can be implemented by institution-specific scripts to loop through and override assignment data returned by the LMS.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>assignments</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#Assignment">Assignment</a>></span>
</td>
<td class="description last">Original assignments array</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1439">line 1439</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Updated assignments array
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="global.html#Assignment">Assignment</a>></span>
</dd>
</dl>
<h4 class="name" id=".updateClasses"><span class="type-signature">(static) </span>updateClasses<span class="signature">(classes)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="global.html#Class">Class</a>>}</span></h4>
<div class="description">
[OPTIONAL, INSTITUTION ONLY] This function can be implemented by institution-specific scripts to loop through and override class data returned by the LMS.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>classes</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#Class">Class</a>></span>
</td>
<td class="description last">Original classes array</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line1447">line 1447</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Updated classes array
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="global.html#Class">Class</a>></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="dtps.html">dtps</a></li><li><a href="dtpsLMS.html">dtpsLMS</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Sun Jun 07 2020 14:02:58 GMT-0700 (Pacific Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>