Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.7.1
-
Component/s: Assignment
-
Labels:None
-
Environment:Windows 2003, Php 5.12, Sql 2005
-
Database:Microsoft SQL
-
Affected Branches:MOODLE_17_STABLE
-
Fixed Branches:MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
Description
line 1095 in lib.php in assignments is a good example:
$select = 'SELECT u.id, u.id, u.firstname, u.lastname, u.picture, s.id AS submissionid, s.grade, s.submissioncomment, s.timemodified, s.timemarked, ((s.timemarked > 0) AND (s.timemarked >= s.timemodified)) AS status ';
returns no records for sql 2005
if changed to the following it works:
$select = 'SELECT u.id, u.id, u.firstname, u.lastname, u.picture, s.id AS submissionid, s.grade, s.submissioncomment, s.timemodified, s.timemarked, ';
if ($CFG->dbtype == 'mssql' || $CFG->dbtype == 'odbc_mssql' || $CFG->dbtype == 'mssql_n'){
$select .= ' Case When ((s.timemarked > 0) AND (s.timemarked >= s.timemodified)) THEN \'True\' Else \'False\' End AS status ';
} else {
$select .=' ((s.timemarked > 0) AND (s.timemarked >= s.timemodified)) AS status ';
}
Attachments
Issue Links
| This issue will help resolve: | ||||
| MDL-10846 | Sorting submitted assignments by status makes all assignments disappear |
|
|
|
The same problem exists when using Oracle, according to our local Oracle guru. He tells me that you cannot use a boolean expression as a return field.
Saludos. Iñaki.