Moodle
  1. Moodle
  2. MDL-28653

Add a class indicating the question state to the main question div to give themes more options

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1, 2.2
    • Fix Version/s: 2.1.2
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1. Attempt or review a quiz.
      2. Use firebug to verify that there is now a class like notyetanswered / complete / correct / incorrect / etc on the top level question div. (The one that also has class que.)
      3. As teacher, set a quiz with review option 'Whether correct' turned off. Than, as a student, review the quiz, and make sure the class is complete, and not something that gives away whether you were correct or not.
      4. For as many themes as you can be bothered to check, verify that this new class name does not change the visual appearance.

      Show
      1. Attempt or review a quiz. 2. Use firebug to verify that there is now a class like notyetanswered / complete / correct / incorrect / etc on the top level question div. (The one that also has class que.) 3. As teacher, set a quiz with review option 'Whether correct' turned off. Than, as a student, review the quiz, and make sure the class is complete, and not something that gives away whether you were correct or not. 4. For as many themes as you can be bothered to check, verify that this new class name does not change the visual appearance.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      18432

      Description

      With question behaviour turned to "immediate feedback", it would be very nice if the "correct answer background color" could change depending on the correctness. E.g. if the answer is correct, the background color should be green, if the answer is partially correct it should be yellow and if the answer is incorrect, it should be red. Especially if "multiple choice" questions are used, you can see instantly what your answer was like. Just like in the navigation box on the left side.

        Activity

        Hide
        Tim Hunt added a comment -

        Could you attach a screen-shot? I don't really understand what you mean. Thanks.

        Show
        Tim Hunt added a comment - Could you attach a screen-shot? I don't really understand what you mean. Thanks.
        Hide
        Dominik Jeni added a comment -

        Hi!
        Ok, sorry for the bad description, I will attach a screenshot tomorrow. For now, let me try to describe it once again: With "Immediate Feedback", you are able to show the correct answers directly after pushing the "Check" button. This text, "The correct answer is:", has a background color. At the moment, this color is always the same, whether the answer is correct, incorrect or partially correct. I guess it would be best, if this color would change. E.g. green for correct answers, yellow for partially correct answers and red for incorrect answers.
        I hope it's now better to understand...but I'll attach a screenshot tomorrow, too.

        Show
        Dominik Jeni added a comment - Hi! Ok, sorry for the bad description, I will attach a screenshot tomorrow. For now, let me try to describe it once again: With "Immediate Feedback", you are able to show the correct answers directly after pushing the "Check" button. This text, "The correct answer is:", has a background color. At the moment, this color is always the same, whether the answer is correct, incorrect or partially correct. I guess it would be best, if this color would change. E.g. green for correct answers, yellow for partially correct answers and red for incorrect answers. I hope it's now better to understand...but I'll attach a screenshot tomorrow, too.
        Hide
        Tim Hunt added a comment -

        Ah, now I understand.

        The intended meaning of the background colours there is:

        • blue - where the question is asked, and the response entered.
        • yellow - the automatically computed evaluation of your response.
        • green - any manually grading/comment.
        • grey - meta-data about this attempt at the question.

        I think that changing the background based on question result is more confusing than it is helpful. However, it should not be up to me. Choice of colours should be (and is) controlled by the theme.

        However, it is not currently possible to change the colours based on question result, because there is not enough classes in the CSS to let you do an appropriate selector..

        Therefore, what I plan to do is add an extra class name to the main question div. Then you will be able to do something like

        .que.correct .specificfeedback

        { background-color: green; }

        in your theme if you want. I do not plan to change any of the standard themes to do this.

        Show
        Tim Hunt added a comment - Ah, now I understand. The intended meaning of the background colours there is: blue - where the question is asked, and the response entered. yellow - the automatically computed evaluation of your response. green - any manually grading/comment. grey - meta-data about this attempt at the question. I think that changing the background based on question result is more confusing than it is helpful. However, it should not be up to me. Choice of colours should be (and is) controlled by the theme. However, it is not currently possible to change the colours based on question result, because there is not enough classes in the CSS to let you do an appropriate selector.. Therefore, what I plan to do is add an extra class name to the main question div. Then you will be able to do something like .que.correct .specificfeedback { background-color: green; } in your theme if you want. I do not plan to change any of the standard themes to do this.
        Hide
        Tim Hunt added a comment -

        I have reviewed all the standard themes in Moodle 2.1, and this extra class name will be break any existing styling.

        Show
        Tim Hunt added a comment - I have reviewed all the standard themes in Moodle 2.1, and this extra class name will be break any existing styling.
        Hide
        Tim Hunt added a comment -

        One could argue about whether a change like this should happen on the stable branch, but I am sure it will not break any of the existing standard themes, so I think we should make this option available sooner rather than later.

        Show
        Tim Hunt added a comment - One could argue about whether a change like this should happen on the stable branch, but I am sure it will not break any of the existing standard themes, so I think we should make this option available sooner rather than later.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Integrated, thanks!

        (wow, became crazy following the whole get_state_class() chain in code, 100%)

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (wow, became crazy following the whole get_state_class() chain in code, 100%)
        Hide
        Filter Manager added a comment -

        Test result: new backgrounds appeared consistently in all standard themes.

        Show
        Filter Manager added a comment - Test result: new backgrounds appeared consistently in all standard themes.
        Hide
        Michael de Raadt added a comment -

        Sorry, that was me running the test while I was still logged in as Filter manager. (doh)

        Show
        Michael de Raadt added a comment - Sorry, that was me running the test while I was still logged in as Filter manager. (doh)
        Hide
        Eloy Lafuente (stronk7) added a comment -

        This has been sent upstream and is now available in all git & cvs servers. Many thanks for the hard work!

        Show
        Eloy Lafuente (stronk7) added a comment - This has been sent upstream and is now available in all git & cvs servers. Many thanks for the hard work!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: