コースをアップロードする
作成中です - Mitsuhiro Yoshida (トーク)
コースをアップロードする Upload courses
新しいコースの作成に加えてコースアップロード機能はコースの更新および削除、別のコースからのコンテンツのインポートに使用することができます。この機能を使用したコーステンプレートの作成に関する情報は新しいコースの追加をご覧ください。 1つ以上のコースをアップロードするには:
- 「管理 > サイト管理 > コース > コースをアップロードする」にアクセスしてください。
- CSVファイルをドラッグ&ドロップするか、「ファイルを選択する」ボタンをクリックしてファイルピッカ内のファイルを選択してください。
- 適切なインポートオプションを慎重に選択した後、プレビューボタンをクリックしてください。
メモ: コマンドラインツール「admin/tool/uploadcourse/cli/uploadcourse.php」を使用することもできます。
ウェブインターフェースを使用する場合、プレビューした行にエラーが検出されているかどうか確認するため「プレビュー」オプションを使用してください。コースのアップロード時にエラーが発生した場合、無視されます。
ファイル例
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
アイテム間に空白を入れないよう注意してください。
テキストファイルを作成する
コースをアップロードするテキストファイルはCSVファイルにしてください。CSVファイルには「コース情報」および「コースアクション」の2つのカテゴリに分けられた以下のカラムを記述することができます。
コース情報フィールド
以下ほとんどの設定はコースの設定ページで利用することができます。詳細はコース設定をご覧ください。フィールド名は小文字にしてください。
- shortname
- コース省略名
- fullname
- 長いコース名
- idnumber
- IDナンバー
- category
- コースが入れられるカテゴリのIDです。これは「category_idnumber」および「category_path」に優先します。
- category_idnumber
- コースが入れられるカテゴリのIDナンバーです。これは「category_path」に優先します。
- category_path
- コースが入れられるカテゴリのパスです。あなたがカテゴリ「Movies」内のカテゴリ「Science-Fiction」にコースを入れたい場合、次のような記述になります:
Movies / Science-Fiction
分離記号は[space]/[space]
のように記述してください。また、カテゴリは作成されないため存在している必要があります。あなたがトップレベルのカテゴリ「Movies 」にコースを置きたい場合、記述する内容は次のようになります: Movies
- visible
- コースを表示する場合 = 1、コースを非表示にする場合 = 2
- startdate
- コースの開始日時です。この値はタイムスタンプを生成するためにPHP関数strtotimeに渡されることに留意してください。例 01.12.2014 (2014年12月1日)
- enddate
- コースの終了日時です。この値はstartdateと同じくタイムスタンプを生成するためにPHP関数strtotimeに渡されることに留意してください。例 01.12.2014 (2014年12月1日)
- summary
- コース概要です。
- format
- 使用するコースフォーマットです。これは有効なコースフォーマットプラグイン名である必要があります。例) 「週」「トピック」
- theme
- 使用するテーマです。
- lang
- 使用する言語です。
- newsitems
- ニュースアイテム数です。
- showgrades
- 「1」は学生に評定表を表示します。「0」は学生から評定表を隠します。
- showreports
- 「1」は活動レポートを表示します。「0」は活動レポートを隠します。
- legacyfiles
- 「1」はレガシーコースファイルを有効にします。「0」はレガシーコースファイルを無効にします。
- maxbytes
- コースの最大アップロードサイズ (バイト) です。無制限にする場合、「0」を使用してください。
- groupmode
- 「0」は「グループなし」、「1」は「分離グループ」、「2」は「可視グループ」です。
- groupmodeforce
- 「1」はグループモードを強制します。グループモードを強制しない場合、「0」を入力してください。
- enablecompletion
- 「1」は活動完了を有効にします。「0」は活動完了を有効にしません。
登録フィールド Enrolment fields
いくつかのフィールドは登録方法を有効化および設定するために作成されています。登録フィールドは登録方法名に「enrolment_[number]」、プロパティに「enrolment_[number]_property」のような名称をつける必要があります。
- enrolment_[number]
- 登録方法名です (例 「manual」「guest」「self」)。
- enrolment_[number]_delete
- 「1」を設定した場合、この登録方法をコースから削除します。「1」を設定した場合、他のすべての属性は無視されます。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.
関連情報
- Demo screencast: Bulk course creation
- Upload users
- Creating course templates in Moodle 2.6 blog post by Mary Cooch