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

Calculated Question - Negative Answer with Units

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.7.2
    • Questions
    • None
    • MOODLE_27_STABLE

      We have an instructor who is using the Calculated Question type. The answer can be positive or negative depending on the variable used. The question is also set to have a unit of measurement.

      When the answer is negative and has a unit of measurement it will not accept the correct answer.

      There is a Moodle forum post from 2005 that appears to be exactly this issue. The URL is here.
      https://moodle.org/mod/forum/discuss.php?d=17311&mode=3

      The second response is from a developer/coder and appears to contain a correct questiontype.php file.

      Here is the information copied from our support document.

      Description: When creating a calculated questions in Joule, Joule is flagging correct answers (within range) as being out of range, which is preventing me from updating the data set. I also cannot delete elements from the data set in those questions. It seems to be related to the fact that the correct answer is a negative number (and I am giving 80% partial credit for having the negative of the correct answer).

      The specific questions that are giving me trouble are in SP2015 ENGN 300-01, ENGN 300-02. In the question bank, it is the first and second random questions in the category called "KVL".

      When previewing the questions, they work correctly and give partial credit correctly. It seems the bug is only on the data set editing page.

      Error Message(s) Received: -1.8+(-5.1)+(-3.6) = -10.5 V
      ERROR Correct answer : -10.5 V outside limits of true value
      Min: -10.6 V — Max: -10.4 V

      The "outside limits" error that I am experiencing is caused when the correct answer is negative AND units are being used on the question.

      I have attached two questions, exported in Moodle XML format, that illustrate this "outside limits" error.

      -TEST1 works correctly and negative answers are reported as "inside limits" on 3rd page (data set page).

      -TEST2 is exactly the same except I introduced units (V). In this case, negative answers are reported as "outside limits" on the 3rd page (data set page). No matter how I change the tolerance parameters, negative answers are always "outside limits".

            timhunt Tim Hunt
            jkrasnic@olivet.edu Jon Krasnichan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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