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

Code tidy up and improvement for alternate name fields.

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 2.6
    • 2.6
    • Libraries
    • MOODLE_26_STABLE
    • MOODLE_26_STABLE
    • wip-MDL-40612-master-one
    • Hide
      1. Run complete unit tests
      2. Check the following areas for errors / warnings.
      • Groups overview : Create some groups and check the users in each group.
      • Mod forum : Create a forum and a discussion and make some posts with different users.
      • quiz : make a quiz and make sure that you make some questions. Take the quiz with a few students. Check the following areas:
        • quiz report - attempts report
        • quiz report - basic report
        • question bank
      • SCORM : Create a scorm activity and do the activity with a few students. Check the following areas:
        • scorm interactions report
        • scorm objectives report
      Show
      Run complete unit tests Check the following areas for errors / warnings. Groups overview : Create some groups and check the users in each group. Mod forum : Create a forum and a discussion and make some posts with different users. quiz : make a quiz and make sure that you make some questions. Take the quiz with a few students. Check the following areas: quiz report - attempts report quiz report - basic report question bank SCORM : Create a scorm activity and do the activity with a few students. Check the following areas: scorm interactions report scorm objectives report

      As per Marina's suggestions:

      1. Add a 3rd parameter to the function get_all_user_name_fields() which specifies a prefix for the retrieved sql fields.
      2. adding a new function that does a reverse mapping, i.e. to substitute repeating pieces of code like

                    $allnames = get_all_user_name_fields();
                    foreach ($allnames as $allname) {
                        $tempname = 'creator' . $allname;
                        if (isset($question->$tempname)) {
                            $u->$allname = $question->$tempname;
                        }
                    }
        

        or the same without prefix

                    $allnames = get_all_user_name_fields();
                    foreach ($allnames as $addname) {
                        $userinfo[$reviewer->reviewerid]->$addname = $reviewer->$addname;
                    } 
        

            abgreeve Adrian Greeve
            abgreeve Adrian Greeve
            Jason Fowler Jason Fowler
            Sam Hemelryk Sam Hemelryk
            Jérôme Mouneyrac Jérôme Mouneyrac
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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