← All changes
|
inc/rest-api/v1/frontend/class-lp-rest-users-controller.php
+8
-0
4.4.8
→
4.4.9
View file →
| @@ -359,8 +359,16 @@ | ||
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | $user_quiz->complete(); |
| 362 | 362 | |
| 363 | + /** | |
| 364 | + * Clear cache result quiz | |
| 365 | + * Cache set on @see LP_User_Item_Quiz::get_results, and start_quiz() clears the same | |
| 366 | + * key. Without this the next read still serves the in-progress result and the | |
| 367 | + * submitted answers all come back as skipped. | |
| 368 | + */ | |
| 369 | + $user_quiz->clear_results_cache(); | |
| 370 | + | |
| 363 | 371 | do_action( 'learn-press/user/quiz-finished', $item_id, $course_id, $user_id, $user_quiz ); |
| 364 | 372 | |
| 365 | 373 | $result['status'] = $user_quiz->get_status(); // Must be completed |
| 366 | 374 | $result['attempts'] = $user_quiz->get_attempts(); |