Bug #5332
Homeworks panel error in counts in pagination.
Description
The counter in the pagination table counts are wrong, disply the double count of actual items.
Files
Associated revisions
History
Updated by Yoselyn Castillo over 8 years ago
- Status changed from New to Assigned
- Assignee set to Yoselyn Castillo
Updated by Yoselyn Castillo over 8 years ago
- Assignee deleted (
Yoselyn Castillo)
I can't reproduce that bug. Where is that pagination? IN ASSIGMENT TOOL?
Updated by Julio Montoya over 8 years ago
- Assignee set to Yoselyn Castillo
- % Done changed from 0 to 10
yes in the ASSIGMENT TOOL when you click in a folder, I can't reproduce the error
Updated by Yoselyn Castillo over 8 years ago
yes i{ve got the bug testing in my local pc. thanks. I am fixing it...
Updated by Yoselyn Castillo over 8 years ago
- File work.lib.php added
- Assignee changed from Yoselyn Castillo to Julio Montoya
- % Done changed from 10 to 50
upload this file, it was a bad query to determine count of works.
Updated by Julio Montoya over 8 years ago
- Assignee changed from Julio Montoya to Yoselyn Castillo
I don't agree with that fix, I think the bug is in the visibility field in the item property table something like "AND prop.visibility <> 2". This change need to be tested for students and teachers ...
before your change
$extra_conditions .= " AND parent_id = ".$work_id." "; $sql = "SELECT count(*) as count FROM ".$iprop_table." prop INNER JOIN ".$work_table." work ON (prop.ref=work.id AND prop.c_id = $course_id AND work.c_id = $course_id ) INNER JOIN $user_table u ON (work.user_id = u.user_id) WHERE $extra_conditions $where_condition $condition_session ";
after your change:
$extra_conditions .= " AND c_id = ".$course_id." AND parent_id = ".$work_id." "; $sql = "SELECT count(*) as count FROM ".$work_table." work INNER JOIN $user_table u ON (work.user_id = u.user_id) WHERE $extra_conditions $where_condition $condition_session ";
Updated by Yoselyn Castillo over 8 years ago
- Status changed from Assigned to Needs more info
- Assignee changed from Yoselyn Castillo to Julio Montoya
I have tested The change "AND prop.visibility <> 2" and it doesn't solve the problem.
I think in this query we only need to make a simple count of all works published in TABLE_STUDENT_PUBLICATION from a specific assignment and it was what i did with my change. Did you test it? It works fine for teachers and students.
Updated by Julio Montoya over 8 years ago
- Assignee changed from Julio Montoya to Yoselyn Castillo
you need to check with the item property table otherwise you can show deleted/invisible files
Updated by Yoselyn Castillo over 8 years ago
- Assignee changed from Yoselyn Castillo to Julio Montoya
I think this would be the query finally
$sql = "SELECT count(*) as count
FROM ".$iprop_table." prop INNER JOIN ".$work_table." work ON (prop.ref=work.id AND prop.c_id = $course_id AND prop.tool='work' AND work.active = 1 AND prop.visibility <> 2 AND work.c_id = $course_id )INNER JOIN $user_table u ON work.user_id = u.user_id)
WHERE $extra_conditions $where_condition $condition_session ";
Tested!
What do you think?
Updated by Julio Montoya over 8 years ago
- Assignee changed from Julio Montoya to Yoselyn Castillo
yeah is much better :)
Updated by Yoselyn Castillo over 8 years ago
- File work.lib.php work.lib.php added
- Status changed from Needs more info to Assigned
- Assignee changed from Yoselyn Castillo to Julio Montoya
Well, upload this file.
Updated by Julio Montoya over 8 years ago
- Status changed from Assigned to Needs more info
- Assignee changed from Julio Montoya to Yoselyn Castillo
- % Done changed from 50 to 60
Hello Yoselyn, I just sent the file.
One question: Did you know if you can push commits to github?
Updated by Yoselyn Castillo over 8 years ago
- File assignments.gif assignments.gif added
- Status changed from Needs more info to Bug resolved
It works fine now. See the number in pagination in the attachment
Updated by Yannick Warnier over 8 years ago
Julio A. Montoya wrote:
One question: Did you know if you can push commits to github?
Yoselyn, si pudieras probar crearte una cuenta en github.com y/o en bitbucket.org y ver si puedes enviar commits de prueba ahí, ayudaría, efectivamente, en trabajar más rápido para los commits.
Fixing query in works see #5332