Skip to content

Add Studio support for cohorted courseware - #6227

Merged
dan-f merged 2 commits into
cohorted-coursewarefrom
andya/studio-cohorted-courseware
Dec 25, 2014
Merged

Add Studio support for cohorted courseware#6227
dan-f merged 2 commits into
cohorted-coursewarefrom
andya/studio-cohorted-courseware

Conversation

@andy-armstrong

Copy link
Copy Markdown
Contributor

TNL-652

@andy-armstrong

Copy link
Copy Markdown
Contributor Author

@explorerleslie @catong @talbs @cahrens @dan-f - I've completed a read-only version of the Studio component visibility modal. You can check it out on my sandbox with this project:

http://studio.andy-armstrong.m.sandbox.edx.org/container/i4x://AndyA/AA101/vertical/db3106691153424ba4551410f0db42d6

It correctly handles all the different cases (no cohort groups, staff only inheritance, missing/deleted groups etc). Next I'm going to work on implementing save which will be based upon the work we did in the hackathon.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder not to miss this NOTE :)

@explorerleslie

Copy link
Copy Markdown

@andy-armstrong @talbs great work! Couple of comments:

  • Right now the eyeball is always black, but @talbs's intention was to have it grey unless the component was only shown to specific groups.
  • It should be "Save/Cancel" buttons, not an "Ok" button, but I'm not sure if that's because it's not wired up.
  • I trust your word for all the different cases, but I can't see them until the backend is hooked up, so I'll comment on them in the future.

@catong

catong commented Dec 12, 2014

Copy link
Copy Markdown
Contributor

@andy-armstrong @talbs @explorerleslie I'm wondering about the wording of "Set visibility to". Sorry I didn't think about this in the previous pass.
Could we make the label more clear about what the user is setting?
How about: "Make this component visible to:"?

@catong

catong commented Dec 12, 2014

Copy link
Copy Markdown
Contributor

In this sandbox, should I be seeing some of the changes I think that @talbs made to the wording of the note: "The Unit this component is contained in is hidden from students..."?

@andy-armstrong

Copy link
Copy Markdown
Contributor Author

Thanks @explorerleslie.

  1. @cahrens is working on the changes to the container page so that will come shortly.
  2. Yes, this won't show the correct buttons until I implement save.
  3. Agreed! I had to fake the code on my local machine to test it. Once we have save we can try it.

@andy-armstrong
andy-armstrong force-pushed the andya/studio-cohorted-courseware branch from 0649573 to 68fc2b1 Compare December 13, 2014 05:49
@dan-f

dan-f commented Dec 13, 2014

Copy link
Copy Markdown
Contributor

I ran into an issue when writing my python unit tests - depending how I instantiated UserPartition I would get an error when calling store.update_item() on the course. When I pass scheme=CohortPartitionScheme I got the error, but when I pass scheme_id = 'cohort', things worked. This is the error:

AttributeError: type object 'CohortPartitionScheme' has no attribute 'name'

Looks like UserPartition.to_json() assumes the scheme has a name field, but that field is only being set in certain circumstances. It looks like setup.py defines some type of mapping to make the latter use case work. Is this a concern?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was another strange thing I ran into when writing these tests. This was coming from deep in the modulestore. Perhaps @dmitchell could kindly shed some light on this? The exception had a message about mongo not wanting to accept a non-string key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reproduce this w/ me looking over your shoulder and we'll debug it together?

@cahrens

cahrens commented Dec 14, 2014

Copy link
Copy Markdown

I'm seeing a strange empty-scrollbar area next to the name of the groups.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not using relative_url, instead hard-coding /js/xblock/authoring.js.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andy-armstrong what is the purpose of relative_url?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the TODO below, I have the feeling this code was not done.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention was to use relative_url instead of the constant string as @cahrens pointed out. The idea was to isolate the STATIC_URL hack into one place as we start to add other dependencies.

@cahrens
cahrens force-pushed the andya/studio-cohorted-courseware branch from 9f1bfea to fa62d45 Compare December 16, 2014 02:08
@cahrens

cahrens commented Dec 16, 2014

Copy link
Copy Markdown

@andy-armstrong and @dan-f I think I'm done with the visibility state updates (text in publishing sidebar, "eyeliner" when appropriate). Bok choy tests still need to be written, but they should be trivial once the rest of the bok choy test setup is done.

I squashed my work into a single commit and force pushed.

@andy-armstrong

Copy link
Copy Markdown
Contributor Author

@explorerleslie @catong @talbs @cahrens @dan-f @jimabramson - I've implemented saving of the visibility state and I've updated my sandbox:

http://studio.andy-armstrong.m.sandbox.edx.org/container/i4x://AndyA/AA101/vertical/db3106691153424ba4551410f0db42d6

My test course now demonstrates the various combinations of error states:

  • a single deleted group
  • a mix of deleted and regular groups
  • two deleted groups (@talbs @explorerleslie - this one has some UX challenges)

I'm going to kick off an update to pick up @cahrens's changes too.

@andy-armstrong
andy-armstrong force-pushed the andya/studio-cohorted-courseware branch from 07935de to cc53782 Compare December 17, 2014 19:08
@explorerleslie

Copy link
Copy Markdown

looking good to me. Is this final changes at this point? If so, 👍 . If not, ping me again before merge.

Comment thread lms/lib/xblock/mixin.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not crazy about mentioning "xblocks" to users, but not sure what generic term can replace it. Perhaps reword to skirt the issue: "The referenced content group configuration is invalid or has been deleted."?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@catong This is a good catch, thanks. I was thinking about plugging in the xblock type, so it would read as:

This unit refers to...

or

This problem refers to...

Does that work? Note that I tweaked the wording so that it works for both one invalid reference as well as for two or more. So your suggested rewording would need both singular and plural forms.

A problem with my suggestion is that I don't know if we have localized xblock type names, so we might need to use quote the name.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just "this component"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@explorerleslie I'm thinking about the case when we support visibility controls on things other than just components. This code will work just as well for sections, subsections and units, so I don't want to call them components.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dan-f Let's work out a plan for this...

@jimabramson
jimabramson force-pushed the cohorted-courseware branch 2 times, most recently from 23ab6ed to b4ba648 Compare December 18, 2014 19:06
@dan-f
dan-f force-pushed the andya/studio-cohorted-courseware branch from 0d560e2 to 893894b Compare December 19, 2014 14:50
Comment thread cms/templates/visibility_editor.html Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i18n throughout this file.

@cahrens

cahrens commented Dec 23, 2014

Copy link
Copy Markdown

👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd make this an inner function, as it is only used in test_no_visibility_set.

@dan-f
dan-f force-pushed the andya/studio-cohorted-courseware branch from 15afacc to f8f7adc Compare December 23, 2014 19:22

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the abbreviation?

@andy-armstrong

Copy link
Copy Markdown
Contributor Author

I'm finished with my review. Nice work everyone! There are just a few minor issues to iron out.

@andy-armstrong

Copy link
Copy Markdown
Contributor Author

👍 once the 'xblock' is removed from the two messages (however you choose to do it).

@dan-f
dan-f force-pushed the andya/studio-cohorted-courseware branch from f8f7adc to 6dd561f Compare December 24, 2014 15:27
@andy-armstrong
andy-armstrong force-pushed the andya/studio-cohorted-courseware branch from 6dd561f to 5695dda Compare December 24, 2014 19:00
@dan-f
dan-f force-pushed the andya/studio-cohorted-courseware branch from 5695dda to 33aef62 Compare December 24, 2014 19:57
@dan-f
dan-f force-pushed the andya/studio-cohorted-courseware branch 3 times, most recently from ef1f765 to 942e31b Compare December 24, 2014 22:42
@dan-f
dan-f force-pushed the andya/studio-cohorted-courseware branch from 942e31b to cb2cb9e Compare December 25, 2014 17:10
dan-f added a commit that referenced this pull request Dec 25, 2014
Add Studio support for cohorted courseware
@dan-f
dan-f merged commit 5c8dd9e into cohorted-courseware Dec 25, 2014
@dan-f
dan-f deleted the andya/studio-cohorted-courseware branch December 25, 2014 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants