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

Extend csv import of mod_data to import author information

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Integration review in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8
    • Fix Version/s: None
    • Labels:
    • Testing Instructions:
      Hide

      Setup:

      1. Login as a teacher
      2. Create a data instance
      3. Add a field and define templates (you should add ##user## to one
      4. Login as a student.
      5. Add some entries

      Test 1:

      1. Login as a teacher.
      2. Export the entries without user data.
      3. Import the same file.
      4. Check that the imported entries are authored by the teacher that imported the entries.

      Test 2:

      1. Login as a teacher.
      2. Export the entries with user data.
      3. Import the same file.
      4. Check that the imported entries are authored by the student.

      Test 3:

      1. Login as a teacher.
      2. Add another field called the same way as the Username field of one of the previous  tests.
      3. Export the entries with user data.
      4. Import the same file.
      5. Check that the imported entries are authored by the student.
      6. Check that the Username field of the entries is set correctly.

      Test 4:

      1. Login as a teacher.
      2. Add another field called the same way as the Username field of one of the previous  tests. (If not already done in Test 3)
      3. Export the entries without user data
      4. Import the same file
      5. Check that the imported entries are authored by the teacher.
      6. Check that the Username field of the entries is set correctly.

       

      Show
      Setup: Login as a teacher Create a data instance Add a field and define templates (you should add ##user## to one Login as a student. Add some entries Test 1: Login as a teacher. Export the entries without user data. Import the same file. Check that the imported entries are authored by the teacher that imported the entries. Test 2: Login as a teacher. Export the entries with user data. Import the same file. Check that the imported entries are authored by the student. Test 3: Login as a teacher. Add another field called the same way as the Username field of one of the previous  tests. Export the entries with user data. Import the same file. Check that the imported entries are authored by the student. Check that the Username field of the entries is set correctly. Test 4: Login as a teacher. Add another field called the same way as the Username field of one of the previous  tests. (If not already done in Test 3) Export the entries without user data Import the same file Check that the imported entries are authored by the teacher. Check that the Username field of the entries is set correctly.  
    • Affected Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      MDL-66496-master

      Description

      Currently, when importing entries to a mod_data instance, it is possible to have the user metadata fields within the csv, but these fields are simply skipped.

      It would be nice, if the importer could use these fields, recognize the author of the entry and apply this information. I would suggest to use the username for the mapping to the user and use the same column names for identification as the exporter uses.

      About the corner cases:
      If no username is specified or the username does not belong to a valid user, the uploading user is used as an author.

      If a field is specified within the data instance, which has the same name as the Username field:

      1. And the uploaded file contains two username columns: The first is used for the username field and the second for the identification of the author.
      2. And the uploaded file contains only one username columns: The one entry is used for the username field. The uploading user is set as the author.

        Attachments

          Activity

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 minutes
                5m