Project

General

Profile

Bug #5332

Homeworks panel error in counts in pagination.

Added by Alberto Torreblanca about 7 years ago. Updated almost 7 years ago.

Status:
Bug resolved
Priority:
Low
Category:
-
Target version:
Start date:
20/08/2012
Due date:
% Done:

60%

Estimated time:
Spent time:
Complexity:
Easy
SCRUM pts - complexity:
?

Description

The counter in the pagination table counts are wrong, disply the double count of actual items.


Files

Selección_378.png (81.5 KB) Selección_378.png Alberto Torreblanca, 20/08/2012 22:00
work.lib.php (84.7 KB) work.lib.php Yoselyn Castillo, 16/10/2012 15:05
assignments.gif (25.6 KB) assignments.gif Yoselyn Castillo, 17/10/2012 16:32

Associated revisions

Revision 8bc67702 (diff)
Added by Yoselyn Castillo almost 7 years ago

Fixing query in works see #5332

History

#2

Updated by Alberto Torreblanca about 7 years ago

  • File deleted (Selección_378.png)
#3

Updated by Yoselyn Castillo about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Yoselyn Castillo
#4

Updated by Yoselyn Castillo about 7 years ago

  • Assignee deleted (Yoselyn Castillo)

I can't reproduce that bug. Where is that pagination? IN ASSIGMENT TOOL?

#5

Updated by Yannick Warnier about 7 years ago

  • Target version set to 1.9.4
#6

Updated by Julio Montoya about 7 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

#7

Updated by Yoselyn Castillo about 7 years ago

yes i{ve got the bug testing in my local pc. thanks. I am fixing it...

#8

Updated by Yoselyn Castillo about 7 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.

#9

Updated by Julio Montoya almost 7 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 ";

#10

Updated by Yoselyn Castillo almost 7 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.

#11

Updated by Julio Montoya almost 7 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

#12

Updated by Yoselyn Castillo almost 7 years ago

Ok, So i need to add some change to that query

#13

Updated by Yoselyn Castillo almost 7 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?

#14

Updated by Julio Montoya almost 7 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

yeah is much better :)

#15

Updated by Yoselyn Castillo almost 7 years ago

  • File deleted (work.lib.php)
#16

Updated by Yoselyn Castillo almost 7 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.

#17

Updated by Julio Montoya almost 7 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?

#18

Updated by Yoselyn Castillo almost 7 years ago

It works fine now. See the number in pagination in the attachment

#19

Updated by Yannick Warnier almost 7 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.

Also available in: Atom PDF