コースをアップロードする

提供:MoodleDocs
移動先:案内検索


作成中です - Mitsuhiro Yoshida (トーク)

コースをアップロードする Upload courses

新しいコースの作成に加えてコースアップロード機能はコースの更新および削除、別のコースからのコンテンツのインポートに使用することができます。この機能を使用したコーステンプレートの作成に関する情報は新しいコースの追加をご覧ください。 1つ以上のコースをアップロードするには:

  1. 「管理 > サイト管理 > コース > コースをアップロードする」にアクセスしてください。
  2. CSVファイルをドラッグ&ドロップするか、「ファイルを選択する」ボタンをクリックしてファイルピッカ内のファイルを選択してください。
  3. 適切なインポートオプションを慎重に選択した後、プレビューボタンをクリックしてください。
ファイル:26uploadcourses.png
コースアップロード管理画面
コースアップロード正常完了

メモ: コマンドラインツール「admin/tool/uploadcourse/cli/uploadcourse.php」を使用することもできます。

ウェブインターフェースを使用する場合、プレビューした行にエラーが検出されているかどうか確認するため「プレビュー」オプションを使用してください。コースのアップロード時にエラーが発生した場合、無視されます。

ファイル例 Short file example

uploadcourse.csv:

メモ: 「shortname」「fullname」「category」は必須です。

カテゴリ (category ) フィールドにはカテゴリIDが入ります。デフォルトカテゴリの「Miscellaneous」にはID「1」が割り当てられます。カテゴリはすでに存在している必要があります。あなたが存在しないカテゴリIDを使用した場合、アップロードのプレビューに「IDでカテゴリを解決できませんでした」エラーが表示されてそのカテゴリ内のコースは作成されません。

shortname,fullname,category,summary,enrolment_1,enrolment_1_role,enrolment_1_enrolperiod,role_student courserestored,Course restored,1,a summary,manual,student,1 month, courserestored2,Course restored 2,1,a summary,,,, courserestored3,Course restored 3,1,a summary,,,,padawan courserestored4,Course restored 4,1,"a summary, with comma",manual,student,1 month,padawan アイテム間に空白を入れないよう注意してください。

テキストファイルを作成する Creating the text file

The text file to upload courses must be a CSV file. It accepts the following columns which are divided in two categories, the course information, and the course actions.

コース情報フィールド Course information fields

Most of those settings are available on the settings page of a course. Please refer to Course settings for more information. Field names must be lower-case.

shortname
The shortname
fullname
The full name
idnumber
The ID number
category
The ID of the category to place the course in. This takes precedence over category_idnumber and category_path.
category_idnumber
The ID number of the category to place the course in. This takes precedence over category_path.
category_path
The path of the category to place the course in. If you want to place the course in a category named "Science-Fiction" which is located under the category "Movies", the value to provide is: Movies / Science-Fiction. Note that the separator must be [space]/[space]. Also note that the category MUST exist, it will not be created. If you want to place the course in the top-level category "Movies", the value to provide is: Movies
visible
1 if the course is visible, 0 if hidden
startdate
The time at which the course starts. Please note that this value is passed to the PHP function strtotime to generate a timestamp. Example 01.12.2014 (1st December 2014)
enddate
The time at which the course ends. Please note as with startdate that this value is passed to the PHP function strtotime to generate a timestamp. Example 01.12.2014 (1st December 2014)
summary
The summary of the course
format
The course format to use, this must be a valid course format plugin name. E.g. weeks, topics.
theme
The theme to use
lang
The language to use
newsitems
The number of news items
showgrades
1 to show the gradebook to students, 0 to hide it.
showreports
1 to show the activity reports, 0 to hide it.
legacyfiles
1 to enable the legacy course files, 0 not to.
maxbytes
The maximum upload size of the course in bytes. Use 0 for the site limit.
groupmode
0 for No groups, 1 for Separate groups and 2 for Visible groups.
groupmodeforce
1 to force the group mode, otherwise enter 0.
enablecompletion
1 to enable the activity completion, 0 not to.

登録フィールド Enrolment fields

Some fields can be constructed to enable and configure enrolment methods. The fields must be named enrolment_[number] for the enrolment method name, and enrolment_[number]_property for its properties.

enrolment_[number]
The name of the enrolment method (eg, manual, guest, self)
enrolment_[number]_delete
1 to delete this enrolment method from the course, if set to 1 all the other properties will be ignored.
enrolment_[number]_disable
1 to disable this enrolment method from the course, if set to 1 all the other properties will be ignored.
enrolment_[number]_startdate
The enrolment start date. This value is passed to the PHP function strtotime().
enrolment_[number]_enddate
The enrolment end date. This value is passed to the PHP function strtotime().
enrolment_[number]_enrolperiod
Number of seconds, or if not a value understood by strtotime() such as "4 days".
enrolment_[number]_role
The role short name
enrolment_[number]_[property]
Where property is understood by the specified enrolment method
enrolment_[number]_password
The course enrolment key

Note: Upload courses is not yet compatible with all enrolment methods (MDL-43127).

Example

enrolment_1: manual
enrolment_1_role: student
enrolment_1_enrolperiod: 1 month

enrolment_2: self
enrolment_2_startdate: 2013-01-30

ロールのリネーム Role renaming

To rename some roles, using the following pattern:

role_[shortname]
The new name of the role [shortname].

Example

role_student: Apprentice
role_teacher: Master
role_mycustomrole: Jedi

It is worth noting that the short name for the teacher role is editingteacher and the short name for the non-editing teacher is teacher.

コースアクションフィールド Course action fields

Those settings take precedence over the Course process parameters.

delete
1 to delete the course
rename
The shortname to rename the course to
backupfile
An absolute path to a backup file (.mbz) to import in the course.

(This means the full path to your course, for example /home/yourmoodle/public_html/moodle27/transfert/backup.mbz . If you are unsure of this, look at include_path in Site administration>Server>PHP info.)

templatecourse
The short name of a course to import the content from
reset
1 to reset the course

必須フィールド Mandatory fields

shortname
This field is mandatory for every operation, with the only exception of creating new courses. See details on the course process parameter Shortname template for more information.
fullname
Required when creating a new course.
category, category_idnumber, category_path
One of these is required when creating a course.

インポートオプション Import options

To prevent unexpected behaviour, you have to specify what you want the tool to be able to do.

Upload mode
This allows you to specify if courses can be created and/or updated.
Update mode
If you allow courses to be updated, you also have to tell the tool what to update the courses with.
Allow deletes
Whether the delete field is accepted or not
Allow renames
Whether the rename field is accepted or not
Allow resets
Whether the reset field is accepted or not

コース処理 Course process

This allows you to specify actions to be taken for every course uploaded.

Shortname template
If you are creating courses without a shortname, you can use this field to automatically generate a shortname. This field accepts two placeholders: %i for the ID number, %f for the summary.
Restore file
A backup file (.mbz) to import in the course after create/update.
Restore from course
The shortname of a course to import content from after create/update.
Reset after upload
Whether to reset the course after creating/updating it.

デフォルトコース値 Default course values

Those are values that can be set in the web interface for all the fields that are not specified in the CSV file. Note that they are always used when creating a course, but only when specified during update (see Update mode).

アップロードをスピードアップする Increasing speed

When importing the content of a backup file, or another course, you are advised to enable the setting keeptempdirectoriesonbackup. This will considerably speed up the process of the upload if you are importing multiple times from the same source.

関連情報