Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-59785

Activity completion not working for Book when Navigationstyle set to TOC only

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.2.5, 3.3.2
    • Component/s: Book
    • Labels:
    • Testing Instructions:
      Hide
      1. Log in as admin.
      2. Go to a course, or create a new one.
      3. Enable course completion.
      4. Enrol a user on that course as student.
      5. Create 3 books, each book using a different Style of navigation (TOC Only, Images, Text) and all books using the same Activity completion settings: Set Completion tracking to Show activity as complete when conditions are met and mark Student must view this activity to complete it on Require view
      6. Create at least 2 chapters on each book.
      7. Save and return to course.
      8. Log in as the student you enrolled.
      9. Go to the first book, visit the first chapter and go back to course page.
      10. The activity should NOT be marked as completed.
      11. Visit the last page of the book and go back to the course page.
      12. The activity should be marked as completed.
      13. Go to other 2 books and repeat these last steps.
      14. All books must mark activity as completed when the user reaches last page.
      Show
      Log in as admin. Go to a course, or create a new one. Enable course completion. Enrol a user on that course as student. Create 3 books, each book using a different Style of navigation (TOC Only, Images, Text) and all books using the same Activity completion settings: Set Completion tracking to Show activity as complete when conditions are met and mark Student must view this activity to complete it on Require view Create at least 2 chapters on each book. Save and return to course. Log in as the student you enrolled. Go to the first book, visit the first chapter and go back to course page. The activity should NOT be marked as completed. Visit the last page of the book and go back to the course page. The activity should be marked as completed. Go to other 2 books and repeat these last steps. All books must mark activity as completed when the user reaches last page.
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59785-master

      Description

      The Activity Completion does not trigger when the book setting Appearance -> Style of Navigation is set to TOC only (Steps to replicate like MDL-45823 + set navstyle).

      This is because it results in a db entry navstyle = 0, so the completion is skipped, where it would normally happen ( "if ($book->navstyle) {..." mod/book/view.php 153 ).

      Suggestion for a fix:
      https://github.com/TobiGa/moodle/blob/book_completion_fix/mod/book/view.php 203-222
      (apply completion logic from book/classes/external.php)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Sep/17