New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

canvas-student-metadata

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-student-metadata

A handler that uses the CACCL library to add and modify student metadata on a per-course level.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

canvas-student-metadata

A handler that uses the CACCL library to add and modify student metadata on a per-course level.

Getting Started

Import the library:

const StudentMetadata = require('canvas-student-metadata');

Initialize using an instance of CACCL-API:

const studentMetadata = new StudentMetadata(api);

Methods

getStudentMetadataMap – gets metadata for each student in a course

This is an asynchronous function

Argument:

  • courseId – a Canvas course id

Returns:

Object where keys are studentIds and values are metadata objects.

Note: students that do not have metadata have a value of undefined

Example:

In our example, the courseId is 104 and the studentId is 77901

const metadataMap = await studentMetadata.getStudentMetadataMap(104);

if (metadataMap[77901] === undefined) {
  console.log('Student has no metadata');
} else {
  console.log('Student has metadata. Here it is:');
  console.log(metadataMap[77901]);
}

setStudentMetadata – set's the metadata for a specific student

This is an asynchronous function

Arguments:

  • courseId – the id of the course containing the student
  • studentId – the id of the student to update
  • metadata – an metadata object (must be JSONifiable)

Example:

In our example, the courseId is 104 and the studentId is 77901

const metadata = {
  heightIn: 48,
  ageYrs: 14,
  favoriteColor: 'red',
};

await studentMetadata.setStudentMetadata(104, 77901, metadata);

Keywords

Canvas

FAQs

Package last updated on 17 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts