Moodle
  1. Moodle
  2. MDL-29464

Total of grades doesn't update when you add a random question from question bank

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.4, 2.1.1, 2.2
    • Fix Version/s: 2.0.5, 2.1.2
    • Component/s: Questions, Quiz
    • Labels:
      None
    • Environment:
      Oracle, Moodle 2.0.3
    • Database:
      Oracle
    • Testing Instructions:
      Hide

      1. Create a quiz.
      2. Go do the edit page.
      3. Click on the Add random question button on Page 1.
      4. Click the Add random question button in the pop-up dialogue. Verify that after this, Total of grades at the top of the page is 1.00
      5. Click on the Add random question button on Page 1 again.
      6. This time click the 'Create category and add random question' having typed in a category name.
      7. Verify the total grade is now 2.00.

      Show
      1. Create a quiz. 2. Go do the edit page. 3. Click on the Add random question button on Page 1. 4. Click the Add random question button in the pop-up dialogue. Verify that after this, Total of grades at the top of the page is 1.00 5. Click on the Add random question button on Page 1 again. 6. This time click the 'Create category and add random question' having typed in a category name. 7. Verify the total grade is now 2.00.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      19384

      Description

      http://moodle.org/mod/forum/discuss.php?d=184405

      Please see the discussion above.

        Activity

        Hide
        Longfei Yu added a comment - - edited

        OK, I guess where to fix. Just add one line on this page: mod/quiz/addrandom.php

        76 quiz_add_random_questions($quiz, $addonpage, $categoryid, 1, $includesubcategories);
        77 //Longfei-OIT, 9/21/2011 Total of grades doesn't update after add random question
        78 quiz_update_sumgrades($quiz);
        79 //--------------------------
        80 redirect($returnurl);

        Then every time after you add a random question, the sumgrade will recalculate and update automatically.

        Show
        Longfei Yu added a comment - - edited OK, I guess where to fix. Just add one line on this page: mod/quiz/addrandom.php 76 quiz_add_random_questions($quiz, $addonpage, $categoryid, 1, $includesubcategories); 77 //Longfei-OIT, 9/21/2011 Total of grades doesn't update after add random question 78 quiz_update_sumgrades($quiz); 79 //-------------------------- 80 redirect($returnurl); Then every time after you add a random question, the sumgrade will recalculate and update automatically.
        Hide
        Tim Hunt added a comment -

        Please don't put junk like the following in the Testing instructions box:

        http://moodle.org/mod/forum/discuss.php?d=184405

        I have an important question, we are running 2.0.3, and will not update to 2.1 until at least next Spring, but teachers want this feature so bad. Would you please let me know where to fix in the source code, so that people can use the question bank without any issue? I think it is only a very small change, only need to update the SUMGRADE field by adding 1 after you add a random question.

        Show
        Tim Hunt added a comment - Please don't put junk like the following in the Testing instructions box: http://moodle.org/mod/forum/discuss.php?d=184405 I have an important question, we are running 2.0.3, and will not update to 2.1 until at least next Spring, but teachers want this feature so bad. Would you please let me know where to fix in the source code, so that people can use the question bank without any issue? I think it is only a very small change, only need to update the SUMGRADE field by adding 1 after you add a random question.
        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
        Aparup Banerjee added a comment -

        this has been integrated and is ready for testing

        Show
        Aparup Banerjee added a comment - this has been integrated and is ready for testing
        Hide
        Sam Hemelryk added a comment -

        Thanks all - passing this now

        Show
        Sam Hemelryk added a comment - Thanks all - passing this now
        Hide
        Aparup Banerjee added a comment -

        fixes have been rolled merrily up the stream! Thanks everybody!

        Show
        Aparup Banerjee added a comment - fixes have been rolled merrily up the stream! Thanks everybody!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: