Moodle
  1. Moodle
  2. MDL-18896

Ability to remove unused columns in Quiz index page

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.4
    • Fix Version/s: 1.9.6
    • Component/s: Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      As discussed from the forum post: http://moodle.org/mod/forum/discuss.php?d=121429

      We need a way to remove the "Quiz Closes" and/or "feedback" column if they are not being used. It appears that even though they are empty, the columns still exist.

      Although it doesn't directly impact on any functionality of the site, I put this priority level as major, because it clearly does affect the aesthetics of a site and is a pretty straightforward feature that I'm sure should be considered for everyone.

        Gliffy Diagrams

        1. index.patch.txt
          0.7 kB
          Andrew Davis
        2. index.quizclose-feedback.patch
          2 kB
          Sam Hemelryk
        3. index-quizclose.patch
          1 kB
          Sam Hemelryk
        1. quiz closes.jpg
          19 kB

          Activity

          Hide
          Chaitu Ambati added a comment -

          Dear Tim,

          Will there ever be a fix for this? Or will it just be an update for a new version?
          Is there no way to manually hide these?

          Thanks!

          Show
          Chaitu Ambati added a comment - Dear Tim, Will there ever be a fix for this? Or will it just be an update for a new version? Is there no way to manually hide these? Thanks!
          Hide
          Tim Hunt added a comment -

          There will be a fix for this when someone has time to make one when they do not have anything of a higher priority to work on. Sorry, I don't know when I will have time. Fortunately, this is open source, so waiting for me to have time is not the only option.

          Show
          Tim Hunt added a comment - There will be a fix for this when someone has time to make one when they do not have anything of a higher priority to work on. Sorry, I don't know when I will have time. Fortunately, this is open source, so waiting for me to have time is not the only option.
          Hide
          Sam Hemelryk added a comment -

          Hi Tim,
          I have attached a patch that hides the closing date if no quizzes have a closing date.
          Unfortunately by the looks of it hiding the feedback column if no feedback exists will require considerable changes to /mod/quiz/index.php
          unless you are aware of any easy way to determine this.
          Let me know what you think.
          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Hi Tim, I have attached a patch that hides the closing date if no quizzes have a closing date. Unfortunately by the looks of it hiding the feedback column if no feedback exists will require considerable changes to /mod/quiz/index.php unless you are aware of any easy way to determine this. Let me know what you think. Cheers Sam
          Hide
          Sam Hemelryk added a comment -

          After looking at it a little more I can up with this patch. This patch hides both the closing date field if none exist and the feedback field if no feedback exists!
          The catch to it is that it only hides the feedback field if there is no feedback messages or boundaries set for any of the quizzes.
          Thus feedback WILL be shown if there is a potential feedback even if no one has received it yet.
          Let me know what you think
          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - After looking at it a little more I can up with this patch. This patch hides both the closing date field if none exist and the feedback field if no feedback exists! The catch to it is that it only hides the feedback field if there is no feedback messages or boundaries set for any of the quizzes. Thus feedback WILL be shown if there is a potential feedback even if no one has received it yet. Let me know what you think Cheers Sam
          Hide
          Tim Hunt added a comment -

          quiz_has_feedback has a built in cache, so you are not introducing a performance problem.

          It is good that the feedback column is shown if it will one-day contain something - it lets the student know that something will appear there.

          if ($showclosingheader) $data[] = ''; breaks the coding guidelines. Do it on 3 lines with - or better, do it by turning the else into an esle if

          I think if you do those changes, you can commit it.

          Show
          Tim Hunt added a comment - quiz_has_feedback has a built in cache, so you are not introducing a performance problem. It is good that the feedback column is shown if it will one-day contain something - it lets the student know that something will appear there. if ($showclosingheader) $data[] = ''; breaks the coding guidelines. Do it on 3 lines with - or better, do it by turning the else into an esle if I think if you do those changes, you can commit it.
          Hide
          Sam Hemelryk added a comment -

          Completed, the closing date and feedback columns are now hidden if they are not used by any of the quizzes being shown.
          Note: The feedback column is still shown if there is possible feedback, even if no one has received it yet

          Show
          Sam Hemelryk added a comment - Completed, the closing date and feedback columns are now hidden if they are not used by any of the quizzes being shown. Note: The feedback column is still shown if there is possible feedback, even if no one has received it yet
          Hide
          Andrew Davis added a comment -

          I've attached a really small patch (index.patch.txt) to just make it a little more efficient. The patch is for 1.9 but the same logic applies to 2.

          It just makes it break out of the loop if both flags are set. There's no point continuing to loop over the quizzes once both flags are true. I'll commit this tomorrow (its testing day today).

          Show
          Andrew Davis added a comment - I've attached a really small patch (index.patch.txt) to just make it a little more efficient. The patch is for 1.9 but the same logic applies to 2. It just makes it break out of the loop if both flags are set. There's no point continuing to loop over the quizzes once both flags are true. I'll commit this tomorrow (its testing day today).
          Hide
          Andrew Davis added a comment -

          I'll commit my little performance improvement and close this tomorrow (16 dec 09)

          Show
          Andrew Davis added a comment - I'll commit my little performance improvement and close this tomorrow (16 dec 09)
          Hide
          Andrew Davis added a comment -

          Committed small efficiency improvement. Closing.

          Show
          Andrew Davis added a comment - Committed small efficiency improvement. Closing.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: