Documentation ¶
Overview ¶
canvasctl: Use Canvas LMS from command line
Copyright (C) 2020 Marcus Gelderie This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
canvasctl: Use Canvas LMS from command line
Copyright (C) 2020 Marcus Gelderie This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
canvasctl: Use Canvas LMS from command line
Copyright (C) 2020 Marcus Gelderie This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
canvasctl: Use Canvas LMS from command line
Copyright (C) 2020 Marcus Gelderie This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
canvasctl: Use Canvas LMS from command line
Copyright (C) 2020 Marcus Gelderie This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
canvasctl: Use Canvas LMS from command line
Copyright (C) 2020, 2021, 2022 Marcus Gelderie This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
canvasctl: Use Canvas LMS from command line
Copyright (C) 2020 Marcus Gelderie This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Constants
- type CanvasCourse
- type Context
- type CourseContext
- func (ctx *CourseContext) AddModule(name string) (rest.CanvasId, error)
- func (ctx *CourseContext) AddModuleItem(moduleId, contentId rest.CanvasId, title string, t ModuleItemType) (rest.CanvasId, error)
- func (ctx *CourseContext) BuildCourseDirTree() (DirectoryTree, []DirectoryTree, error)
- func (ctx *CourseContext) Course() CanvasCourse
- func (ctx *CourseContext) CreateQuizFromReader(reader io.Reader) error
- func (ctx *CourseContext) DeleteQuiz(quizId rest.CanvasId) error
- func (c *CourseContext) FindModuleItem(moduleId rest.CanvasId, matcher ModuleItemMatcher) (rest.ModuleItem, bool)
- func (ctx *CourseContext) GetQuizObject(quizId rest.CanvasId) (rest.Quiz, error)
- func (ctx *CourseContext) ListFiles() error
- func (ctx *CourseContext) ListModules() error
- func (ctx *CourseContext) ListQuizzes() ([]rest.Quiz, error)
- func (ctx *CourseContext) ModuleIdFromName(name string, create bool) (rest.CanvasId, error)
- func (ctx *CourseContext) PushFile(localname, remotename, remotepath string) (rest.CanvasId, string, error)
- func (ctx *CourseContext) ResolvePath(path string) (ResolvedPath, error)
- func (ctx *CourseContext) ShowCourse() error
- func (ctx *CourseContext) UpdateQuiz(quizId rest.CanvasId, quiz rest.QuizCreationSpec) error
- type DirectoryTree
- type ModuleItemMatcher
- type ModuleItemType
- type ResolvedPath
Constants ¶
View Source
const UnknownCourse = "UNKNOWN"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CanvasCourse ¶
func CourseFromId ¶
func CourseFromId(api rest.API, id rest.CanvasId) CanvasCourse
func CourseFromName ¶
func CourseFromName(api rest.API, name string) CanvasCourse
type CourseContext ¶
type CourseContext struct { Context // contains filtered or unexported fields }
func NewCourseContext ¶
func NewCourseContext(cliContext *cli.Context) (*CourseContext, error)
func (*CourseContext) AddModule ¶
func (ctx *CourseContext) AddModule(name string) (rest.CanvasId, error)
func (*CourseContext) AddModuleItem ¶
func (ctx *CourseContext) AddModuleItem(moduleId, contentId rest.CanvasId, title string, t ModuleItemType) (rest.CanvasId, error)
func (*CourseContext) BuildCourseDirTree ¶
func (ctx *CourseContext) BuildCourseDirTree() (DirectoryTree, []DirectoryTree, error)
func (*CourseContext) Course ¶
func (ctx *CourseContext) Course() CanvasCourse
func (*CourseContext) CreateQuizFromReader ¶
func (ctx *CourseContext) CreateQuizFromReader(reader io.Reader) error
func (*CourseContext) DeleteQuiz ¶
func (ctx *CourseContext) DeleteQuiz(quizId rest.CanvasId) error
func (*CourseContext) FindModuleItem ¶
func (c *CourseContext) FindModuleItem(moduleId rest.CanvasId, matcher ModuleItemMatcher) (rest.ModuleItem, bool)
func (*CourseContext) GetQuizObject ¶
func (*CourseContext) ListFiles ¶
func (ctx *CourseContext) ListFiles() error
func (*CourseContext) ListModules ¶
func (ctx *CourseContext) ListModules() error
func (*CourseContext) ListQuizzes ¶
func (ctx *CourseContext) ListQuizzes() ([]rest.Quiz, error)
func (*CourseContext) ModuleIdFromName ¶
func (*CourseContext) ResolvePath ¶
func (ctx *CourseContext) ResolvePath(path string) (ResolvedPath, error)
func (*CourseContext) ShowCourse ¶
func (ctx *CourseContext) ShowCourse() error
func (*CourseContext) UpdateQuiz ¶
func (ctx *CourseContext) UpdateQuiz(quizId rest.CanvasId, quiz rest.QuizCreationSpec) error
type DirectoryTree ¶
type DirectoryTree interface { Name() string Parent() DirectoryTree Children() []DirectoryTree FolderInfo() rest.FolderInfo Files() []rest.FileInfo }
type ModuleItemMatcher ¶
type ModuleItemMatcher func(rest.ModuleItem) bool
type ModuleItemType ¶
type ModuleItemType int
const ( MODITEM_FILE ModuleItemType = iota MODITEM_PAGE ModuleItemType = iota MODITEM_DISCUSSION ModuleItemType = iota MODITEM_ASSIGNMENT ModuleItemType = iota MODITEM_QUIZ ModuleItemType = iota MODITEM_SUBHEADER ModuleItemType = iota MODITEM_EXTURL ModuleItemType = iota MODITEM_EXTTOOL ModuleItemType = iota )
func (ModuleItemType) ToCanvasName ¶
func (t ModuleItemType) ToCanvasName() string
type ResolvedPath ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
canvasctl: Use Canvas LMS from command line
|
canvasctl: Use Canvas LMS from command line |
Click to show internal directories.
Click to hide internal directories.