moodle

package
v0.0.0-...-767a636 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assign

type Assign struct {
	FullName   string
	Opened     time.Time
	Due        time.Time
	Submission []File
}

type AssignId

type AssignId uint

type Conversation

type Conversation struct {
	Id                           uint
	Name                         string
	MemberCount                  uint
	IsMuted                      bool
	IsFavourite                  bool
	IsRead                       bool
	UnreadCount                  uint
	Members                      []Member
	Messages                     []Message
	CanDeleteMessagesForAllUsers bool
}

func (Conversation) Title

func (c Conversation) Title() string

type Course

type Course struct {
	Id              CourseId
	FullName        string
	ShortName       string
	IdNumber        string
	FullNameDisplay string
	ViewURL         string
	CourseCategory  string
}

type CourseId

type CourseId uint

type DownloadItem

type DownloadItem struct {
	Id    uint
	Type  DownloadType
	Title string
}

type DownloadSection

type DownloadSection struct {
	Id    uint
	Title string
	Items []DownloadItem
}

type DownloadType

type DownloadType uint8
const (
	DownloadResource DownloadType = iota
	DownloadAssign
	DownloadFolder
)

func (DownloadType) String

func (t DownloadType) String() string

type Exception

type Exception struct {
	Message     string
	ErrorCode   string
	Link        string
	MoreInfoURL string
}

func (Exception) Error

func (e Exception) Error() string

type File

type File struct {
	Name string
}

type Grade

type Grade struct {
	Item   string
	URL    string
	Assign *AssignId

	Grade *float32

	From float32
	To   float32
}

type Member

type Member struct {
	Id                      uint
	FullName                string
	ProfileURL              string
	ProfileImageURL         string
	ProfileImageURLSmall    string
	IsOnline                *bool
	ShowOnlineStatus        bool
	IsBlocked               bool
	IsContact               bool
	IsDeleted               bool
	CanMessageEvenIfBlocked bool
	CanMessage              bool
	RequiresContact         bool
	ContactRequests         []struct{}
}

type Message

type Message struct {
	Id          uint
	UserIdFrom  uint
	Text        string
	TimeCreated Time
}

type Moodle

type Moodle struct {
	URL      string
	Session  string
	SessKey  string
	UserId   uint
	Timezone *time.Location
}

func (*Moodle) Assign

func (m *Moodle) Assign(id AssignId) (Assign, error)

func (*Moodle) Conversations

func (m *Moodle) Conversations() ([]Conversation, error)

func (*Moodle) CourseSearch

func (m *Moodle) CourseSearch(query string) ([]Course, error)

func (*Moodle) DownloadCenter

func (m *Moodle) DownloadCenter(id CourseId) ([]DownloadSection, error)

func (*Moodle) DownloadCenterDownload

func (m *Moodle) DownloadCenterDownload(id CourseId, topic uint, typ DownloadType, item uint) (io.ReadCloser, error)

func (*Moodle) GradeReport

func (m *Moodle) GradeReport(course CourseId) ([]Grade, error)

func (*Moodle) LoginShibboleth

func (m *Moodle) LoginShibboleth(username, password string) error

type Time

type Time time.Time

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL