Moodle
  1. Moodle
  2. MDL-544

Random questions can return duplicates...

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_11_STABLE

      Description

      In a quiz, when a random question is included, the selected question can be a 'manually included' one. Then, in the attempt, the question is showed twice. When the quiz is responded, duplicated questions appear in quiz_responses.

      This is one proble to solve before MDL-543

      It's solution seems to be easy and I think it's intereresting to do it.

      Martin, waiting your answer...

      Ciao.

        Gliffy Diagrams

          Activity

          Hide
          Martin Dougiamas added a comment -

          From Martin Dougiamas (martin at moodle.com) Wednesday, 2 July 2003, 01:30 PM:

          I don't understand what you mean by manually included ..

          From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 2 July 2003, 03:37 PM:

          Sorry

          =====

          If you've a quiz that only contains random questions (qtype=4), there is no problem, the 'quiz_choose_random_questions' function return the necessary different questions.

          But, it the quizz has random questions and another type of questions (this is that I calleed 'manually included'), nothing avoids that the 'quiz_choose_random_questions' returns a existing question, duplicating it in the quiz.

          And this duplication are the cause of duplicate questions in quiz_responses, and this is a problem to show answered quizzes and to restore quizzes.

          I've modified 'mod/lib.php' to avoid this problem and it seems to work fine. I'll commit it to cvs this afternoon.

          From Martin Dougiamas (martin at moodle.com) Wednesday, 2 July 2003, 03:42 PM:

          Ahhhh .... it's just my jet lag ... your descriptions make perfect sense. I actually thought the code avoided this problem but obviously it doesn't. Cheers!

          From Eloy Lafuente (stronk7 at moodle.org) Thursday, 3 July 2003, 01:31 AM:

          Excluded form quiz_choose_random_questions the quiz

          questions to avoid duplicates in quiz. Closed.

          Please verify. It seems to work fine !!

          Show
          Martin Dougiamas added a comment - From Martin Dougiamas (martin at moodle.com) Wednesday, 2 July 2003, 01:30 PM: I don't understand what you mean by manually included .. From Eloy Lafuente (stronk7 at moodle.org) Wednesday, 2 July 2003, 03:37 PM: Sorry ===== If you've a quiz that only contains random questions (qtype=4), there is no problem, the 'quiz_choose_random_questions' function return the necessary different questions. But, it the quizz has random questions and another type of questions (this is that I calleed 'manually included'), nothing avoids that the 'quiz_choose_random_questions' returns a existing question, duplicating it in the quiz. And this duplication are the cause of duplicate questions in quiz_responses, and this is a problem to show answered quizzes and to restore quizzes. I've modified 'mod/lib.php' to avoid this problem and it seems to work fine. I'll commit it to cvs this afternoon. From Martin Dougiamas (martin at moodle.com) Wednesday, 2 July 2003, 03:42 PM: Ahhhh .... it's just my jet lag ... your descriptions make perfect sense. I actually thought the code avoided this problem but obviously it doesn't. Cheers! From Eloy Lafuente (stronk7 at moodle.org) Thursday, 3 July 2003, 01:31 AM: Excluded form quiz_choose_random_questions the quiz questions to avoid duplicates in quiz. Closed. Please verify. It seems to work fine !!
          Hide
          Michael Blake added a comment -

          assign to a valid user

          Show
          Michael Blake added a comment - assign to a valid user

            People

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

              Dates

              • Created:
                Updated:
                Resolved: