Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-42790

Essays with Plain text input append file hash to response when each attempt builds last

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.5.4
    • 2.5.2, 2.6
    • Questions
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_25_STABLE
    • Hide

      These are based on the testing instructions from MDL-39980, but expanded to cover all cases.

      1. Create a quiz with the Each attempt built on last option turned on.
      2. Add essay questions with all 8 possible combinations of Responses format, and Attachements allowed or not.
      3. Attempt the quiz as a student, answering all questions, but without attaching any files anywhere.
      4. Submit and finish, and start a second attempt as the same sutdent. Verify that all you responses from the first attempt are present, and have not been messed up.
      5. As a different student, Attempt the quiz. Answer all the questions embedding images and attaching files everywhere possible.
      6. Submit and finish, and start a second attempt as the same sutdent. Verify that all you responses from the first attempt are present, including all the files, and have not been messed up.
      Show
      These are based on the testing instructions from MDL-39980 , but expanded to cover all cases. Create a quiz with the Each attempt built on last option turned on. Add essay questions with all 8 possible combinations of Responses format, and Attachements allowed or not. Attempt the quiz as a student, answering all questions, but without attaching any files anywhere. Submit and finish, and start a second attempt as the same sutdent. Verify that all you responses from the first attempt are present, and have not been messed up. As a different student, Attempt the quiz. Answer all the questions embedding images and attaching files everywhere possible. Submit and finish, and start a second attempt as the same sutdent. Verify that all you responses from the first attempt are present, including all the files, and have not been messed up.

      Hi There Moodle Community,
      greetings from Poland,
      This is my first bug report and first words ever, so on start I want to say that I appreciate great work on each moodle version, thanks.

      Essays works good before migration from 2.1 to 2.2 to 2.5.2, here's a really obscure bug I've tried to debug in the code, but for me it's unreasonable how in the student answer form can come md5(empty_string) each time student not finishing, did anyone report this bug before me, i can not identify to other essays bugs i'm searching 2 days?

      This is $qubaold chunk of dump from startattempt.php with 1 saved attempt, each next attempt not finished was affected:

      [2]=>
      object(question_attempt)#875 (16) {
      ["id":protected]=>
      string(6) "189680"
      ["usageid":protected]=>
      string(5) "29970"
      ["slot":protected]=>
      string(1) "2"
      ["behaviour":protected]=>
      object(qbehaviour_manualgraded)#873 (2) {
      ["qa":protected]=>
      RECURSION
      ["question":protected]=>
      object(qtype_essay_question)#877 (28) {
      ["responseformat"]=>
      string(5) "plain"
      ["responsefieldlines"]=>
      string(1) "5"
      ["attachments"]=>
      string(1) "0"
      ["graderinfo"]=>
      string(0) ""
      ["graderinfoformat"]=>
      string(1) "1"
      ["responsetemplate"]=>
      string(0) ""
      ["responsetemplateformat"]=>
      string(1) "1"
      ["id"]=>
      string(6) "678863"
      ["category"]=>
      string(5) "36011"
      ["contextid"]=>
      string(5) "70840"
      ["parent"]=>
      string(1) "0"
      ["qtype"]=>
      object(qtype_essay)#879 (1) {
      ["fileoptions":protected]=>
      array(3)

      { ["subdirs"]=> bool(true) ["maxfiles"]=> int(-1) ["maxbytes"]=> int(0) }
      }
      ["name"]=>
      string(4) "Qu 2"
      ["questiontext"]=>
      string(222) "
      Write about a decision you have made using the impulsive decision making style.

      "
      ["questiontextformat"]=>
      string(1) "1"
      ["generalfeedback"]=>
      string(0) ""
      ["generalfeedbackformat"]=>
      string(1) "1"
      ["defaultmark"]=>
      float(1)
      ["length"]=>
      string(1) "1"
      ["penalty"]=>
      float(0)
      ["stamp"]=>
      string(29) "10.0.0.75+120809082933+Vt1VhU"
      ["version"]=>
      string(29) "localhost+131107152846+1egS9P"
      ["hidden"]=>
      string(1) "0"
      ["timecreated"]=>
      string(10) "1344500973"
      ["timemodified"]=>
      string(10) "1383838126"
      ["createdby"]=>
      string(1) "4"
      ["modifiedby"]=>
      string(3) "178"
      ["hints"]=>
      array(0) {
      }
      }
      }
      ["question":protected]=>
      object(qtype_essay_question)#877 (28) {
      ["responseformat"]=>
      string(5) "plain"
      ["responsefieldlines"]=>
      string(1) "5"
      ["attachments"]=>
      string(1) "0"
      ["graderinfo"]=>
      string(0) ""
      ["graderinfoformat"]=>
      string(1) "1"
      ["responsetemplate"]=>
      string(0) ""
      ["responsetemplateformat"]=>
      string(1) "1"
      ["id"]=>
      string(6) "678863"
      ["category"]=>
      string(5) "36011"
      ["contextid"]=>
      string(5) "70840"
      ["parent"]=>
      string(1) "0"
      ["qtype"]=>
      object(qtype_essay)#879 (1) {
      ["fileoptions":protected]=>
      array(3) { ["subdirs"]=> bool(true) ["maxfiles"]=> int(-1) ["maxbytes"]=> int(0) }
      }
      ["name"]=>
      string(4) "Qu 2"
      ["questiontext"]=>
      string(222) "
      Write about a decision you have made using the impulsive decision making style.

      "
      ["questiontextformat"]=>
      string(1) "1"
      ["generalfeedback"]=>
      string(0) ""
      ["generalfeedbackformat"]=>
      string(1) "1"
      ["defaultmark"]=>
      float(1)
      ["length"]=>
      string(1) "1"
      ["penalty"]=>
      float(0)
      ["stamp"]=>
      string(29) "10.0.0.75+120809082933+Vt1VhU"
      ["version"]=>
      string(29) "localhost+131107152846+1egS9P"
      ["hidden"]=>
      string(1) "0"
      ["timecreated"]=>
      string(10) "1344500973"
      ["timemodified"]=>
      string(10) "1383838126"
      ["createdby"]=>
      string(1) "4"
      ["modifiedby"]=>
      string(3) "178"
      ["hints"]=>
      array(0) {
      }
      }
      ["variant":protected]=>
      int(1)
      ["maxmark":protected]=>
      float(1)
      ["minfraction":protected]=>
      float(0)
      ["questionsummary":protected]=>
      string(79) "WRITE ABOUT A DECISION YOU HAVE MADE USING THE IMPULSIVE DECISION MAKING STYLE."
      ["responsesummary":protected]=>
      string(28) "buying stuff wthout thinking"
      ["rightanswer":protected]=>
      NULL
      ["steps":protected]=>
      array(3) {
      [0]=>
      object(question_attempt_step_read_only)#872 (7) {
      ["id":"question_attempt_step":private]=>
      string(6) "412477"
      ["state":"question_attempt_step":private]=>
      object(question_state_complete)#124 (0) {
      }
      ["fraction":"question_attempt_step":private]=>
      NULL
      ["timecreated":"question_attempt_step":private]=>
      string(10) "1383824346"
      ["userid":"question_attempt_step":private]=>
      string(3) "178"
      ["data":"question_attempt_step":private]=>
      array(2) {
      ["answer"]=>
      object(question_file_loader)#867 (4) { ["step":protected]=> *RECURSION* ["name":protected]=> string(6) "answer" ["value":protected]=> string(80) "buying stuff wthout thinking" ["contextid":protected]=> string(5) "70872" }
      ["answerformat"]=>
      string(1) "2"
      }
      ["files":"question_attempt_step":private]=>
      array(0) {
      }
      }
      [1]=>
      object(question_attempt_step_read_only)#868 (7) {
      ["id":"question_attempt_step":private]=>
      string(6) "412579"
      ["state":"question_attempt_step":private]=>
      object(question_state_complete)#124 (0) {
      }
      ["fraction":"question_attempt_step":private]=>
      NULL
      ["timecreated":"question_attempt_step":private]=>
      string(10) "1383902908"
      ["userid":"question_attempt_step":private]=>
      string(3) "178"
      ["data":"question_attempt_step":private]=>
      array(2) {
      ["answer"]=>
      object(question_file_loader)#865 (4) { ["step":protected]=> *RECURSION* ["name":protected]=> string(6) "answer" ["value":protected]=> string(28) "buying stuff wthout thinking" ["contextid":protected]=> string(5) "70872" }
      ["answerformat"]=>
      string(1) "2"
      }
      ["files":"question_attempt_step":private]=>
      array(0) {
      }
      }
      [2]=>
      object(question_attempt_step_read_only)#864 (7) {
      ["id":"question_attempt_step":private]=>
      string(6) "412583"
      ["state":"question_attempt_step":private]=>
      object(question_state_needsgrading)#125 (0) {
      }
      ["fraction":"question_attempt_step":private]=>
      NULL
      ["timecreated":"question_attempt_step":private]=>
      string(10) "1383902947"
      ["userid":"question_attempt_step":private]=>
      string(3) "178"
      ["data":"question_attempt_step":private]=>
      array(1) { ["-finish"]=> string(1) "1" }
      ["files":"question_attempt_step":private]=>
      array(0) {
      }
      }
      }
      ["autosavedstep":protected]=>
      NULL
      ["flagged":protected]=>
      string(1) "0"
      ["observer":protected]=>
      object(question_engine_unit_of_work)#149 (7) {
      ["quba":protected]=>
      RECURSION
      ["modified":protected]=>
      bool(false)
      ["attemptsmodified":protected]=>
      array(0) {
      }
      ["attemptsadded":protected]=>
      array(0) {
      }
      ["stepsadded":protected]=>
      array(0) {
      }
      ["stepsmodified":protected]=>
      array(0) {
      }
      ["stepsdeleted":protected]=>
      array(0) {
      }
      }
      ["timemodified"]=>
      string(10) "1383902948"
      }


      This is $quba based on $qubaold

      [2]=>
      object(question_attempt)#955 (15) {
      ["id":protected]=>
      NULL
      ["usageid":protected]=>
      string(10) "3tGIJzgU6r"
      ["slot":protected]=>
      int(2)
      ["behaviour":protected]=>
      object(qbehaviour_manualgraded)#984 (2) {
      ["qa":protected]=>
      RECURSION
      ["question":protected]=>
      object(qtype_essay_question)#881 (28) {
      ["responseformat"]=>
      string(5) "plain"
      ["responsefieldlines"]=>
      string(1) "5"
      ["attachments"]=>
      string(1) "0"
      ["graderinfo"]=>
      string(0) ""
      ["graderinfoformat"]=>
      string(1) "1"
      ["responsetemplate"]=>
      string(0) ""
      ["responsetemplateformat"]=>
      string(1) "1"
      ["id"]=>
      string(6) "678863"
      ["category"]=>
      string(5) "36011"
      ["contextid"]=>
      string(5) "70840"
      ["parent"]=>
      string(1) "0"
      ["qtype"]=>
      object(qtype_essay)#883 (1) {
      ["fileoptions":protected]=>
      array(3) { ["subdirs"]=> bool(true) ["maxfiles"]=> int(-1) ["maxbytes"]=> int(0) }

      }
      ["name"]=>
      string(4) "Qu 2"
      ["questiontext"]=>
      string(222) "
      Write about a decision you have made using the impulsive decision making style.

      "
      ["questiontextformat"]=>
      string(1) "1"
      ["generalfeedback"]=>
      string(0) ""
      ["generalfeedbackformat"]=>
      string(1) "1"
      ["defaultmark"]=>
      float(1)
      ["length"]=>
      string(1) "1"
      ["penalty"]=>
      float(0)
      ["stamp"]=>
      string(29) "10.0.0.75+120809082933+Vt1VhU"
      ["version"]=>
      string(29) "localhost+131107152846+1egS9P"
      ["hidden"]=>
      string(1) "0"
      ["timecreated"]=>
      string(10) "1344500973"
      ["timemodified"]=>
      string(10) "1383838126"
      ["createdby"]=>
      string(1) "4"
      ["modifiedby"]=>
      string(3) "178"
      ["hints"]=>
      array(0) {
      }
      }
      }
      ["question":protected]=>
      object(qtype_essay_question)#881 (28) {
      ["responseformat"]=>
      string(5) "plain"
      ["responsefieldlines"]=>
      string(1) "5"
      ["attachments"]=>
      string(1) "0"
      ["graderinfo"]=>
      string(0) ""
      ["graderinfoformat"]=>
      string(1) "1"
      ["responsetemplate"]=>
      string(0) ""
      ["responsetemplateformat"]=>
      string(1) "1"
      ["id"]=>
      string(6) "678863"
      ["category"]=>
      string(5) "36011"
      ["contextid"]=>
      string(5) "70840"
      ["parent"]=>
      string(1) "0"
      ["qtype"]=>
      object(qtype_essay)#883 (1) {
      ["fileoptions":protected]=>
      array(3)

      { ["subdirs"]=> bool(true) ["maxfiles"]=> int(-1) ["maxbytes"]=> int(0) }

      }
      ["name"]=>
      string(4) "Qu 2"
      ["questiontext"]=>
      string(222) "
      Write about a decision you have made using the impulsive decision making style.

      "
      ["questiontextformat"]=>
      string(1) "1"
      ["generalfeedback"]=>
      string(0) ""
      ["generalfeedbackformat"]=>
      string(1) "1"
      ["defaultmark"]=>
      float(1)
      ["length"]=>
      string(1) "1"
      ["penalty"]=>
      float(0)
      ["stamp"]=>
      string(29) "10.0.0.75+120809082933+Vt1VhU"
      ["version"]=>
      string(29) "localhost+131107152846+1egS9P"
      ["hidden"]=>
      string(1) "0"
      ["timecreated"]=>
      string(10) "1344500973"
      ["timemodified"]=>
      string(10) "1383838126"
      ["createdby"]=>
      string(1) "4"
      ["modifiedby"]=>
      string(3) "178"
      ["hints"]=>
      array(0) {
      }
      }
      ["variant":protected]=>
      int(1)
      ["maxmark":protected]=>
      float(1)
      ["minfraction":protected]=>
      int(0)
      ["questionsummary":protected]=>
      string(79) "WRITE ABOUT A DECISION YOU HAVE MADE USING THE IMPULSIVE DECISION MAKING STYLE."
      ["responsesummary":protected]=>
      NULL
      ["rightanswer":protected]=>
      NULL
      ["steps":protected]=>
      array(1) {
      [0]=>
      object(question_attempt_step)#983 (7) {
      ["id":"question_attempt_step":private]=>
      NULL
      ["state":"question_attempt_step":private]=>
      object(question_state_complete)#124 (0) {
      }
      ["fraction":"question_attempt_step":private]=>
      NULL
      ["timecreated":"question_attempt_step":private]=>
      int(1383907590)
      ["userid":"question_attempt_step":private]=>
      string(3) "178"
      ["data":"question_attempt_step":private]=>
      array(2) {
      ["answer"]=>
      object(question_file_saver)#981 (4)

      { ["draftitemid":protected]=> int(949147036) ["component":protected]=> string(8) "question" ["filearea":protected]=> string(15) "response_answer" ["value":protected]=> string(80) "buying stuff wthout thinking" }

      ["answerformat"]=>
      string(1) "2"
      }
      ["files":"question_attempt_step":private]=>
      array(0) {
      }
      }
      }
      ["autosavedstep":protected]=>
      NULL
      ["flagged":protected]=>
      bool(false)
      ["observer":protected]=>
      object(question_usage_null_observer)#865 (0) {
      }
      }

      The response to this question in student saved last response is resulting wrong, fake string:

      buying stuff wthout thinking<!-- File hash: d41d8cd98f00b204e9800998ecf8427e -->

      I'll be here all day today, if someone could help, or even identify this bug related to ones before, please let me know about,

      Best regards
      Michael

            timhunt Tim Hunt
            michael.hieronimczuk Michael Hieronimczuk
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Monllaó David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.