-
Notifications
You must be signed in to change notification settings - Fork 60
New version of mentoring block that supports explicit steps #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
problem_builder/mentoring.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a block specifically for handling steps, rather than a copy of the all-encompassing mentoring block? Ie maybe StepManager or StepBuilder?
I haven't looked closely, but it seem there is currently a lot of duplicated code with mentoring, currently? Imho we should only duplicate code we expect to be able to remove from Mentoring once we remove the assessments from there, to handle it exclusively with steps in StepBuilder. Can the rest of the duplicated code be removed or factorized? Otherwise maintaining twice the "almost the same code" is not going to be fun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antoviaque Thanks for the feedback! I DRYed out the changeset based on your suggestions (removed most of the duplicate code and factored the remaining code that was shared between the two mentoring blocks out into a shared superclass).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsjeyd Thanks! Definitely better : )
d211797 to
66d9531
Compare
problem_builder/mentoring.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsjeyd please use StudioContainerWithNestedXBlocksMixin - it would look something like that:
context['wrap_children'] = {
'head': u'<div class="mentoring">',
'tail': u'</div>'
}
fragment = super(MentoringWithExplicitStepsBlock, self).author_edit_view(context)
fragment.add_content(loader.render_template('templates/html/mentoring_url_name.html', {
"url_name": self.url_name
}))
# css and js stuff
mentoring_edit.js is mostly not needed, except for ProblemBuilderUtil.transformClarifications(element); Not sure what does it do - @bradenmacdonald - some hint on that? Anyway, if you still need it, it would be better to have a new mentoring_with_steps_edit.js with the following contents:
function MentoringWithStepsEdit(runtime, element) {
ProblemBuilderUtil.transformClarifications(element);
StudioEditableXBlockMixin(runtime, element);
}
UPD: Actually, since MentoringWithSteps is only concerned about steps and steps does transformClarifications it might not be needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transformClarifications is important - it parses the text/html content and injects the HTML needed for #44
|
@itsjeyd There're some glitches of various severity and complexity:
Overall - looks like you've forgot to add mentoring-step and pb-mentoring to last rule in |
|
@e-kolpakov As discussed in the hangout:
|
bb6dc8f to
e8be9bf
Compare
|
@e-kolpakov FYI: I squashed the commits before rebasing but did preserve a copy of them just in case. |
|
@itsjeyd 👍 conditional the build passes. |
New version of mentoring block that supports explicit steps

This PR introduces two new blocks and enables support for viewing and editing them in Studio. One of the blocks is a new version of
MentoringBlockthat supports explicit steps, the other one is a block that represents a step:Acceptance criteria
Studio integration:
Testing
pb-mentoringto advanced modules.