openedx / modular-learning

3 stars 1 forks source link

[Tagging] Download Course Tag Spreadsheet #172

Closed bradenmacdonald closed 7 months ago

bradenmacdonald commented 8 months ago

"As a power user in Studio, I wish to download a spreadsheet for the whole course, showing all the components in the course and which tags each one has"

Acceptance Criteria

  1. From Studio, any user with permission to edit the course can use the new "Export Tags" menu to download a CSV that contains: a. Every Section/Subsection/Unit/Component of the course as its own row b. Every taxonomy used in the course as a column, with its Export ID as the column header. c. A list of what tags each item has
  2. The CSV should use indentation to reflect the course outline structure (see screenshot below)

CSV Format

Name Type ID Taxonomy1 Taxonomy2
Section 0: Course Introduction Section block-v1:... tag1  
    Section 0: Course Introduction Subsection block-v1:...  tag3  
        Lesson 0.1: Course Organization Unit block-v1:Axim+WGU_Sample1+Test_1+type@vertical+block@51f3... tag4,tag5,tag6
            Course Introduction Video block-v1:Axim+WGU_Sample1+Test_1+type@wgu_image_dams+block@55c1... tag5,tag6  
            Course Organization Text block-v1:Axim+WGU_Sample1+Test_1+type@html+block@6bad... tag5 easy

How the above .csv would look in Excel (note the indentation):

Screenshot 2024-01-12 at 2 21 39 PM

Notes

jmakowski1123 commented 8 months ago

This looks like it's on the right track to me!

I see this as a stepping stone to the next epic, which would be a bulk tag import. "As a course author, I want to use this excel sheet to add tags to content and import those tags in bulk via an import workflow." Out of scope for this ticket, but just want to make sure we're aligned on future steps, yes?

bradenmacdonald commented 8 months ago

I see this as a stepping stone to the next epic, which would be a bulk tag import.

@jmakowski1123 Yes, absolutely. I did put a note about that at the end of the description ^

Colin-Fredericks commented 8 months ago

Seeing tabs inside a spreadsheet cell felt weird at first, but I think it's the right way to go, especially since there's no actual bottom level to edX hierarchy. We can't just do it as a set of columns. Good call.

bradenmacdonald commented 8 months ago

@Colin-Fredericks Yeah, that column is not really used for anything other than helping the user understand which content items are which, so I thought we might as well make it "pretty" and "helpful". I tried a format with columns at first, but it didn't really work. And this way the format can be used identically for library exports too, which have no hierarchy.

pomegranited commented 8 months ago

@bradenmacdonald CC @rpenido There's already a "course blocks" API endpoint that returns all the blocks in a course, see lms.djangoapps.course_blocks.api, though note:

  1. It requires a user to be passed in, because of conditional content display rules for user cohorts.
  2. It doesn't sort the blocks according to the course outline, it returns them in a non-deterministic order. When we needed this functionality for Insights, we ended up sorting the blocks in the analytics pipeline, because it was too difficult to put it into the transformer loop used by the API. But that functionality should live in the course blocks API IMHO.
bradenmacdonald commented 8 months ago

@pomegranited For this we really need a Studio course outline API, not an LMS one. I think learning_sequences.api.get_course_outline comes close ("There is no user-specific data or permissions applied in this function.") but it doesn't include units and components. I am not sure what other APIs may be available.

If nothing else, we can always do it asynchronously the "slow" way by recursing the tree.

pomegranited commented 8 months ago

@bradenmacdonald Ahh yes, I'm sorry, I keep forgetting we have to deal with draft content for Tagging. Sorry for the noise!

pomegranited commented 8 months ago

@bradenmacdonald @jmakowski1123 -- @rpenido has a good question about this requirement:

a. Every Section/Subsection/Unit/Component of the course as its own row

Should the actual top-level course block be exported too, so that we can tag courses? It's trivial to add here.

bradenmacdonald commented 8 months ago

@pomegranited That's a good question. I'm not sure if it's important or not. @jmakowski1123 ?

pomegranited commented 8 months ago

@bradenmacdonald @jmakowski1123 FYI though we don't have a UI for editing top-level "course" tags yet, but when automatic tagging is enabled, the "language" tag gets added to new courses on creation (cf https://github.com/openedx/edx-platform/pull/32907).

pomegranited commented 8 months ago

@bradenmacdonald @jmakowski1123 Where should the "Export tags" menu item live in Studio? There's no "course level" menu to add it to at the moment, only a bunch of buttons at the top of the Course Outline, or down the right-hand side:

image

jmakowski1123 commented 8 months ago

I think it makes most sense to make the tag export available next to the course export, in the "Tools" dropdown. This is going to require a bit of UI change/input. Do we simply add another option in that menu, so that it's Tools --> Import, Export Course, Export Tags, Checklist". Or does the "Export" option come with sub-menu for Course/Tags...? cc @ali-hugo

Screen Shot 2024-02-01 at 10 52 45 AM
Colin-Fredericks commented 8 months ago

You could put it as a separate item on the Export page itself - Export Course, Export Tags, Export All.

jmakowski1123 commented 8 months ago

You could put it as a separate item on the Export page itself - Export Course, Export Tags, Export All.

@Colin-Fredericks As a new user of this feature, would it be obvious enough to you to click on "export" in search of tag export, without having an obvious button from the banner?

ali-hugo commented 8 months ago

@pomegranited Do we need to account for importing course tags, or are we only allowing exporting of course tags?


I agree with @jmakowski1123 that the export option should exist within the "tools" menu. I think a sub-menu listing the two export options (i.e. "export course" and "export tags"), would work well (see mocks below).

menu

sub-menu

pomegranited commented 8 months ago

@ali-hugo

Do we need to account for importing course tags, or are we only allowing exporting of course tags?

We need to account for both exporting and importing (importing or "bulk editing of tags" will be part of a separate ticket).

There's also the same for libraries: https://github.com/openedx/modular-learning/issues/173

ali-hugo commented 8 months ago

@pomegranited Great, thanks for confirming.

I've updated the above mocks slightly; I changed "import course" back to just "import" (to allow for a sub-menu like we have on "export").

Unless @jmakowski1123 objects, I think this is probably good to go.

pomegranited commented 8 months ago

@ali-hugo these nested menus are great, but unfortunately Studio doesn't use Paragon, and implementing them acccessibly will be difficult.

@jmakowski1123 @bradenmacdonald is it ok if we add these new links to the Course Authoring MFE StudioHeader instead of legacy Studio?

image

We'll also need to migrate our "tag counts" with links to the "tag drawer" to this new studio course outline page (as part of a future ticket).

CC @rpenido

ali-hugo commented 8 months ago

@ali-hugo these nested menus are great, but unfortunately Studio doesn't use Paragon, and implementing them acccessibly will be difficult.

@pomegranited Ah ok. So does that mean the dropdown would just display a single-level menu containing the following items:?

rpenido commented 8 months ago

Yes @ali-hugo! Showing all the items in a single level is possible.

bradenmacdonald commented 8 months ago

@pomegranited Yes. From now on, we can basically focus on the MFEs only.