Commit 01e7afca by Braden MacDonald

Prefix all block type names and prepare for eventual rename to "problem builder"

parent 50b3c567
......@@ -395,7 +395,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
raw_score = self.score.raw
self.runtime.publish(self, 'xblock.mentoring.submitted', {
self.runtime.publish(self, 'xblock.problem_builder.submitted', {
'num_attempts': self.num_attempts,
'submitted_answer': submissions,
'grade': raw_score,
......@@ -460,7 +460,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
event_data['num_attempts'] = self.num_attempts
event_data['submitted_answer'] = submissions
self.runtime.publish(self, 'xblock.mentoring.assessment.submitted', event_data)
self.runtime.publish(self, 'xblock.problem_builder.assessment.submitted', event_data)
return {
'completed': completed,
......
......@@ -46,7 +46,7 @@ function MentoringBlock(runtime, element) {
if (!clickedInside(question_feedback_selector, question_feedback_selector)) {
$(question_feedback_selector).not(':hidden').each(function (i, el) {
$(el).hide();
publish_event({event_type: 'xblock.mentoring.feedback.closed', content: $(el).text()});
publish_event({event_type: 'xblock.problem_builder.feedback.closed', content: $(el).text()});
});
}
......@@ -118,5 +118,5 @@ function MentoringBlock(runtime, element) {
MentoringAssessmentView(runtime, element, mentoring);
}
publish_event({event_type:"xblock.mentoring.loaded"});
publish_event({event_type:"xblock.problem_builder.loaded"});
}
......@@ -112,7 +112,7 @@ function MentoringAssessmentView(runtime, element, mentoring) {
$(child.element).show();
$(child.element).find("input, textarea").first().focus();
mentoring.publish_event({
event_type: 'xblock.mentoring.assessment.shown',
event_type: 'xblock.problem_builder.assessment.shown',
exercise_id: child.name
});
......
function MentoringEditComponents(runtime, element) {
"use strict";
// Disable "add" buttons when a message of that type already exists:
var $buttons = $('.add-xblock-component-button[data-category=mentoring-message]', element);
var $buttons = $('.add-xblock-component-button[data-category=pb-message]', element);
var updateButtons = function() {
$buttons.each(function() {
var msg_type = $(this).data('boilerplate');
......
......@@ -4,7 +4,7 @@
<div class="new-component">
<ul class="new-component-type">
<li><a href="#" class="single-template add-xblock-component-button" data-category="html">{% trans "Add HTML" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-answer-recap">{% trans "Add Answer Recap" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-answer-recap">{% trans "Add Answer Recap" %}</a></li>
</ul>
</div>
</div>
......@@ -3,7 +3,7 @@
<div class="add-xblock-component new-component-item adding">
<div class="new-component">
<ul class="new-component-type">
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-column">{% trans "Add Answer Recap Column" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-column">{% trans "Add Answer Recap Column" %}</a></li>
</ul>
</div>
</div>
......@@ -4,16 +4,16 @@
<div class="new-component">
<h5>{% trans "Add New Component" %}</h5>
<ul class="new-component-type">
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-answer" data-boilerplate="studio_default">{% trans "Long Answer" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-mcq">{% trans "Multiple Choice Question" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-rating">{% trans "Rating Question" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-mrq">{% trans "Multiple Response Question" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-answer" data-boilerplate="studio_default">{% trans "Long Answer" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-mcq">{% trans "Multiple Choice Question" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-rating">{% trans "Rating Question" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-mrq">{% trans "Multiple Response Question" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="html">{% trans "HTML" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-answer-recap">{% trans "Long Answer Recap" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-table">{% trans "Answer Recap Table" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-message" data-boilerplate="completed">{% trans "Message (Complete)" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-message" data-boilerplate="incomplete">{% trans "Message (Incomplete)" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-message" data-boilerplate="max_attempts_reached">{% trans "Message (Max # Attempts)" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-answer-recap">{% trans "Long Answer Recap" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-table">{% trans "Answer Recap Table" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="completed">{% trans "Message (Complete)" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="incomplete">{% trans "Message (Incomplete)" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-message" data-boilerplate="max_attempts_reached">{% trans "Message (Max # Attempts)" %}</a></li>
</ul>
</div>
</div>
......@@ -3,8 +3,8 @@
<div class="add-xblock-component new-component-item adding">
<div class="new-component">
<ul class="new-component-type">
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-choice" data-boilerplate="studio_default">{% trans "Add Custom Choice" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="mentoring-tip">{% trans "Add Tip" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-choice" data-boilerplate="studio_default">{% trans "Add Custom Choice" %}</a></li>
<li><a href="#" class="single-template add-xblock-component-button" data-category="pb-tip">{% trans "Add Tip" %}</a></li>
</ul>
</div>
</div>
<mentoring display_name="Mentoring Assessment Example" weight="1" mode="assessment" max_attempts="10">
<problem-builder display_name="Mentoring Assessment Example" weight="1" mode="assessment" max_attempts="10">
<html_demo>
<p>This paragraph is shared between <strong>all</strong> questions.</p>
<p>Please answer the questions below.</p>
</html_demo>
<answer name="goal" question="What is your goal?">
</answer>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<tip values="yes">Great!</tip>
<tip values="maybenot">Ah, damn.</tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip>
</mcq>
<rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How much do you rate this MCQ?" correct_choices="4,5">
<choice value="notwant">I don't want to rate it</choice>
<tip values="4,5">I love good grades.</tip>
<tip values="1,2,3">Will do better next time...</tip>
<tip values="notwant">Your loss!</tip>
</rating>
<mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty">
<choice value="elegance">Its elegance</choice>
<choice value="beauty">Its beauty</choice>
<choice value="gracefulness">Its gracefulness</choice>
<choice value="bugs">Its bugs</choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip>
<tip values="bugs">Nah, there isn't any!</tip>
</mrq>
</mentoring>
<pb-answer name="goal" question="What is your goal?">
</pb-answer>
<pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<pb-tip values="yes">Great!</pb-tip>
<pb-tip values="maybenot">Ah, damn.</pb-tip>
<pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</pb-mcq>
<pb-rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How much do you rate this MCQ?" correct_choices="4,5">
<pb-choice value="notwant">I don't want to rate it</pb-choice>
<pb-tip values="4,5">I love good grades.</pb-tip>
<pb-tip values="1,2,3">Will do better next time...</pb-tip>
<pb-tip values="notwant">Your loss!</pb-tip>
</pb-rating>
<pb-mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty">
<pb-choice value="elegance">Its elegance</pb-choice>
<pb-choice value="beauty">Its beauty</pb-choice>
<pb-choice value="gracefulness">Its gracefulness</pb-choice>
<pb-choice value="bugs">Its bugs</pb-choice>
<pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<pb-tip values="bugs">Nah, there isn't any!</pb-tip>
</pb-mrq>
</problem-builder>
<mentoring display_name="Default Title" weight="1" mode="standard">
<problem-builder display_name="Default Title" weight="1" mode="standard">
<html_demo>
<p>Please answer the questions below.</p>
</html_demo>
<answer name="goal" question="What is your goal?">
</answer>
<pb-answer name="goal" question="What is your goal?">
</pb-answer>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip>
<tip values="maybenot">Ah, damn.</tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip>
</mcq>
<pb-tip values="yes">Great!</pb-tip>
<pb-tip values="maybenot">Ah, damn.</pb-tip>
<pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</pb-mcq>
<rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How much do you rate this MCQ?" correct_choices="4,5">
<choice value="notwant">I don't want to rate it</choice>
<tip values="4,5">I love good grades.</tip>
<tip values="1,2,3">Will do better next time...</tip>
<tip values="notwant">Your loss!</tip>
</rating>
<pb-rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How much do you rate this MCQ?" correct_choices="4,5">
<pb-choice value="notwant">I don't want to rate it</pb-choice>
<pb-tip values="4,5">I love good grades.</pb-tip>
<pb-tip values="1,2,3">Will do better next time...</pb-tip>
<pb-tip values="notwant">Your loss!</pb-tip>
</pb-rating>
<mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty" message="Thank you for answering!">
<choice value="elegance">Its elegance</choice>
<choice value="beauty">Its beauty</choice>
<choice value="gracefulness">Its gracefulness</choice>
<choice value="bugs">Its bugs</choice>
<pb-mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty" message="Thank you for answering!">
<pb-choice value="elegance">Its elegance</pb-choice>
<pb-choice value="beauty">Its beauty</pb-choice>
<pb-choice value="gracefulness">Its gracefulness</pb-choice>
<pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip>
<tip values="bugs">Nah, there aren't any!</tip>
</mrq>
<pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<pb-tip values="bugs">Nah, there aren't any!</pb-tip>
</pb-mrq>
<mentoring-message type="completed">
<pb-message type="completed">
<p>Congratulations!</p>
</mentoring-message>
<mentoring-message type="incomplete">
</pb-message>
<pb-message type="incomplete">
<p>Still some work to do...</p>
</mentoring-message>
</mentoring>
</pb-message>
</problem-builder>
<mentoring display_name="Default Title" weight="1" mode="standard">
<problem-builder display_name="Default Title" weight="1" mode="standard">
<html_demo>
<p>Please answer the questions below.</p>
</html_demo>
<mrq name="mrq_1_1" question="What do you like in this MRQ?" message="Thank you for answering!" required_choices="gracefulness,elegance,beauty">
<choice value="elegance">Its elegance</choice>
<choice value="beauty">Its beauty</choice>
<choice value="gracefulness">Its gracefulness</choice>
<choice value="bugs">Its bugs</choice>
<pb-mrq name="mrq_1_1" question="What do you like in this MRQ?" message="Thank you for answering!" required_choices="gracefulness,elegance,beauty">
<pb-choice value="elegance">Its elegance</pb-choice>
<pb-choice value="beauty">Its beauty</pb-choice>
<pb-choice value="gracefulness">Its gracefulness</pb-choice>
<pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip>
<tip values="bugs">Nah, there aren't any!</tip>
</mrq>
<pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<pb-tip values="bugs">Nah, there aren't any!</pb-tip>
</pb-mrq>
<mentoring-message type="completed">
<pb-message type="completed">
<p>Congratulations!</p>
</mentoring-message>
<mentoring-message type="incomplete">
</pb-message>
<pb-message type="incomplete">
<p>Still some work to do...</p>
</mentoring-message>
</mentoring>
</pb-message>
</problem-builder>
<vertical_demo>
<mentoring url_name="answer_blank_read_only" enforce_dependency="false">
<answer-recap name="answer_blank" />
</mentoring>
<problem-builder url_name="answer_blank_read_only" enforce_dependency="false">
<pb-answer-recap name="answer_blank" />
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="answer_edit_1" enforce_dependency="false">
<problem-builder url_name="answer_edit_1" enforce_dependency="false">
<html_demo>
<p>This should be displayed in the answer_edit scenario</p>
</html_demo>
<answer name="answer_1" />
</mentoring>
<pb-answer name="answer_1" />
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="answer_edit_2" enforce_dependency="false">
<answer-recap name="answer_1" />
<answer name="answer_1" />
</mentoring>
<problem-builder url_name="answer_edit_2" enforce_dependency="false">
<pb-answer-recap name="answer_1" />
<pb-answer name="answer_1" />
</problem-builder>
</vertical_demo>
<mentoring url_name="mentoring-assessment-1" display_name="A Simple Assessment" weight="1" mode="assessment" max_attempts="2">
<problem-builder url_name="mentoring-assessment-1" display_name="A Simple Assessment" weight="1" mode="assessment" max_attempts="2">
<html_demo>
<p>This paragraph is shared between <strong>all</strong> questions.</p>
......@@ -12,34 +12,34 @@
</html_demo>
<acid/>
<answer name="goal" question="What is your goal?" />
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<tip values="yes">Great!</tip>
<tip values="maybenot">Ah, damn.</tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip>
</mcq>
<rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How much do you rate this MCQ?" correct_choices="4,5">
<choice value="notwant">I don't want to rate it</choice>
<tip values="4,5">I love good grades.</tip>
<tip values="1,2,3">Will do better next time...</tip>
<tip values="notwant">Your loss!</tip>
</rating>
<mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty">
<choice value="elegance">Its elegance</choice>
<choice value="beauty">Its beauty</choice>
<choice value="gracefulness">Its gracefulness</choice>
<choice value="bugs">Its bugs</choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip>
<tip values="bugs">Nah, there isn't any!</tip>
</mrq>
</mentoring>
<pb-answer name="goal" question="What is your goal?" />
<pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<pb-tip values="yes">Great!</pb-tip>
<pb-tip values="maybenot">Ah, damn.</pb-tip>
<pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</pb-mcq>
<pb-rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How much do you rate this MCQ?" correct_choices="4,5">
<pb-choice value="notwant">I don't want to rate it</pb-choice>
<pb-tip values="4,5">I love good grades.</pb-tip>
<pb-tip values="1,2,3">Will do better next time...</pb-tip>
<pb-tip values="notwant">Your loss!</pb-tip>
</pb-rating>
<pb-mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty">
<pb-choice value="elegance">Its elegance</pb-choice>
<pb-choice value="beauty">Its beauty</pb-choice>
<pb-choice value="gracefulness">Its gracefulness</pb-choice>
<pb-choice value="bugs">Its bugs</pb-choice>
<pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<pb-tip values="bugs">Nah, there isn't any!</pb-tip>
</pb-mrq>
</problem-builder>
<mentoring url_name="mentoring-assessment-2" display_name="A Simple Assessment" weight="1" mode="assessment" max_attempts="2">
<problem-builder url_name="mentoring-assessment-2" display_name="A Simple Assessment" weight="1" mode="assessment" max_attempts="2">
<html_demo>
<p>This paragraph is shared between <strong>all</strong> questions.</p>
<p>Please answer the questions below.</p>
</html_demo>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip>
<tip values="maybenot">Ah, damn.</tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip>
</mcq>
</mentoring>
<pb-tip values="yes">Great!</pb-tip>
<pb-tip values="maybenot">Ah, damn.</pb-tip>
<pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</pb-mcq>
</problem-builder>
<vertical_demo>
<mentoring url_name="mcq_1" enforce_dependency="false">
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<problem-builder url_name="mcq_1" enforce_dependency="false">
<pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip>
<tip values="maybenot">Ah, damn.</tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip>
</mcq>
<pb-tip values="yes">Great!</pb-tip>
<pb-tip values="maybenot">Ah, damn.</pb-tip>
<pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</pb-mcq>
<rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How do you rate this MCQ?" correct_choices="4,5">
<choice value="notwant">I don't want to rate it</choice>
<pb-rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How do you rate this MCQ?" correct_choices="4,5">
<pb-choice value="notwant">I don't want to rate it</pb-choice>
<tip values="4,5">I love good grades.</tip>
<tip values="1,2,3">Will do better next time...</tip>
<tip values="notwant">Your loss!</tip>
</rating>
<pb-tip values="4,5">I love good grades.</pb-tip>
<pb-tip values="1,2,3">Will do better next time...</pb-tip>
<pb-tip values="notwant">Your loss!</pb-tip>
</pb-rating>
<mentoring-message type="completed">
<pb-message type="completed">
All is good now...
<p>Congratulations!</p>
</mentoring-message>
</mentoring>
</pb-message>
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="mcq_with_comments" display_name="MRQ With Resizable popups" weight="1" enforce_dependency="false">
<mrq name="mrq_1_1_7" question="What do you like in this MRQ?" required_choices="elegance,gracefulness,beauty">
<choice value="elegance">Its elegance</choice>
<choice value="beauty">Its beauty</choice>
<choice value="gracefulness">Its gracefulness</choice>
<choice value="bugs">Its bugs</choice>
<problem-builder url_name="mcq_with_comments" display_name="MRQ With Resizable popups" weight="1" enforce_dependency="false">
<pb-mrq name="mrq_1_1_7" question="What do you like in this MRQ?" required_choices="elegance,gracefulness,beauty">
<pb-choice value="elegance">Its elegance</pb-choice>
<pb-choice value="beauty">Its beauty</pb-choice>
<pb-choice value="gracefulness">Its gracefulness</pb-choice>
<pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness" width ="200" height = "200">This MRQ is indeed very graceful</tip>
<tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MRQ</tip>
<tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</tip>
<tip values="bugs" width = "100" height = "200">Nah, there isn\'t any!</tip>
<pb-tip values="gracefulness" width ="200" height = "200">This MRQ is indeed very graceful</pb-tip>
<pb-tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MRQ</pb-tip>
<pb-tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</pb-tip>
<pb-tip values="bugs" width = "100" height = "200">Nah, there isn\'t any!</pb-tip>
<!--<message type="on-submit">This is deliberately commented out to test parsing of XML comments</message> -->
</mrq>
<!--<pb-message type="on-submit">This is deliberately commented out to test parsing of XML comments</pb-message> -->
</pb-mrq>
<mentoring-message type="completed">
<pb-message type="completed">
<p>Congratulations!</p>
</mentoring-message>
<mentoring-message type="incomplete">
</pb-message>
<pb-message type="incomplete">
<p>Still some work to do...</p>
</mentoring-message>
</mentoring>
</pb-message>
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="mcq_with_comments" display_name="MCQ With Resizable popups" weight="1" enforce_dependency="false">
<mcq name="mrq_1_1_7" question="What do you like in this MCQ?" correct_choices="gracefulness,elegance,beauty">
<choice value="elegance"><strong>Its elegance</strong></choice>
<choice value="beauty"><em>Its beauty</em></choice>
<choice value="gracefulness"><strong>Its gracefulness</strong></choice>
<choice value="bugs"><span style="font-color:red">Its bugs</span></choice>
<problem-builder url_name="mcq_with_comments" display_name="MCQ With Resizable popups" weight="1" enforce_dependency="false">
<pb-mcq name="mrq_1_1_7" question="What do you like in this MCQ?" correct_choices="gracefulness,elegance,beauty">
<pb-choice value="elegance"><strong>Its elegance</strong></pb-choice>
<pb-choice value="beauty"><em>Its beauty</em></pb-choice>
<pb-choice value="gracefulness"><strong>Its gracefulness</strong></pb-choice>
<pb-choice value="bugs"><span style="font-color:red">Its bugs</span></pb-choice>
<tip values="gracefulness" width ="200" height = "200">This MCQ is indeed very graceful</tip>
<tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MCQ</tip>
<tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</tip>
<tip values="bugs" width = "100" height = "200">Nah, there isn\'t any!</tip>
</mcq>
<pb-tip values="gracefulness" width ="200" height = "200">This MCQ is indeed very graceful</pb-tip>
<pb-tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MCQ</pb-tip>
<pb-tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</pb-tip>
<pb-tip values="bugs" width = "100" height = "200">Nah, there isn\'t any!</pb-tip>
</pb-mcq>
<mentoring-message type="completed">
<pb-message type="completed">
<p>Congratulations!</p>
</mentoring-message>
<mentoring-message type="incomplete">
</pb-message>
<pb-message type="incomplete">
<p>Still some work to do...</p>
</mentoring-message>
</mentoring>
</pb-message>
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="mcq_with_comments" display_name="MRQ With Resizable popups" weight="1" enforce_dependency="false">
<mrq name="mrq_1_1_7" question="What do you like in this MRQ?" required_choices="elegance,beauty,gracefulness">
<choice value="elegance"><strong>Its elegance</strong></choice>
<choice value="beauty"><em>Its beauty</em></choice>
<choice value="gracefulness"><strong>Its gracefulness</strong></choice>
<choice value="bugs"><span style="font-color:red">Its bugs</span></choice>
<problem-builder url_name="mcq_with_comments" display_name="MRQ With Resizable popups" weight="1" enforce_dependency="false">
<pb-mrq name="mrq_1_1_7" question="What do you like in this MRQ?" required_choices="elegance,beauty,gracefulness">
<pb-choice value="elegance"><strong>Its elegance</strong></pb-choice>
<pb-choice value="beauty"><em>Its beauty</em></pb-choice>
<pb-choice value="gracefulness"><strong>Its gracefulness</strong></pb-choice>
<pb-choice value="bugs"><span style="font-color:red">Its bugs</span></pb-choice>
<tip values="gracefulness" width ="200" height = "200">This MRQ is indeed very graceful</tip>
<tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MRQ</tip>
<tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</tip>
<tip values="bugs" width = "100" height = "200">Nah, there aren\'t any!</tip>
</mrq>
<pb-tip values="gracefulness" width ="200" height = "200">This MRQ is indeed very graceful</pb-tip>
<pb-tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MRQ</pb-tip>
<pb-tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</pb-tip>
<pb-tip values="bugs" width = "100" height = "200">Nah, there aren\'t any!</pb-tip>
</pb-mrq>
<mentoring-message type="completed">
<pb-message type="completed">
<p>Congratulations!</p>
</mentoring-message>
<mentoring-message type="incomplete">
</pb-message>
<pb-message type="incomplete">
<p>Still some work to do...</p>
</mentoring-message>
</mentoring>
</pb-message>
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="answer_no_display_submit" enforce_dependency="false" display_submit="false">
<answer name="answer_blank"/>
</mentoring>
<problem-builder url_name="answer_no_display_submit" enforce_dependency="false" display_submit="false">
<pb-answer name="answer_blank"/>
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="mentoring_first" followed_by="progression_2" enforce_dependency="true">
<answer name="progression_1_answer" />
</mentoring>
<problem-builder url_name="mentoring_first" followed_by="progression_2" enforce_dependency="true">
<pb-answer name="progression_1_answer" />
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="progression_2" followed_by="progression_3" enforce_dependency="true">
<answer name="progression_2_answer" />
</mentoring>
<problem-builder url_name="progression_2" followed_by="progression_3" enforce_dependency="true">
<pb-answer name="progression_2_answer" />
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring url_name="progression_3" enforce_dependency="true">
<answer name="progression_3_answer" />
</mentoring>
<problem-builder url_name="progression_3" enforce_dependency="true">
<pb-answer name="progression_3_answer" />
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring enforce_dependency="false">
<answer name="table_1_answer_1" />
<answer name="table_1_answer_2" />
</mentoring>
<problem-builder enforce_dependency="false">
<pb-answer name="table_1_answer_1" />
<pb-answer name="table_1_answer_2" />
</problem-builder>
</vertical_demo>
<vertical_demo>
<mentoring display_submit="false" enforce_dependency="false">
<mentoring-table>
<mentoring-column header="Header Test 1">
<answer-recap name="table_1_answer_1"/>
</mentoring-column>
<mentoring-column header="Header Test 2">
<answer-recap name="table_1_answer_2"/>
</mentoring-column>
</mentoring-table>
</mentoring>
<problem-builder display_submit="false" enforce_dependency="false">
<pb-table>
<pb-column header="Header Test 1">
<pb-answer-recap name="table_1_answer_1"/>
</pb-column>
<pb-column header="Header Test 2">
<pb-answer-recap name="table_1_answer_2"/>
</pb-column>
</pb-table>
</problem-builder>
</vertical_demo>
<mentoring url_name="mentoring-assessment-2" display_name="A Simple Assessment" weight="1" mode="assessment" max_attempts="2">
<problem-builder url_name="mentoring-assessment-2" display_name="A Simple Assessment" weight="1" mode="assessment" max_attempts="2">
<html_demo>
<p>This paragraph is shared between <strong>all</strong> questions.</p>
<p>Please answer the questions below.</p>
</html_demo>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip>
<tip values="maybenot">Ah, damn.</tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip>
</mcq>
</mentoring>
<pb-tip values="yes">Great!</pb-tip>
<pb-tip values="maybenot">Ah, damn.</pb-tip>
<pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</pb-mcq>
</problem-builder>
<mentoring url_name="some_url_name" weight="1" mode="standard" display_name="Default Title">
<problem-builder url_name="some_url_name" weight="1" mode="standard" display_name="Default Title">
<html>
<p>This paragraph is shared between <strong>all</strong> questions.</p>
</html>
<html>
<p>Please answer the questions below.</p>
</html>
<answer name="goal" question="What is your goal?"/>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<tip values="yes">Great!</tip>
<tip values="maybenot">Ah, damn.</tip>
<tip values="understand">
<pb-answer name="goal" question="What is your goal?"/>
<pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<pb-tip values="yes">Great!</pb-tip>
<pb-tip values="maybenot">Ah, damn.</pb-tip>
<pb-tip values="understand">
<div id="test-custom-html">Really?</div>
</tip>
</mcq>
<rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How much do you rate this MCQ?" correct_choices="4,5">
<choice value="notwant">I don't want to rate it</choice>
<tip values="4,5">I love good grades.</tip>
<tip values="1,2,3">Will do better next time...</tip>
<tip values="notwant">Your loss!</tip>
</rating>
<mrq name="mrq_1_1" question="What do you like in this MRQ?" message="Thank you for answering!" required_choices="gracefulness,elegance,beauty">
<choice value="elegance">Its elegance</choice>
<choice value="beauty">Its beauty</choice>
<choice value="gracefulness">Its gracefulness</choice>
<choice value="bugs">Its bugs</choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip>
<tip values="bugs">Nah, there isn't any!</tip>
</mrq>
<mentoring-message type="completed">
</pb-tip>
</pb-mcq>
<pb-rating name="mcq_1_2" low="Not good at all" high="Extremely good" question="How much do you rate this MCQ?" correct_choices="4,5">
<pb-choice value="notwant">I don't want to rate it</pb-choice>
<pb-tip values="4,5">I love good grades.</pb-tip>
<pb-tip values="1,2,3">Will do better next time...</pb-tip>
<pb-tip values="notwant">Your loss!</pb-tip>
</pb-rating>
<pb-mrq name="mrq_1_1" question="What do you like in this MRQ?" message="Thank you for answering!" required_choices="gracefulness,elegance,beauty">
<pb-choice value="elegance">Its elegance</pb-choice>
<pb-choice value="beauty">Its beauty</pb-choice>
<pb-choice value="gracefulness">Its gracefulness</pb-choice>
<pb-choice value="bugs">Its bugs</pb-choice>
<pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<pb-tip values="bugs">Nah, there isn't any!</pb-tip>
</pb-mrq>
<pb-message type="completed">
<p>Congratulations!</p>
</mentoring-message>
<mentoring-message type="incomplete">
</pb-message>
<pb-message type="incomplete">
<p>Still some work to do...</p>
</mentoring-message>
</mentoring>
</pb-message>
</problem-builder>
<mentoring enforce_dependency="false" followed_by="past_attempts">
<problem-builder enforce_dependency="false" followed_by="past_attempts">
<html>
<h3>Checking your improvement frog</h3>
<p>Now, let's make sure your frog meets the criteria for a strong column 1. Here is your frog:</p>
</html>
<answer-recap name="improvement-frog"/>
<mcq name="frog-happy" question="Is this frog happy for you?" correct_choices="yes,maybenot,understand">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<tip values="yes">Great. Your frog should be happy for you.</tip>
<tip values="maybenot">In the end, all the feedback you have gotten from others should not lead you to choose a frog that does not also feel happy and important to you.</tip>
<tip values="understand">
<pb-answer-recap name="improvement-frog"/>
<pb-mcq name="frog-happy" question="Is this frog happy for you?" correct_choices="yes,maybenot,understand">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<pb-tip values="yes">Great. Your frog should be happy for you.</pb-tip>
<pb-tip values="maybenot">In the end, all the feedback you have gotten from others should not lead you to choose a frog that does not also feel happy and important to you.</pb-tip>
<pb-tip values="understand">
<p>If a frog is <span class="italic">happy for you</span>, that means it is a frog that you genuinely feel in your own heart to be something that you want to improve. What is in your heart?</p>
</tip>
</mcq>
<mcq name="frog-implicate" question="Does this frog implicate you?" correct_choices="yes,maybenot,understand">
<choice value="yes">Yes</choice>
<choice value="maybenot">Maybe not</choice>
<choice value="understand">I don't understand</choice>
<tip values="yes">Great. Your frog should implicate you.</tip>
<tip values="maybenot">
</pb-tip>
</pb-mcq>
<pb-mcq name="frog-implicate" question="Does this frog implicate you?" correct_choices="yes,maybenot,understand">
<pb-choice value="yes">Yes</pb-choice>
<pb-choice value="maybenot">Maybe not</pb-choice>
<pb-choice value="understand">I don't understand</pb-choice>
<pb-tip values="yes">Great. Your frog should implicate you.</pb-tip>
<pb-tip values="maybenot">
<p>Since the Trial of Uruk-Shan focuses on your own growth and change, it is important to be clear about the ways <span class="bold">you</span> are hoping to change and improve.</p>
</tip>
<tip values="understand">Your frog implicates you if it is clear that you must get better at something. Your frog should focus on something you can control.</tip>
</mcq>
<rating name="frog-important" low="Not at all important to me" high="Very important to me" question="How important is it to you?" correct_choices="4,5,1,2,3,understand">
<choice value="understand">I don't understand</choice>
<tip values="4,5">Great!</tip>
<tip values="1,2,3">The Trial of Uruk-Shan helps you uncover some of the core beliefs and assumptions you have held that are preventing you from making change.</tip>
<tip values="understand">A frog is important if it is one that could make a big difference in helping you reach your frogs in your work life or your personal life (or both).</tip>
</rating>
<mentoring-message type="completed">
</pb-tip>
<pb-tip values="understand">Your frog implicates you if it is clear that you must get better at something. Your frog should focus on something you can control.</pb-tip>
</pb-mcq>
<pb-rating name="frog-important" low="Not at all important to me" high="Very important to me" question="How important is it to you?" correct_choices="4,5,1,2,3,understand">
<pb-choice value="understand">I don't understand</pb-choice>
<pb-tip values="4,5">Great!</pb-tip>
<pb-tip values="1,2,3">The Trial of Uruk-Shan helps you uncover some of the core beliefs and assumptions you have held that are preventing you from making change.</pb-tip>
<pb-tip values="understand">A frog is important if it is one that could make a big difference in helping you reach your frogs in your work life or your personal life (or both).</pb-tip>
</pb-rating>
<pb-message type="completed">
Great! You have indicated that you have chosen a frog that is happy for you, implicates you, has room for improvement, and is important to you. You are now ready to move onto the next step.
</mentoring-message>
</mentoring>
</pb-message>
</problem-builder>
<mentoring display_submit="false" enforce_dependency="false">
<mentoring-table type="table_test" url_name="table_2">
<mentoring-column header="Header Test 1">
<answer-recap name="table_1_answer_1" />
</mentoring-column>
<problem-builder display_submit="false" enforce_dependency="false">
<pb-table type="table_test" url_name="table_2">
<pb-column header="Header Test 1">
<pb-answer-recap name="table_1_answer_1" />
</pb-column>
<mentoring-column header="Header &lt;strong&gt;Test 2&lt;/strong&gt;">
<answer-recap name="table_1_answer_2" />
<pb-column header="Header &lt;strong&gt;Test 2&lt;/strong&gt;">
<pb-answer-recap name="table_1_answer_2" />
<html><p>Inline HTML</p></html>
<answer-recap name="table_1_answer_2" />
</mentoring-column>
</mentoring-table>
</mentoring>
<pb-answer-recap name="table_1_answer_2" />
</pb-column>
</pb-table>
</problem-builder>
......@@ -43,11 +43,33 @@ class Change(object):
raise NotImplementedError
class RenameMentoringTag(Change):
"""
Replace <mentoring> with <problem-builder>
"""
@staticmethod
def applies_to(node):
return node.tag == "mentoring"
def apply(self):
self.node.tag = "problem-builder"
class PrefixTags(Change):
""" Most old elements now get a pb- prefix """
@staticmethod
def applies_to(node):
return node.tag in ("tip", "choice", "answer", "mcq", "mrq", "rating", "column", "message")
def apply(self):
self.node.tag = "pb-" + self.node.tag
class RemoveTitle(Change):
""" The old <title> element is now an attribute of <mentoring> """
@staticmethod
def applies_to(node):
return node.tag == "title" and node.getparent().tag == "mentoring"
return node.tag == "title" and node.getparent().tag == "problem-builder"
def apply(self):
title = self.node.text.strip()
......@@ -60,10 +82,10 @@ class RemoveTitle(Change):
class UnwrapHTML(Change):
""" <choice>,<tip>, <header>, and <message> now contain HTML without an explicit <html> wrapper. """
""" <pb-choice>,<pb-tip>, <header>, and <pb-message> now contain HTML without an explicit <html> wrapper. """
@staticmethod
def applies_to(node):
return node.tag == "html" and node.getparent().tag in ("choice", "tip", "message", "header")
return node.tag == "html" and node.getparent().tag in ("pb-choice", "pb-tip", "pb-message", "header")
def apply(self):
p = self.node.getparent()
......@@ -76,28 +98,39 @@ class UnwrapHTML(Change):
p.remove(self.node)
class RenameTableTag(Change):
"""
Replace <mentoring-table> with <pb-table>
"""
@staticmethod
def applies_to(node):
return node.tag == "mentoring-table"
def apply(self):
self.node.tag = "pb-table"
class TableColumnHeader(Change):
"""
Replace:
<mentoring-table>
<column>
<pb-table>
<pb-column>
<header>Answer 1</header>
<answer name="answer_1" />
</column>
</mentoring-table>
</pb-column>
</pb-table>
with
<mentoring-table>
<mentoring-column header="Answer 1">
<pb-table>
<pb-column header="Answer 1">
<answer-recap name="answer_1" />
</mentoring-column>
</mentoring-table>
</pb-column>
</pb-table>
"""
@staticmethod
def applies_to(node):
return node.tag == "column" and node.getparent().tag == "mentoring-table"
return node.tag == "pb-column" and node.getparent().tag == "pb-table"
def apply(self):
self.node.tag = "mentoring-column"
header_html = u""
to_remove = []
for child in list(self.node):
......@@ -107,12 +140,12 @@ class TableColumnHeader(Change):
for grandchild in list(child):
header_html += etree.tostring(grandchild)
to_remove.append(child)
elif child.tag == "answer":
child.tag = "answer-recap"
elif child.tag == "pb-answer":
child.tag = "pb-answer-recap"
if "read_only" in child.attrib:
del child.attrib["read_only"]
elif child.tag != "html":
warnings.warn("Invalid <column> element: Unexpected <{}>".format(child.tag))
warnings.warn("Invalid <pb-column> element: Unexpected <{}>".format(child.tag))
return
for child in to_remove:
self.node.remove(child)
......@@ -121,49 +154,36 @@ class TableColumnHeader(Change):
self.node.attrib["header"] = header_html
class PrefixMessageElements(Change):
"""
<message> is renamed to <mentoring-message> since it only works as a direct child of
<mentoring> and <message> could collide with other future XBlocks.
"""
@staticmethod
def applies_to(node):
return node.tag == "message" and node.getparent().tag == "mentoring"
def apply(self):
self.node.tag = "mentoring-message"
class QuizzToMCQ(Change):
""" <quizz> element was an alias for <mcq>. In v2 we only have <mcq> """
""" <quizz> element was an alias for <mcq>. In v2 we only have <pb-mcq> """
@staticmethod
def applies_to(node):
return node.tag == "quizz"
def apply(self):
self.node.tag = "mcq"
self.node.tag = "pb-mcq"
class MCQToRating(Change):
""" <mcq type="rating"> is now just <rating>, and we never use type="choices" on MCQ/MRQ """
@staticmethod
def applies_to(node):
return node.tag in ("mcq", "mrq") and "type" in node.attrib
return node.tag in ("pb-mcq", "pb-mrq") and "type" in node.attrib
def apply(self):
if self.node.tag == "mcq" and self.node.get("type") == "rating":
self.node.tag = "rating"
if self.node.tag == "pb-mcq" and self.node.get("type") == "rating":
self.node.tag = "pb-rating"
self.node.attrib.pop("type") # Type attribute is no longer used.
class ReadOnlyAnswerToRecap(Change):
""" <answer read_only="true"> is now <answer-recap/> """
""" <answer read_only="true"> is now <pb-answer-recap/> """
@staticmethod
def applies_to(node):
return node.tag == "answer" and node.get("read_only") == "true"
return node.tag == "pb-answer" and node.get("read_only") == "true"
def apply(self):
self.node.tag = "answer-recap"
self.node.tag = "pb-answer-recap"
self.node.attrib
self.node.attrib.pop("read_only")
for name in self.node.attrib:
......@@ -183,7 +203,7 @@ class QuestionToField(Change):
"""
@staticmethod
def applies_to(node):
parent_tags = ("answer", "mcq", "mrq", "rating")
parent_tags = ("pb-answer", "pb-mcq", "pb-mrq", "pb-rating")
return node.tag == "question" and node.getparent().tag in parent_tags
def apply(self):
......@@ -206,7 +226,11 @@ class QuestionSubmitMessageToField(Change):
"""
@staticmethod
def applies_to(node):
return node.tag == "message" and node.get("type") == "on-submit" and node.getparent().tag in ("mcq", "mrq")
return (
node.tag == "pb-message" and
node.get("type") == "on-submit" and
node.getparent().tag in ("pb-mcq", "pb-mrq")
)
def apply(self):
if list(self.node):
......@@ -223,7 +247,7 @@ class TipChanges(Change):
"""
@staticmethod
def applies_to(node):
return node.tag == "tip" and node.getparent().tag in ("mcq", "mrq", "rating")
return node.tag == "pb-tip" and node.getparent().tag in ("pb-mcq", "pb-mrq", "pb-rating")
def apply(self):
p = self.node.getparent()
......@@ -239,7 +263,7 @@ class TipChanges(Change):
return
mode = self.node.attrib.keys()[0]
value = self.node.attrib[mode]
if p.tag == "mrq":
if p.tag == "pb-mrq":
if mode == "display":
add_to_list("ignored_choices", value)
elif mode == "require":
......@@ -262,7 +286,7 @@ class SharedHeaderToHTML(Change):
""" <shared-header> element no longer exists. Just use <html> """
@staticmethod
def applies_to(node):
return node.tag == "shared-header" and node.getparent().tag == "mentoring"
return node.tag == "shared-header" and node.getparent().tag == "problem-builder"
def apply(self):
self.node.tag = "html"
......@@ -270,10 +294,12 @@ class SharedHeaderToHTML(Change):
# An *ordered* list of all XML schema changes:
xml_changes = (
RenameMentoringTag,
PrefixTags,
RemoveTitle,
UnwrapHTML,
RenameTableTag,
TableColumnHeader,
PrefixMessageElements,
QuizzToMCQ,
MCQToRating,
ReadOnlyAnswerToRecap,
......
......@@ -40,26 +40,35 @@ def package_data(pkg, root_list):
# Main ##############################################################
BLOCKS = [
'mentoring = mentoring:MentoringBlock',
'problem-builder = mentoring:MentoringBlock',
'mentoring = mentoring:MentoringBlock', # Deprecated alias for problem-builder. Required to import older blocks.
'mentoring-table = mentoring:MentoringTableBlock',
'mentoring-column = mentoring:MentoringTableColumn',
'answer = mentoring:AnswerBlock',
'answer-recap = mentoring:AnswerRecapBlock',
'mcq = mentoring:MCQBlock',
'rating = mentoring:RatingBlock',
'mrq = mentoring:MRQBlock',
'mentoring-message = mentoring:MentoringMessageBlock',
'tip = mentoring:TipBlock',
'choice = mentoring:ChoiceBlock',
# Deprecated:
'mentoring-answer = mentoring:AnswerBlock',
'mentoring-answer-recap = mentoring:AnswerRecapBlock',
'mentoring-mcq = mentoring:MCQBlock',
'mentoring-rating = mentoring:RatingBlock',
'mentoring-mrq = mentoring:MRQBlock',
'mentoring-tip = mentoring:TipBlock',
'mentoring-choice = mentoring:ChoiceBlock',
'pb-table = mentoring:MentoringTableBlock',
'pb-column = mentoring:MentoringTableColumn',
'pb-answer = mentoring:AnswerBlock',
'pb-answer-recap = mentoring:AnswerRecapBlock',
'pb-mcq = mentoring:MCQBlock',
'pb-rating = mentoring:RatingBlock',
'pb-mrq = mentoring:MRQBlock',
'pb-message = mentoring:MentoringMessageBlock',
'pb-tip = mentoring:TipBlock',
'pb-choice = mentoring:ChoiceBlock',
# Deprecated. You can temporarily uncomment and run 'python setup.py develop' if you have these blocks
# installed from testing mentoring v2 and need to get past an error message.
#'answer = mentoring:AnswerBlock',
#'mentoring-answer = mentoring:AnswerBlock',
#'answer-recap = mentoring:AnswerRecapBlock',
#'mentoring-answer-recap = mentoring:AnswerRecapBlock',
#'mcq = mentoring:MCQBlock',
#'mentoring-mcq = mentoring:MCQBlock',
#'rating = mentoring:RatingBlock',
#'mentoring-rating = mentoring:RatingBlock',
#'mrq = mentoring:MRQBlock',
#'mentoring-mrq = mentoring:MRQBlock',
#'tip = mentoring:TipBlock',
#'mentoring-tip = mentoring:TipBlock',
#'choice = mentoring:ChoiceBlock',
#'mentoring-choice = mentoring:ChoiceBlock',
]
setup(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment