Moodle
  1. Moodle
  2. MDL-24106

Database Error when grading Offline Assignments.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Assignment (2.2)
    • Labels:
      None
    • Environment:
      moodle preview 4 build 201000905
      centOS 5.5
      apache 2.2.16
      mysql 5.0.91
      php 5.2.14
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      27258

      Description

      this relates to MDLQA-218. test stage 2 failed. assignment (single file upload) activity added and submitted ok, but fails when logged in teacher clicks the 'View n submitted assignments' link.

      moodle preview 4 build 201000905

      error dialogue reads: error reading from database. developer debugging info as follows:

      Debug info: Unknown column 'Array' in 'where clause'
      SELECT u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email,
      s.id AS submissionid, s.grade, s.submissioncomment,
      s.timemodified, s.timemarked,
      COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status FROM mdl_user u LEFT JOIN mdl_assignment_submissions s ON u.id = s.userid
      AND s.assignment = 1 WHERE Array AND u.id IN (4) ORDER BY lastname ASC
      [array (
      )]
      Stack trace:
      line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 732 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1289 of /mod/assignment/lib.php: call to mysqli_native_moodle_database->get_records_sql()
      line 632 of /mod/assignment/lib.php: call to assignment_base->display_submissions()
      line 56 of /mod/assignment/submissions.php: call to assignment_base->submissions()

        Issue Links

          Activity

          Hide
          Aparup Banerjee added a comment -

          Hi Chad,
          There have been changes to that area of code on the exact date of your build (see MDL-24079), could you try this again with the latest cvs checkout ?
          I suspect it may have been fixed as I can't reproduce this now.

          Show
          Aparup Banerjee added a comment - Hi Chad, There have been changes to that area of code on the exact date of your build (see MDL-24079 ), could you try this again with the latest cvs checkout ? I suspect it may have been fixed as I can't reproduce this now.
          Hide
          Chad Outten added a comment -

          upgraded 2.0 Preview 4+ from (Build: 20100915) to (2010091303). i can no longer replicate error described in earlier build for 3 assignment types: single file upload, advanced and online text. however receive following dialogue when saving grade and feedback for offline activity on http://moodlesite.com/mod/assignment/submissions.php.


          Notice: Undefined property: stdClass::$grade in /home/mylspace/public_html/dev/mod/assignment/type/offline/assignment.class.php on line 69

          Notice: Undefined property: stdClass::$submissioncomment in /home/mylspace/public_html/dev/mod/assignment/type/offline/assignment.class.php on line 70

          Notice: Undefined property: stdClass::$format in /home/mylspace/public_html/dev/mod/assignment/type/offline/assignment.class.php on line 71

          Error writing to database

          More information about this error

          Debug info: Column 'grade' cannot be null
          UPDATE mdl_assignment_submissions SET assignment = ?,userid = ?,timecreated = ?,timemodified = ?,numfiles = ?,grade = ?,submissioncomment = ?,format = ?,teacher = ?,timemarked = ?,mailed = ? WHERE id=?
          [array (
          0 => '4',
          1 => '3',
          2 => '1284540133',
          3 => '1284540133',
          4 => '0',
          5 => NULL,
          6 => NULL,
          7 => NULL,
          8 => '2',
          9 => 1284540133,
          10 => 1,
          11 => '4',
          )]
          Stack trace:
          line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
          line 922 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 954 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
          line 88 of /mod/assignment/type/offline/assignment.class.php: call to mysqli_native_moodle_database->update_record()
          line 616 of /mod/assignment/lib.php: call to assignment_offline->process_feedback()
          line 56 of /mod/assignment/submissions.php: call to assignment_base->submissions()

          Show
          Chad Outten added a comment - upgraded 2.0 Preview 4+ from (Build: 20100915) to (2010091303). i can no longer replicate error described in earlier build for 3 assignment types: single file upload, advanced and online text. however receive following dialogue when saving grade and feedback for offline activity on http://moodlesite.com/mod/assignment/submissions.php . Notice: Undefined property: stdClass::$grade in /home/mylspace/public_html/dev/mod/assignment/type/offline/assignment.class.php on line 69 Notice: Undefined property: stdClass::$submissioncomment in /home/mylspace/public_html/dev/mod/assignment/type/offline/assignment.class.php on line 70 Notice: Undefined property: stdClass::$format in /home/mylspace/public_html/dev/mod/assignment/type/offline/assignment.class.php on line 71 Error writing to database More information about this error Debug info: Column 'grade' cannot be null UPDATE mdl_assignment_submissions SET assignment = ?,userid = ?,timecreated = ?,timemodified = ?,numfiles = ?,grade = ?,submissioncomment = ?,format = ?,teacher = ?,timemarked = ?,mailed = ? WHERE id=? [array ( 0 => '4', 1 => '3', 2 => '1284540133', 3 => '1284540133', 4 => '0', 5 => NULL, 6 => NULL, 7 => NULL, 8 => '2', 9 => 1284540133, 10 => 1, 11 => '4', )] Stack trace: line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown line 922 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 954 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw() line 88 of /mod/assignment/type/offline/assignment.class.php: call to mysqli_native_moodle_database->update_record() line 616 of /mod/assignment/lib.php: call to assignment_offline->process_feedback() line 56 of /mod/assignment/submissions.php: call to assignment_base->submissions()
          Hide
          Chad Outten added a comment -

          i should note - i first upgraded to build 2010091303. second attempt, i dropped database tables and performed clean install of build 2010091303. same error both rcvd via methods when saving grade, feedback for offline activity.

          Show
          Chad Outten added a comment - i should note - i first upgraded to build 2010091303. second attempt, i dropped database tables and performed clean install of build 2010091303. same error both rcvd via methods when saving grade, feedback for offline activity.
          Hide
          Aparup Banerjee added a comment -

          great testing! thanks for that report Chad, thats been fixed in head.

          Show
          Aparup Banerjee added a comment - great testing! thanks for that report Chad, thats been fixed in head.
          Hide
          Chad Outten added a comment -

          Ok, Aparup. Well done.

          Show
          Chad Outten added a comment - Ok, Aparup. Well done.
          Hide
          Mike Müller added a comment -

          Sure that this one is fixed 100% ? i got the same problems like http://moodle.org/mod/forum/discuss.php?d=172777
          2.0.3+ (Build: 20110511), mysql 5.5.8, php 5.3.6:

          Debug info: BIGINT UNSIGNED value is out of range in '(`lms`.`s`.`timemarked` - `lms`.`s`.`timemodified`)'
          SELECT u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email,
          s.id AS submissionid, s.grade, s.submissioncomment,
          s.timemodified, s.timemarked,
          COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status FROM mdl_user u LEFT JOIN mdl_assignment_submissions s ON u.id = s.userid
          AND s.assignment = 4 WHERE u.id IN (3) ORDER BY lastname ASC
          [array (
          )]
          Stack trace:

          line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 794 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 1303 of /mod/assignment/lib.php: call to mysqli_native_moodle_database->get_records_sql()
          line 642 of /mod/assignment/lib.php: call to assignment_base->display_submissions()
          line 57 of /mod/assignment/submissions.php: call to assignment_base->submissions()

          Show
          Mike Müller added a comment - Sure that this one is fixed 100% ? i got the same problems like http://moodle.org/mod/forum/discuss.php?d=172777 2.0.3+ (Build: 20110511), mysql 5.5.8, php 5.3.6: Debug info: BIGINT UNSIGNED value is out of range in '(`lms`.`s`.`timemarked` - `lms`.`s`.`timemodified`)' SELECT u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email, s.id AS submissionid, s.grade, s.submissioncomment, s.timemodified, s.timemarked, COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status FROM mdl_user u LEFT JOIN mdl_assignment_submissions s ON u.id = s.userid AND s.assignment = 4 WHERE u.id IN (3) ORDER BY lastname ASC [array ( )] Stack trace: line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown line 794 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1303 of /mod/assignment/lib.php: call to mysqli_native_moodle_database->get_records_sql() line 642 of /mod/assignment/lib.php: call to assignment_base->display_submissions() line 57 of /mod/assignment/submissions.php: call to assignment_base->submissions()

            People

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

              Dates

              • Created:
                Updated:
                Resolved: