Skip to content

Commit

Permalink
$factor Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drachels committed Oct 31, 2023
1 parent 4f79791 commit e443ef9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ function hotquestion_get_user_grades(stdclass $hotquestion, int $userid = 0) {
$grade->rawgrade = null;
foreach ($users as $userid => $rating) {
if (isset($rating->rawrating)) {
$factor = $rating->rawrating / $hotquestion->postmaxgrade;
$factor = $rating->rawrating / max($hotquestion->postmaxgrade, 1);
if ($factor > 1.0) {
$factor = 1.0;
}
Expand Down
33 changes: 18 additions & 15 deletions upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,54 @@ This files describes changes in the Hot Question code.
20230120 HotQuestion_995 - The grade table needs more info included in the download.
Some items (3) have been done. Still have others (3) to do.

=== 4.1.8.03+ === pending
20231027 HotQuestion_1105 - When, Questions for max grading, is not one or more,
you get a non-fatal divide by zero error. Changed code in line 843 of lib.php file
to frevent $factor from being zero.

=== 4.1.8+=== 2023101702 released 20231025
20231025 HotQuestion_1104 - Error when deleting data for user Issue #86 at github.
=== 4.1.8.02+ === 2023101702 released 2023102500
20231025 HotQuestion_1104v - Error when deleting data for user Issue #86 at github.
Changed provider.php lines 366 and 408 to use voter instead of userid. Also to
use id instead of itemid in line 408.


=== 4.1.8+=== 2023101701 released 20231021
20230601 HotQuestion_1051 - $hotquestion->viewaftertimeclose in view.php at line 167
=== 4.1.8.01+ === 2023101701 released 2023102100
20230601 HotQuestion_1051v - $hotquestion->viewaftertimeclose in view.php at line 167
does not appear to work correctly. Made code changes to the mod_form.php plus
made some other changes in view.php and renderer.php.

=== 4.1.8 === 2023101700
20230601 HotQuestion_1051 - $hotquestion->viewaftertimeclose in view.php at line 167
20230601 HotQuestion_1051v - $hotquestion->viewaftertimeclose in view.php at line 167
does not appear to work correctly. Made code changes to the mod_form.php plus
made some other changes in view.php and renderer.php.
20230926 HotQuestion_1076 - Need to implement suffix on mod_for.php for Moodle 4.3.
20230926 HotQuestion_1076v - Need to implement suffix on mod_for.php for Moodle 4.3.
Added needed code to the mod_form.php file for both add_completion_rules and for
completion_rule_enabled. Made code changes as needed. See ticket for details.
20231008 HotQuestion_1091 - Latest codechecker says "Import statements must not begin
20231008 HotQuestion_1091v - Latest codechecker says "Import statements must not begin
with a leading backslash". Made code changes as needed. See ticket for details.
20231008 HotQuestion_1092 - Latest codechecker requires convert from long array(),
20231008 HotQuestion_1092v - Latest codechecker requires convert from long array(),
to short array []. Made code changes as needed. See ticket for details.
20231010 HotQuestion_1094 - Using v4.1.8 on IONOS moodle311 test site students cannot
20231010 HotQuestion_1094v - Using v4.1.8 on IONOS moodle311 test site students cannot
vote/unvote. Did find in grades.php line 42 the closing bracket was missing.
Wound up replaceing the two HQ activities and HQ works as expected. Was due
to a mismatch between timeclose and viewaftertimeclose.
20231011 HotQuestion_1095 - Need to add a viewaftertimeclose setting definition to
20231011 HotQuestion_1095v - Need to add a viewaftertimeclose setting definition to
settings.php. Added at about line 132 of settings.php file.
20231011 HotQuestion_1096 - Non-ed teacher cannot see questions if activity is closed.
20231011 HotQuestion_1096v - Non-ed teacher cannot see questions if activity is closed.
Modified capability checks in two places in the view.php file. Down around line
343 and line 244.
20231011 HotQuestion_1097 - Non-editing teacher cannot remove questions or change the
20231011 HotQuestion_1097v - Non-editing teacher cannot remove questions or change the
approval status of a question. See the ticket for further details where I have
changed capability checks from manageentries, to rate so the non-editing teacher
has capabilities similar to other plugins.
20231013 HotQuestion_1099 - Have a pull request to fix an SQL error in provider.php
20231013 HotQuestion_1099v - Have a pull request to fix an SQL error in provider.php
at line 171. Did the merge and checked that it fixed the code. Hmm, Allie Katt's
reuest to export all data expired without delivery of anything, and nothing logged.



=== 4.1.7 === 2023052500 Only for M3.11 and above.
=== 4.1.7+ ===
20230519 HotQuestion_1045 - Issue #81, Unapproved items are not displayed reliably
20230519 HotQuestion_1045v - Issue #81, Unapproved items are not displayed reliably
when using PostgreSQL. The issue affects MariaDB and MySQL databases too. I have
added code to both view.php and renderer.php that give a selector to show/hide
unapproved questions and also change the index.php call to a class="btn btn-link"
Expand Down

0 comments on commit e443ef9

Please sign in to comment.