Skip to content

Update/moodle 402 #130

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 39 commits into from
May 22, 2023
Merged

Update/moodle 402 #130

merged 39 commits into from
May 22, 2023

Conversation

TamaroWalter
Copy link
Contributor

No description provided.

@@ -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) {
Copy link
Contributor

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.

  1. Check for post both marked (outsource in function)
  2. 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, ...);
}

// 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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove


// 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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

$result = $this->postsorderequal($sortedposts, $rightorderposts);
$this->assertEquals(1, $result);

// Test without posts that are marked as both helpful and marked.
Copy link
Contributor Author

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;
Copy link
Contributor Author

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

@NinaHerrmann NinaHerrmann merged commit 65eef2b into master May 22, 2023
@TamaroWalter TamaroWalter deleted the update/Moodle_402 branch May 23, 2023 13:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants