Problem/Motivation

When viewing an activity while taking a course, a user with appropriate permissions (teacher or LMS admin) should be able to easily edit the activity directly. Currently if they want to edit it, they have to leave the course, and separately find the activity via the LMS admin. This is a pain point for course creators.

There is a data integrity issue if the LMS "Use Revisions" setting is disabled; if that setting is off and students have already started the course, reverting revisions should likely be disabled as well.

Proposed resolution

Add local tasks to front-end view of course activities.

CommentFileSizeAuthor
#13 Screenshot.png68.89 KBgraber

Issue fork lms-3588690

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ob3ron created an issue. See original summary.

ob3ron’s picture

Title: UI/UX: Add local tasks (View / Edit / Revisions tabs) on activity pages » UI/UX: Add local tasks (Edit / Delete / Revisions tabs) on activity pages
Status: Active » Needs review

Initial commit for review.

graber’s picture

We should definitely do it together with #3588821: UI/UX: teachers need to see the latest version of a course (or after), treating those 2 separately will not work well.

graber’s picture

Status: Needs review » Needs work

Also left a comment on the MR.

ob3ron’s picture

Status: Needs work » Needs review

Did it the right way.

graber’s picture

Status: Needs review » Needs work

Let's also remove the delete tab, you cannot delete anyway as the activity is used when trying to delete from a course tab. Removing from lesson would be more tricky so let's leave it for a possible follow-up.

Ok to merge once that's done.

ob3ron’s picture

Title: UI/UX: Add local tasks (Edit / Delete / Revisions tabs) on activity pages » UI/UX: Add local tasks (View / Edit / Revisions tabs) on activity pages
Status: Needs work » Needs review

Removed the front-end Delete tab. The back end still has its original Delete tab but that's still useful for activities that are not in any lesson.

graber’s picture

Status: Needs review » Needs work

When editing an activity from course - view tab is not visible so there's no way to go back except pressing the back button. We could also hide the delete tab if a course route is in destination and add a "Cancel" submit button on the edit form?

ob3ron’s picture

Status: Needs work » Needs review

Improved back-end tabs, added Cancel button, hid Delete button when editing an activity from a front-end activity view.

graber’s picture

Status: Needs review » Needs work

Left some comments on the MR

ob3ron’s picture

Status: Needs work » Needs review

Made the requested changes.

graber’s picture

Status: Needs review » Needs work
StatusFileSize
new68.89 KB

Just one more tiny thing: destination gets applied to tab links also on the edit and revisions page. That's ok for all tabs except the "View" tab, where the link should be just the course activity page.
screenshot

Ok to merge once removed.

ob3ron’s picture

Status: Needs work » Needs review

Ah, good catch, fixed.

ob3ron’s picture

Assigned: ob3ron » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.