-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update/moodle 402 #130
Update/moodle 402 #130
Conversation
classes/ratings.php
Outdated
@@ -247,56 +262,96 @@ public static function moodleoverflow_sort_answers_by_ratings($posts) { | |||
$statusstarter = self::moodleoverflow_discussion_is_solved($discussionid, false); | |||
$statusteacher = self::moodleoverflow_discussion_is_solved($discussionid, true); | |||
|
|||
// The answer that is marked as correct by both is displayed first. | |||
// The answers that are marked as correct by both are displayed first. | |||
if ($statusteacher && $statusstarter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is not caused by you but the sequence of ordering the posts is really unintuitive- and hardly readable code.
- Check for post both marked (outsource in function)
- Check for preferred order and outsource ordering in separate function like
if ($preferteacher) {
sort_by_teacher(array x, array y, ...);
sort_by_helpful(array x, array y, ...);
} else {
sort_by_helpful(array x, array y, ...);
sort_by_teacher(array x, array y, ...);
}
…odleoverflow into update/Moodle_402
classes/ratings.php
Outdated
// Sort the answer posts by ratings. | ||
// Build groups of different types of answers (Solved and helpful, only solved/helpful, other). | ||
// statusteacher == 1 means the post is marked as solved. | ||
// statusstarter == 1 means the post is marked as helpful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
classes/ratings.php
Outdated
|
||
// Sort the answer posts by ratings. | ||
// Build groups of different types of answers (Solved and helpful, only solved/helpful, other). | ||
// statusteacher == 1 means the post is marked as solved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
tests/ratings_test.php
Outdated
$result = $this->postsorderequal($sortedposts, $rightorderposts); | ||
$this->assertEquals(1, $result); | ||
|
||
// Test without posts that are marked as both helpful and marked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both helpful and solved...
version.php
Outdated
@@ -28,8 +28,8 @@ | |||
defined('MOODLE_INTERNAL') || die(); | |||
|
|||
$plugin->component = 'mod_moodleoverflow'; | |||
$plugin->version = 2023050801; | |||
$plugin->release = 'v4.1-r1'; | |||
$plugin->version = 2023050802; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set to today's date
No description provided.