Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66135

Add support for custom course fields to Upload courses

XMLWordPrintable

    • MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • Hide

      Create custom course fields

      1. Login as admin
      2. Navigate to Courses > Course custom fields in site administration
      3. Click on Add a new custom field to add the following fields
        1. Checkbox (Name: Checkbox; Short name: checkbox)
        2. Date and time (Name: Date; Short name: date; Include time: checked)
        3. Dropdown menu: (Name: Select; Short name: select; Menu options: a,b,c [one per line])
        4. Short text: (Name: Text; Short name: text)
        5. Text area: (Name: Textarea; Short name: textarea)

      Perform course upload

      1. Navigate to Courses > Upload courses in site administration
      2. Upload courses_custom_fields.csv to the File element
      3. Under Import options set Upload mode to Create new courses only, skip existing ones
      4. Press Preview
      5. Confirm the Upload courses preview table result column contains a tick for the course we are uploading (Short name: CF1; Full name: Course fields 1)
      6. Press Upload courses
      7. Confirm the Upload courses results table status column contains Course created for our new course
      8. Confirm you see the text Courses total: 1
      9. Confirm you see the text Courses created: 1
      10. Press Continue

      Verify custom fields were added

      1. Navigate to site homepage
      2. Confirm new course Course fields 1 is listed
      3. Confirm you see each of the custom fields we added:
        1. Checkbox: Yes
        2. Date: Tuesday, 1 October 2019, 2:00 PM
        3. Select: b
        4. Text: Hello
        5. Textarea: Goodbye

      Run automated tests

      (can leave this to CI, dear tester)

      1. $ vendor/bin/phpunit --testsuite tool_uploadcourse_testsuite,core_customfield_testsuite,customfield_select_testsuite,customfield_date_testsuite
      2. $ admin/tool/behat/cli/run.php --name="An admin can update courses using a CSV file"
      3. $ admin/tool/behat/cli/run.php --name="An admin can create courses using a CSV file"
      Show
      Create custom course fields Login as admin Navigate to Courses > Course custom fields in site administration Click on Add a new custom field to add the following fields Checkbox (Name: Checkbox; Short name: checkbox) Date and time (Name: Date; Short name: date; Include time: checked) Dropdown menu: (Name: Select; Short name: select; Menu options: a,b,c [one per line]) Short text: (Name: Text; Short name: text) Text area: (Name: Textarea; Short name: textarea) Perform course upload Navigate to Courses > Upload courses in site administration Upload courses_custom_fields.csv to the File element Under Import options set Upload mode to Create new courses only, skip existing ones Press Preview Confirm the Upload courses preview table result column contains a tick for the course we are uploading (Short name: CF1; Full name: Course fields 1) Press Upload courses Confirm the Upload courses results table status column contains Course created for our new course Confirm you see the text Courses total: 1 Confirm you see the text Courses created: 1 Press Continue Verify custom fields were added Navigate to site homepage Confirm new course Course fields 1 is listed Confirm you see each of the custom fields we added: Checkbox: Yes Date: Tuesday, 1 October 2019, 2:00 PM Select: b Text: Hello Textarea: Goodbye Run automated tests (can leave this to CI, dear tester) $ vendor/bin/phpunit --testsuite tool_uploadcourse_testsuite,core_customfield_testsuite,customfield_select_testsuite,customfield_date_testsuite $ admin/tool/behat/cli/run.php --name="An admin can update courses using a CSV file" $ admin/tool/behat/cli/run.php --name="An admin can create courses using a CSV file"

      With the addition of custom course fields in MDL-57898 I was hoping there would be a way to bulk update/add values. 

      Based on my testing with Moodle 3.7/3.71 I don't see a way to this. The most logical option would seem to be the Upload course tool. For it to be really useful this should be implemented too: MDL-43056

       

            pholden Paul Holden
            schweit@isu Jeremy Schweitzer
            David Carrillo David Carrillo
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            2 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 1 hour, 50 minutes
                2d 1h 50m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.