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

Add numeric field type for course custom fields

XMLWordPrintable

    • MOODLE_405_STABLE
    • MOODLE_405_STABLE
    • Hide
      1. Log in as admin
      2. Navigate to Courses > Default settings > Course custom fields in site administration
      3. Press Add a new category (if none already exists)
      4. Press Add a new custom field > Number
        • Name: Test
        • Shortname: test
        • Under Number field settings:
          • Default value: 2
          • Minimum value: 1
          • Maximum value: 5
          • Decimal places: 1
        • Save the field
      5. Navigate to Courses > Add a new course in site administration
      6. Enter course fullname/shortname
      7. Expand custom field category in form (usually Other fields)
      8. Confirm Test field default value is 2
      9. Set Test field to 0.6 and save
      10. Confirm you see the following form field error:
        • Value must be greater than or equal to 1.0
      11. Set Test field to 5.1 and save
      12. Confirm you see the following form field error:
        • Value must be less than or equal to 5.0
      13. Set Test field to 4.59 and save
      14. Manually navigate to <WWWROOT>/course/index.php
      15. Confirm the course summary shows the following:
        • Test: 4.6
      16. Edit the course settings
      17. Clear the value of the Test field and save
      18. Manually navigate to <WWWROOT>/course/index.php
      19. Confirm the course summary does not show anything for the Test field
      Show
      Log in as admin Navigate to Courses > Default settings > Course custom fields in site administration Press Add a new category (if none already exists) Press Add a new custom field > Number Name: Test Shortname: test Under Number field settings : Default value: 2 Minimum value: 1 Maximum value: 5 Decimal places: 1 Save the field Navigate to Courses > Add a new course in site administration Enter course fullname/shortname Expand custom field category in form (usually Other fields ) Confirm Test field default value is 2 Set Test field to 0.6 and save Confirm you see the following form field error: Value must be greater than or equal to 1.0 Set Test field to 5.1 and save Confirm you see the following form field error: Value must be less than or equal to 5.0 Set Test field to 4.59 and save Manually navigate to <WWWROOT>/course/index.php Confirm the course summary shows the following: Test: 4.6 Edit the course settings Clear the value of the Test field and save Manually navigate to <WWWROOT>/course/index.php Confirm the course summary does not show anything for the Test field

      Currently the only fields available for course custom fields are

      • Checkbox
      • Date and time
      • Dropdown menu
      • Short text
      • Text area

      It would be helpful to have an option for a purely numerical value here, that could be used for course credits etc. The text areas can be used for this, but the workplace report builder doesn't have the same aggregation options for these fields (particularly SUM) as it does for other columns. So a numerical field would add the functionality for custom fields to be more easily in numerical operations by other components. The functionality here overlaps with workplace features, but the base feature is in Moodle core, so I thought I'd post it here. I'm happy to field any clarifying questions as well .

      Thanks!

            pholden Paul Holden
            daph.hiebert@moodle.com Daph Hiebert
            Carlos Castillo Carlos Castillo
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 35 minutes
                1h 35m

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