Moodle
  1. Moodle
  2. MDL-26324

Existing Quiz Feedback on Non-Graded Quizzes Prevents Editing

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.10, 2.0.2
    • Fix Version/s: 1.9.11, 2.0.3
    • Component/s: Quiz
    • Labels:
    • Environment:
      RHEL 5, PHP 5, MySQL 5
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Rank:
      16029

      Description

      When a quiz has feedback text or boundaries associated with it - but is marked as non-graded - it becomes impossible to edit the quiz because the fields which are marked as disabled (because mdl_quiz.grade = 0) have content which returns validation errors, but the feedback cannot be truncated without using developer tools to modify the DOM directly.

      Here's a query to find the affected quiz feedback in your system (assumes a mdl_ prefix):

      SELECT mdl_quiz_feedback.*
      FROM mdl_quiz_feedback, mdl_course_modules AS m, mdl_modules AS m2, mdl_quiz AS q
      WHERE mdl_quiz_feedback.quizid = m.instance
      AND m.instance = q.id
      AND m.module = m2.id
      AND m2.name = 'quiz'
      AND q.grade = 0
      AND mdl_quiz_feedback.feedbacktext != ''

      You can swap the SELECT to DELETE to mass "fix" this issue. I would propose that these fields be automatically truncated by simply not populating them when the quiz is not graded.

        Activity

        Hide
        Tim Hunt added a comment -

        This is related to MDL-18583 and MDL-18871, which added the extra validation to the form.

        I see the problem. Just to be clear, to reproduce:

        1. Create a quiz with at least two lots of overall feedback text.
        2. Go the the quiz edit page, and change the max grade for the quiz to 0.
        3. Go back to the editing form.
        4. Try to click save.

        And I can see two possible solutions.

        A. When showing the form, throw away any overall feedback other than the first.
        B. Don't disable the form fields that should be empty, but which currently are not.

        A. is your suggestion and is simpler. My only worry is that it involves silently throwing away user's data.

        I guess A. is the way to go.

        Show
        Tim Hunt added a comment - This is related to MDL-18583 and MDL-18871 , which added the extra validation to the form. I see the problem. Just to be clear, to reproduce: 1. Create a quiz with at least two lots of overall feedback text. 2. Go the the quiz edit page, and change the max grade for the quiz to 0. 3. Go back to the editing form. 4. Try to click save. And I can see two possible solutions. A. When showing the form, throw away any overall feedback other than the first. B. Don't disable the form fields that should be empty, but which currently are not. A. is your suggestion and is simpler. My only worry is that it involves silently throwing away user's data. I guess A. is the way to go.
        Hide
        David Mudrak added a comment -

        This has been integrated and tested and will be part of the next weekly release. Thanks Jonathan for the report and Tim for the fix.

        I had the same worry about silent throwing data away for the first sight. But data are lost only after re-saving the form which can be considered as a confirmation here.

        Show
        David Mudrak added a comment - This has been integrated and tested and will be part of the next weekly release. Thanks Jonathan for the report and Tim for the fix. I had the same worry about silent throwing data away for the first sight. But data are lost only after re-saving the form which can be considered as a confirmation here.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: