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

Grade item mappings when importing grade needs translation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.6, 2.5.2
    • Fix Version/s: 2.4.7, 2.5.3
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide
      1. Add a second language of your choice in your site.
      2. Temporarily update manually (In AMOS after integration) the following strings for this language in "Site administration > Language > Language customisation" (file grades.php) :
        • feedbacks
        • feedbackforgradeitems
        • ignore
        • others
        • userid
      3. Create a new course and enroll some students in it.
      4. Add 1 assignment in the course.
      5. Add 1 new grade item in "Grade administration > Categories and items > Simple view", "Add grade item" button.
      6. Update grades of the assignment and grade item for some students.
      7. Export grades to CSV file (Plain text file with tab separator).
      8. Re-update or erase grades of the assignment and grade item for the same students updated above.
      9. Import grades from the CSV file exported: go to "Grade administration > Import > CSV file", upload file and click on "Upload grades" button.
      10. Assert that the values are displayed correctly in the following dropdown lists :
        • Identify user by > Map to
        • Grade item mappings (Any list)
      11. Map values like this :
        • Identify user by > Map from : Username
        • Identify user by > Map to : Username
        • Grade item mappings > Assignment: (Name of the assignment): Assignment: (Name of the assignment)
        • Grade item mappings > (Name of the grade item) : (Name of the grade item)
      12. Click on "Upload grades" button
        Import should be a success
      13. Redo 8 to 12 but with the other language selected.
      Show
      Add a second language of your choice in your site. Temporarily update manually (In AMOS after integration) the following strings for this language in "Site administration > Language > Language customisation" (file grades.php) : feedbacks feedbackforgradeitems ignore others userid Create a new course and enroll some students in it. Add 1 assignment in the course. Add 1 new grade item in "Grade administration > Categories and items > Simple view", "Add grade item" button. Update grades of the assignment and grade item for some students. Export grades to CSV file (Plain text file with tab separator). Re-update or erase grades of the assignment and grade item for the same students updated above. Import grades from the CSV file exported: go to "Grade administration > Import > CSV file", upload file and click on "Upload grades" button. Assert that the values are displayed correctly in the following dropdown lists : Identify user by > Map to Grade item mappings (Any list) Map values like this : Identify user by > Map from : Username Identify user by > Map to : Username Grade item mappings > Assignment: (Name of the assignment): Assignment: (Name of the assignment) Grade item mappings > (Name of the grade item) : (Name of the grade item) Click on "Upload grades" button Import should be a success Redo 8 to 12 but with the other language selected.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38317-master

      Description

      In the gradebook, the item mapping section when importing grades is not translated. The following labels are hardcoded in the grade_import_mapping_form:

      • comments for
      • others
      • ignore
      • newgradeitem
      • comments

      The related code, in /grade/import/grade_import_form.php:

              $comments = array();
              if ($gradeitems = $this->_customdata['gradeitems']) {
                  foreach ($gradeitems as $itemid => $itemname) {
                      $comments['feedback_'.$itemid] = 'comments for '.$itemname;
                  }
              }
       
              if ($header) {
                  $i = 0; // index
                  foreach ($header as $h) {
                      $h = trim($h);
                      // this is what each header maps to
                      $mform->addElement('selectgroups', 'mapping_'.$i, s($h),
                          array('others'=>array('0'=>'ignore', 'new'=>'new gradeitem'),
                          'gradeitems'=>$gradeitems,
                          'comments'=>$comments));
                      $i++;
                  }
              }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Nov/13