Can't view assignment / quiz submission results

Can't view assignment / quiz submission results

by TJF 008 -
Number of replies: 27

Hi,

When trying to view students' submitted assignments at /mod/assignment/submissions.php?id=***, I get the following error:

----------

Warning: mysqli::query(): (22003/1690): BIGINT UNSIGNED value is out of range in '(`moodle`.`s`.`timemarked` - `moodle`.`s`.`timemodified`)' in C:\inetpub\vhosts\***.com\lib\dml\mysqli_native_moodle_database.php on line 774

Debug info: BIGINT UNSIGNED value is out of range in '(`moodle`.`s`.`timemarked` - `moodle`.`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 = 14 WHERE u.id IN (163,7,2,20,9,10,11,8,123,118) ORDER BY lastname ASC
[array (
)]
Stack trace:
  • line 391 of \lib\dml\moodle_database.php: dml_read_exception thrown
  • line 775 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()

----------

I am however able to download all the assignments as a zip file using the link at the top of the page.

I found the following threads about this error, but neither helped:

http://moodle.org/mod/forum/discuss.php?d=167616&parent=735018
http://moodle.org/mod/forum/discuss.php?d=157563&parent=690244

Setting sql_mode to 'NO_UNSIGNED_SUBTRACTION' does not alleviate the problem.

I am running the latest Moodle 2.0.1+ (Build: 20110125) on PHP 5.2.17, MySQL version 5.5.8 in a Windows 2008 R2 (IIS 7.5) environment.

Any help would be greatly appreciated!

Thank you.

Average of ratings: -
In reply to TJF 008

Re: Can't view assignment / quiz submission results

by Jim Jam -

I also get this message when trying to view a submitted assignment. I'm running the latest moodle (Yesterdays build - version 2.0), PHP 5.3.5 Apache 2.2.17 in windows 2008 env - (Apache). Also any help much appreciated as I've also tried the "No_unsigned...." edit....

Many Thanks

In reply to Jim Jam

Re: Can't view assignment / quiz submission results

by Stuart Cox -

And me...

Added the No_unsigned (is it ' or ", I tried both

Windows XP SP 3

Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o

PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1

MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625

Stuart

In reply to Jim Jam

Re: Can't view assignment / quiz submission results

by Stuart Cox -

OK, try this....

I had a similar problem with 1.9 and MySql and eventually found the solution. Applying this solution to OUR situation also solved the problem.

I do not know how to reference the thread easily but do a search for

COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status ';

in the forums and you should find a discussion by Pino Calambrogio that refers to editing \mod\assignment\lib.php to this...

COALESCE(SIGN(CAST(s.timemarked as SIGNED) + SIGN(CAST(s.timemarked as SIGNED) - CAST(s.timemodified as SIGNED))), 0) AS status ';

I applied the modification in two (2) places in that file and it SEEMS to be OK now. I suspect this is a bug with the version of PHP. Once again I have no idea how to "submit" this bug, but will try.

Hope it helps

Stuart

Average of ratings: Useful (2)
In reply to Stuart Cox

Re: Can't view assignment / quiz submission results

by Jim Jam -

Stuart

 MANY MANY MANY Thanks for this - is now working fine...

Fab

James

Average of ratings: Useful (1)
In reply to Jim Jam

Re: Can't view assignment / quiz submission results

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi All,
I'm not using these functionalities right now but... could you open a bug into the Tracker to record the issue (and eventually any other forum reference) and this possible solution just confirmed to work?

TIA,
Matteo

In reply to Matteo Scaramuccia

Re: Can't view assignment / quiz submission results

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Obviously, before creating a new tracker issues, make sure that no one has reported this already.

(I am pretty sure that a tracker issue was created for this last week, but I can't remember the number.)

In reply to Tim Hunt

Re: Can't view assignment / quiz submission results

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Tim,
obviously wink!

BTW, here it is: MDL-26284, closed since it was filed under the context of MySQL 5.0.7, unsupported.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Can't view assignment / quiz submission results

by Catalin Maican -

I may confirm this little bug/anoyance under windows 2008 + mysql 5.5.8

i have solved it only as follows:

SELECT ... , COALESCE(SIGN(SIGN(s.timemarked) + SIGN(CAST(s.timemarked AS DECIMAL) - CAST(s.timemodified AS DECIMAL))), 0) AS status

Catalin

In reply to Stuart Cox

Re: Can't view assignment / quiz submission results

by Daniel Palacios -

GREAT!! it works... thanks.

PHP 5.3.5
MySql 5.5.8
Moodle 2.0.2

Daniel

In reply to Stuart Cox

Re: Can't view assignment / quiz submission results

by Paul Nijbakker -

Hi,

Pino's solution ONLY repairs the assignment, our quizzes still have problems!

Tim Hunt's solution for the quiz is apparently for Moodle 2 and we use 1.9. Does anyone have another solution?

Rgrds,
Paul.

In reply to Paul Nijbakker

Re: Can't view assignment / quiz submission results

by Paul Nijbakker -

The issue is in the Tracker (MDL-26937)

In reply to Paul Nijbakker

Re: Can't view assignment / quiz submission results

by Thomas Canniot -

Hello,

It's seems I encounter a similar problem in the assignment module. I can't see the assignment results :

BIGINT UNSIGNED value is out of range in '(`moodle19`.`s`.`timemarked` - `moodle19`.`s`.`timemodified`)'

SELECT u.id, u.firstname, u.lastname, u.picture, u.imagealt, 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 u.id IN (3) ORDER BY lastname ASC

  • line 686 of lib/dmllib.php: call to debugging()
  • line 966 of lib/dmllib.php: call to get_recordset_sql()
  • line 1186 of mod/assignment/lib.php: call to get_records_sql()
  • line 524 of mod/assignment/lib.php: call to assignment_base->display_submissions()
  • line 43 of mod/assignment/submissions.php: call to assignment_base->submissions()

I'm running Moodle 1.9.12+ with MySQL 5.5.12, PHP 5.3.6, Apache 2.2.17.

Does it ring a bell to someone ?

Thanks for your help.

In reply to Thomas Canniot

Re: Can't view assignment / quiz submission results

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This was caused by a change of behaviour in MySQL 5.5.8, which caused these two bits of Moodle to stop working. I thought we had changed Moodle so the problem no longer occurs, but you say you are still seeing it with 1.9.12+?

In reply to Tim Hunt

Re: Can't view assignment / quiz submission results

by Thomas Canniot -

Indeed, same behaviour on Windows with EasyPHP (5.3.6) which has MySQL 5.5.10 and Fedora 15 with MySQL 5.5.12.

I try to take some time to test with an older release of MySQL and the latest moodle.

In reply to Thomas Canniot

Re: Can't view assignment / quiz submission results

by Thomas Canniot -

So I just tried with Fedora 13 / Apache 2.2.17 / MySQL 5.1.56 / Moodle 1.9.12+ and encountered no problem.

I think the bug is still present.

In reply to Thomas Canniot

Re: Can't view assignment / quiz submission results

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Same error message when trying to view Assignment results... Viewing Quiz results is OK.

Moodle 1.9.12

windows XP

mysql 5.0.7-dev

PHP Version 5.3.5

Joseph

In reply to Paul Nijbakker

Re: Can't view assignment / quiz submission results

by Michelle Armstrong -

I have recently changed servers and all of a sudden I get an error message when trying to preview the quiz attempts.  I have altered the report.php code as was outlined in tracker 26937 but I just get a different set of errors.  I am running 1.9.6 build 20091021.  I have attached a copy of the messages I am getting.  Any help would be appreciated.

Attachment quiz report error message.jpg
In reply to Michelle Armstrong

Re: Can't view assignment / quiz submission results

by Michelle Armstrong -

Please ignore.  If I had managed to not miss the comma everything would have worked first time smile

In reply to Stuart Cox

Re: Can't view assignment / quiz submission results

by Ben Kim -

 

 

 

 

 

 

I am having the same problem on CentOS, moodle 1.9.12, php 5.3.6 and mysql 5.5.12-log. (x86_64)

 

 

 

 

Should it be

COALESCE(SIGN(CAST(s.timemarked as SIGNED) + SIGN(CAST((s.timemarked - s.timemodified) as SIGNED))), 0) AS status ';

rather than

 

 

 

 

COALESCE(SIGN(CAST(s.timemarked as SIGNED) + SIGN(CAST(s.timemarked as SIGNED) - CAST(s.timemodified as SIGNED))), 0) AS status ';

Both timemarked and timemodified are unsigned. Given the range of signed and unsigned BigInt, it doesn't practically make a difference either way, though.

Also, does someone have a ready answer to what's  the impact of this status value ? (if status is 0)? Thanks.

 

In reply to Stuart Cox

Απάντηση: Re: Can't view assignment / quiz submission results

by Theodoros Samalis -

I did the same but it wont work agaian even though i changed th e two lines in lip.php. Please help me i still cant read the students' assignments

In reply to Stuart Cox

Re: Can't view assignment / quiz submission results

by Victor Castro -

thank you. this worked for me after i had the problem. I moved my moodle site to a new server and the php version changed. in the old server it was 5.2 and in the new one it is 5.3.

This has caused a lot of little bugs that thankfully I have been able to fix thanks to the forums. 

 

Question: is there a suggestion to avoid this problem, should I be looking to upgrade to 2.2 or something like that? I am reluctant to do this right now because my users won't tolerate an interruption in the service at this time.

In reply to Stuart Cox

Re: Can't view assignment / quiz submission results

by Matthew Hanson -

Just wanted to say that this fix works fine for Moodle 1.9.10 modifying mods/assignments/lib.php. 

THANK YOU SO MUCH!!!!!!

In reply to Stuart Cox

回复: Re: Can't view assignment / quiz submission results

by 智敏 陈 -

thank you very much,I will have a try!

In reply to Stuart Cox

Re: Can't view assignment / quiz submission results

by Raydelto Hernandez -

Thanks Stuart Cox


Changing the two  occurences of 

COALESCE(SIGN(SIGN(s.timemarked) + SIGN(s.timemarked - s.timemodified)), 0) AS status ';

for

COALESCE(SIGN(CAST(s.timemarked as SIGNED) + SIGN(CAST(s.timemarked as SIGNED) - CAST(s.timemodified as SIGNED))), 0) AS status ';


on \mod\assignment\lib.php  worked perfectly for me.  Thank you very much.

Average of ratings: Useful (1)