fluminus v2.0.1 Fluminus.API.Module View Source
Provides an abstraction over a module in LumiNUS, and operations possible on the module using LumiNUS API.
Struct fields:
:id
- id of the module in the LumiNUS API:code
- code of the module, e.g."CS1101S"
:name
- name of the module, e.g."Programming Methodology"
:teaching?
-true
if the user is teaching the module,false
if the user is taking the module:term
- a string identifier used by the LumiNUS API to uniquely identify a term (semester), e.g."1820"
is invalid
Link to this section Summary
Functions
Returns a list of announcements for a given module.
Creates Elixir.Fluminus.API.Module
struct from LumiNUS API response.
Get all the lesson plans associated with this Module.
Get all the weblectures associated with this Module.
Link to this section Types
Link to this section Functions
announcements(module, auth, archived \\ false)
View Sourceannouncements(Fluminus.API.Module.t(), Fluminus.Authorization.t(), bool()) :: {:ok, [%{title: String.t(), description: String.t(), datetime: DateTime.t()}]} | {:error, any()}
Returns a list of announcements for a given module.
The LumiNUS API provides 2 separate endpoints for archived and non-archived announcements. By default, announcements are archived after roughly 16 weeks (hence, the end of the semester) so most of the times, we should never need to access archived announcements.
from_api(api_response)
View Sourcefrom_api(any()) :: {:ok, Fluminus.API.Module.t()} | :error
Creates Elixir.Fluminus.API.Module
struct from LumiNUS API response.
lessons(module, auth)
View Sourcelessons(Fluminus.API.Module.t(), Fluminus.Authorization.t()) :: {:ok, [Fluminus.API.Module.Lesson.t()]} | {:error, any()}
Get all the lesson plans associated with this Module.
weblectures(module, auth)
View Sourceweblectures(Fluminus.API.Module.t(), Fluminus.Authorization.t()) :: {:ok, [String.t()]} | {:error, any()}
Get all the weblectures associated with this Module.