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

Files for question hints are not deleted when the question is deleted, nor moved when the question is moved to another context

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2.1
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. Create one of each question type, adding an image to every HTML editor on the question editing form. (Well, ideally that is what you would do. If you can't be bothered, add an image to at least one hint for every question editing form that has hints.)

      2. Move all those questions to a different context in the question bank. For example, move the question category that contains them from the course level of the question bank to the quiz level, or to the system level.

      3. Verify that all the images in the hints are still there.

      4. If you are able, then delete all these questions, and verify that the corresponding files are gone from the files table. However, I think the only way to verify that is to look directly in the DB.

      Show
      1. Create one of each question type, adding an image to every HTML editor on the question editing form. (Well, ideally that is what you would do. If you can't be bothered, add an image to at least one hint for every question editing form that has hints.) 2. Move all those questions to a different context in the question bank. For example, move the question category that contains them from the course level of the question bank to the quiz level, or to the system level. 3. Verify that all the images in the hints are still there. 4. If you are able, then delete all these questions, and verify that the corresponding files are gone from the files table. However, I think the only way to verify that is to look directly in the DB.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Summary says it all really.

        Gliffy Diagrams

          Attachments

            Activity

            timhunt Tim Hunt created issue -
            timhunt Tim Hunt made changes -
            Field Original Value New Value
            Fix Version/s STABLE backlog [ 10463 ]
            Priority Minor [ 4 ] Critical [ 2 ]
            Labels triaged
            timhunt Tim Hunt made changes -
            Status Open [ 1 ] Waiting for integration review [ 10010 ]
            Pull Master Diff URL https://github.com/timhunt/moodle/compare/master...MDL-31729
            Pull Master Branch MDL-31729
            Pull from Repository git://github.com/timhunt/moodle.git
            Fix Version/s 2.1.5 [ 11553 ]
            Fix Version/s 2.2.2 [ 11552 ]
            Fix Version/s 2.3 [ 10657 ]
            Fix Version/s STABLE backlog [ 10463 ]
            Testing Instructions 1. Create one of each question type, adding an image to every HTML editor on the question editing form. (Well, ideally that is what you would do. If you can't be bothered, add an image to at least one hint for every question editing form that has hints.)

            2. Move all those questions to a different context in the question bank. For example, move the question category that contains them from the course level of the question bank to the quiz level, or to the system level.

            3. Verify that all the images in the hints are still there.
            1. Create one of each question type, adding an image to every HTML editor on the question editing form. (Well, ideally that is what you would do. If you can't be bothered, add an image to at least one hint for every question editing form that has hints.)

            2. Move all those questions to a different context in the question bank. For example, move the question category that contains them from the course level of the question bank to the quiz level, or to the system level.

            3. Verify that all the images in the hints are still there.

            4. If you are able, then delete all these questions, and verify that the corresponding files are gone from the files table. However, I think the only way to verify that is to look directly in the DB.
            Pull 2.1 Branch MDL-31729_21
            Pull 2.2 Diff URL https://github.com/timhunt/moodle/compare/MOODLE_22_STABLE...MDL-31729_22
            Pull 2.1 Diff URL https://github.com/timhunt/moodle/compare/MOODLE_21_STABLE...MDL-31729_21
            Pull 2.2 Branch MDL-31729_22
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            stronk7 Eloy Lafuente (stronk7) made changes -
            Currently in integration Yes [ 10041 ]
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
            Integrator stronk7
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks!

            PS: Just guessing if there is some rule (explicit or tacit) about separating the description phpdocs form the param ones. At least for me (vim raw reader, you know) it helps a bit. Nothing critical, though, just a reflexion.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! PS: Just guessing if there is some rule (explicit or tacit) about separating the description phpdocs form the param ones. At least for me (vim raw reader, you know) it helps a bit. Nothing critical, though, just a reflexion.
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
            Fix Version/s 2.3 [ 10657 ]
            Hide
            timhunt Tim Hunt added a comment -

            Well, for me it depends on how long the whole comment is. If the comment is short, then I probably will not add much whitespace. If the comment is long, I will add whitespace.

            I would do the same with code in a function of method. If it is short, keep it compact. If it is long, use whitespace to break it up into logical chunks.

            Show
            timhunt Tim Hunt added a comment - Well, for me it depends on how long the whole comment is. If the comment is short, then I probably will not add much whitespace. If the comment is long, I will add whitespace. I would do the same with code in a function of method. If it is short, keep it compact. If it is long, use whitespace to break it up into logical chunks.
            abgreeve Adrian Greeve made changes -
            Tester abgreeve
            abgreeve Adrian Greeve made changes -
            Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
            Hide
            abgreeve Adrian Greeve added a comment -

            Tested in master, 2.2 and 2.1
            Everything worked fine.
            I did noticed that when I tried to delete the question from the question bank, that if it was associated with a quiz, the question would be removed from the list. I know that the message says that it is being used in a quiz and will not be deleted. I was just curious, How would you delete the question out of the database if you deleted the quiz after this point?

            Show
            abgreeve Adrian Greeve added a comment - Tested in master, 2.2 and 2.1 Everything worked fine. I did noticed that when I tried to delete the question from the question bank, that if it was associated with a quiz, the question would be removed from the list. I know that the message says that it is being used in a quiz and will not be deleted. I was just curious, How would you delete the question out of the database if you deleted the quiz after this point?
            abgreeve Adrian Greeve made changes -
            Status Testing in progress [ 10011 ] Tested [ 10006 ]
            Hide
            timhunt Tim Hunt added a comment -

            When testing this, you must test with questions that are not used in any quiz, so that Moodle really deleted them. Sorry I did not make that clear in the Testing instructions.

            To see the 'deleted but not really' questions, you need to turn on the 'Show hidden questions' option in the question bank.

            Show
            timhunt Tim Hunt added a comment - When testing this, you must test with questions that are not used in any quiz, so that Moodle really deleted them. Sorry I did not make that clear in the Testing instructions. To see the 'deleted but not really' questions, you need to turn on the 'Show hidden questions' option in the question bank.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Well,

            I wish I said it every time
            you do the things you do.
            You always lend a helping hand,
            and I'm filled with gratitude.

            You are strong and generous
            for each and everyone one of us.
            I am eternally grateful,
            I cannot say thanks enough.

            Sorry for the (un)cool bit above, lol. Closing this as fixed. Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Well, I wish I said it every time you do the things you do. You always lend a helping hand, and I'm filled with gratitude. You are strong and generous for each and everyone one of us. I am eternally grateful, I cannot say thanks enough. Sorry for the (un)cool bit above, lol. Closing this as fixed. Ciao
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Tested [ 10006 ] Closed [ 6 ]
            Resolution Fixed [ 1 ]
            Currently in integration Yes [ 10041 ]
            Integration date 01/Mar/12

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Mar/12