Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-6209

Grades FAQ: Improve "quiz attempt" formula by using "if"

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Low
    • Resolution: Done
    • Component/s: docs.moodle.org
    • Labels:
      None

      Description

      In the Grades FAQ for 3.7, the section How do I give a fixed score for a successful quiz attempt gives the formula

      =min(round((||quiz||/40)-0.49,0),1)*5

      It uses the "magic number" 0.49, minimum and rounding to simulate a case distinction.
      It would be better to simply implement this with a conditional (or to at least mention this possibility for newer Moodle versions that have the "if" available):

      =if([[quiz]]>=40, 5, 0)

        Attachments

          Activity

            People

            Assignee:
            tsala Helen Foster
            Reporter:
            jondo Robert Pollak
            Participants:
            Component watchers:
            Helen Foster
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: