moodleou / moodle-mod_ouwiki

Alternative wiki module for Moodle 2 (designed for use in teaching and learning)
36 stars 33 forks source link

Participation by user error showing abs(): Argument #1 ($num) must be of type int|float, string given #98

Closed kiratskitizing closed 1 year ago

kiratskitizing commented 1 year ago

This is to report that an error is encountered when viewing Participation by user. Please see below complete steps.

  1. Create a course.
  2. Enrol two students.
  3. Create one group and add the two students as members.
  4. Go back to course contents page.
  5. Turn edit mode on.
  6. Add an OU Wiki activity with the following settings: name: ouwiki sub-wikis: one wiki per group annotation system: yes lock start pages: no show word counts: yes common module settings / group mode: separate groups
  7. Log in as the first student, go to the ou wiki activity and click "Create page" type: This is a complete statemnt.
  8. Log in as the second student, go to the ou wiki activity click the "Edit page" (just under the start page)
  9. change the word statemnt to statement.
  10. The content should read as follows: This is a complete statement.
  11. Log in as admin/teacher, go to the ou wiki activity and click "Participation by user"

RESULT:

Exception - abs(): Argument #1 ($num) must be of type int|float, string given

More information about this error
Debug info:
Error code: generalexceptionmessage
Stack trace:

    line 3290 of /mod/ouwiki/locallib.php: TypeError thrown
    line 3290 of /mod/ouwiki/locallib.php: call to abs()
    line 3230 of /mod/ouwiki/locallib.php: call to ouwiki_sort_participation()
    line 77 of /mod/ouwiki/participation.php: call to ouwiki_get_participation()
jason-platts commented 1 year ago

This issue is already fixed if you use the latest code from this repo:

https://github.com/moodleou/moodle-mod_ouwiki/commit/3e7823e830facb6426fc091c2e59fdb42434565f