moodle-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStudy Moodle
学习Moodle
Overview
概述
Use the local Moodle CLI to login, list courses, files, and export/download course materials. Read the CLI repo docs before running commands.
使用本地Moodle CLI进行登录、列出课程、文件,以及导出/下载课程资料。在运行命令前请阅读CLI仓库文档。
Quick Start
快速开始
- Read for current capabilities and status.
README.md - Run the CLI as (installed on PATH; use
moodlefirst if needed).source ~/.zshrc - Prefer JSON outputs () when available and parse results for the user.
--json
- 阅读了解当前功能和状态。
README.md - 以命令运行CLI(已安装在PATH中;如有需要请先执行
moodle)。source ~/.zshrc - 若支持,优先使用JSON输出格式()并为用户解析结果。
--json
Core Tasks
核心任务
Login
登录
- Use when a request requires authenticated access or commands fail with session expired.
- Command:
moodle login
- 当请求需要认证访问或命令因会话过期失败时使用。
- 命令:
moodle login
List courses
列出课程
- Use when asked about enrolled courses, course IDs, or to confirm a course exists.
- Command:
moodle list courses --json
- 当被问及已注册课程、课程ID或确认课程是否存在时使用。
- 命令:
moodle list courses --json
List files for a course
列出课程文件
- Use when asked about course materials, handouts, slides, or file lists.
- Command:
moodle list files <course-id|name> --json
- 当被问及课程资料、讲义、幻灯片或文件列表时使用。
- 命令:
moodle list files <course-id|name> --json
Print file contents
打印文件内容
- Use when asked to extract text from a specific file (PDFs supported).
- Command:
moodle print course <course-id|name> <resource-id|name>
- 当被要求提取特定文件中的文本时使用(支持PDF格式)。
- 命令:
moodle print course <course-id|name> <resource-id|name>
Timetable (lectures)
课程表(授课安排)
- Use when asked about lecture times or next week’s schedule (this does NOT show exam deadlines).
- Command:
moodle list timetable --json
- Flags: ,
--days <n>,--next-week--unique
- 当被问及授课时间或下周日程时使用(不显示考试截止日期)。
- 命令:
moodle list timetable --json
- 参数:、
--days <n>、--next-week--unique
Download or export course
下载或导出课程
- Use when asked to download all files or export a full course.
- Commands:
moodle download file <course-id|name> <resource-id|name> --output-dir <path>moodle download file <course-id|name> --all --output-dir <path>moodle export course <course-id|name> --output-dir <path>
- 当被要求下载所有文件或导出完整课程时使用。
- 命令:
moodle download file <course-id|name> <resource-id|name> --output-dir <path>moodle download file <course-id|name> --all --output-dir <path>moodle export course <course-id|name> --output-dir <path>
Resources
资源
references/
references/
- : Quick command and data-location reference for the CLI.
moodle-cli.md - : Timetable command reference.
timetable.md
- :CLI的快速命令和数据位置参考文档。
moodle-cli.md - :课程表命令参考文档。
timetable.md