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 Bug
    • Status: Closed
    • Priority: Critical 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:
    • Rank:
      38322

      Description

      Summary says it all really.

        Activity

        Hide
        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
        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
        Hide
        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
        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.
        Hide
        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
        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.
        Hide
        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
        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?
        Hide
        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
        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
        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
        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: