Skip to content

Commit 5294e80

Browse files
committed
WIP - var_dumps to check missing post in ratings.php sorting
1 parent f278128 commit 5294e80

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

classes/ratings.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ public static function moodleoverflow_sort_answers_by_ratings($posts) {
243243

244244
// Check if solved posts are preferred over helpful posts.
245245
$solutionspreferred = $posts[array_key_first($posts)]->ratingpreference == 1;
246-
246+
var_dump('start');
247+
var_dump($posts);
247248
// Sort the answer posts by ratings.
248249

249250
// Build groups of different types of answers (Solved and helpful, only solved/helpful, other).
@@ -342,10 +343,15 @@ public static function moodleoverflow_sort_answers_by_ratings($posts) {
342343
}
343344

344345
// Rearrange the indices and return the sorted posts.
346+
var_dump('sortedpost');
347+
var_dump($sortedposts);
348+
345349
$neworder = array();
346350
foreach ($sortedposts as $post) {
347351
$neworder[$post->id] = $post;
348352
}
353+
var_dump('neworder');
354+
var_dump($neworder);
349355
// return now the sorted posts.
350356
return $neworder;
351357
}

0 commit comments

Comments
 (0)