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

evalmath.class used by Gradebook returns errors that are not translatable lang strings

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 2.1
    • Component/s: Gradebook, Libraries
    • Labels:
    • Testing Instructions:
      Hide

      Test calculated columns in the gradebook.
      1. Try making a formula with an error. You should get a localised error. (Best if you check this in non-English lang)
      2. Check that existing and new calculated columns still basically work.
      3. Test formulae like:

      • =pi()*2
      • =min([[gixx]], [[giyy]]) (gixx and giyy being grade item idnumbers)
      • =round(10.12345,2)
        4. Run lib/simpletest/testmathslib.php
      Show
      Test calculated columns in the gradebook. 1. Try making a formula with an error. You should get a localised error. (Best if you check this in non-English lang) 2. Check that existing and new calculated columns still basically work. 3. Test formulae like: =pi()*2 =min([ [gixx] ], [ [giyy] ]) (gixx and giyy being grade item idnumbers) =round(10.12345,2) 4. Run lib/simpletest/testmathslib.php
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Gliffy Diagrams

        Issue Links

          Activity

          Hide
          timhunt Tim Hunt added a comment -

          Here is a cleaned up branch of Jamie's mathslib changes, which include this bug, MDL-27139 and MDL-27659 and some other good things. https://github.com/timhunt/moodle/compare/master...evalmath

          Now, in one sense EvalMath is a third-party library. However, it has not been maintained since 2005 (http://www.phpclasses.org/browse/feed/changes/package/2695.xml). So perhaps it is time to admit that we are responsible for making it better, and not worry about 'forking' it.

          Therefore, I would really like to get Jamies changes into 2.1. It is obviously good for the gradebook, but I have an ulterior motive. A custom question type that Jamie has developed for us relies of these changes, and I would rather see these changes in core than have to just apply them locally.

          Comments please.

          Show
          timhunt Tim Hunt added a comment - Here is a cleaned up branch of Jamie's mathslib changes, which include this bug, MDL-27139 and MDL-27659 and some other good things. https://github.com/timhunt/moodle/compare/master...evalmath Now, in one sense EvalMath is a third-party library. However, it has not been maintained since 2005 ( http://www.phpclasses.org/browse/feed/changes/package/2695.xml ). So perhaps it is time to admit that we are responsible for making it better, and not worry about 'forking' it. Therefore, I would really like to get Jamies changes into 2.1. It is obviously good for the gradebook, but I have an ulterior motive. A custom question type that Jamie has developed for us relies of these changes, and I would rather see these changes in core than have to just apply them locally. Comments please.
          Show
          timhunt Tim Hunt added a comment - See http://moodle.org/mod/cvsadmin/view.php?conversationid=7707#c280422
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Integrated, many thanks Jamie and Tim!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, many thanks Jamie and Tim!
          Hide
          timhunt Tim Hunt added a comment -

          I am sorry, but somehow when I got Jamie's evalmath changes ready to integrate, I missed 4 commits. I have not sorted them out onto a separate branch. I will create a new MDL for them, and submit my branch for integration.

          Show
          timhunt Tim Hunt added a comment - I am sorry, but somehow when I got Jamie's evalmath changes ready to integrate, I missed 4 commits. I have not sorted them out onto a separate branch. I will create a new MDL for them, and submit my branch for integration.
          Hide
          marina Marina Glancy added a comment -

          everything ok, error message is localized (at least it became localized after I added a errorcalculationunknown string to a language pack).

          2. Calculated formulas work but only if there is a reference to another grade ("=2" does not work). But I can still make formula static by typing something like: "=2+[[q]]-[[q]]"

          4. "Direct access to this script is forbidden."

          Show
          marina Marina Glancy added a comment - everything ok, error message is localized (at least it became localized after I added a errorcalculationunknown string to a language pack). 2. Calculated formulas work but only if there is a reference to another grade ("=2" does not work). But I can still make formula static by typing something like: "=2+[ [q] ]-[ [q] ]" 4. "Direct access to this script is forbidden."
          Hide
          timhunt Tim Hunt added a comment -

          Thanks for testing.

          4. Run unit tests in ... means go to Admin -> Development -> Unit tests; Type lib/simpletest/testmathslib.php in the only run tests in box; then click Run tests.

          You should see s green bar like: 1/1 test cases complete: 46 passes, 0 fails and 0 exceptions. Any red, and that is a problem you need to report.

          I just ran these tests, and they pass for me.

          2. See recent discussion in HQ chat about 2. Basically, formulas that do no refer to another grade are not being calculated properly in 2.0 or 2.1, but that is a gradebook bug. Evalmath seems to be fine.

          Show
          timhunt Tim Hunt added a comment - Thanks for testing. 4. Run unit tests in ... means go to Admin -> Development -> Unit tests; Type lib/simpletest/testmathslib.php in the only run tests in box; then click Run tests. You should see s green bar like: 1/1 test cases complete: 46 passes, 0 fails and 0 exceptions. Any red, and that is a problem you need to report. I just ran these tests, and they pass for me. 2. See recent discussion in HQ chat about 2. Basically, formulas that do no refer to another grade are not being calculated properly in 2.0 or 2.1, but that is a gradebook bug. Evalmath seems to be fine.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Upstream-ized! Thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Upstream-ized! Thanks!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                1/Jul/11