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 ...@@ -395,7 +395,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
raw_score = self.score.raw 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, 'num_attempts': self.num_attempts,
'submitted_answer': submissions, 'submitted_answer': submissions,
'grade': raw_score, 'grade': raw_score,
...@@ -460,7 +460,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC ...@@ -460,7 +460,7 @@ class MentoringBlock(XBlock, StepParentMixin, StudioEditableXBlockMixin, StudioC
event_data['num_attempts'] = self.num_attempts event_data['num_attempts'] = self.num_attempts
event_data['submitted_answer'] = submissions 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 { return {
'completed': completed, 'completed': completed,
......
...@@ -46,7 +46,7 @@ function MentoringBlock(runtime, element) { ...@@ -46,7 +46,7 @@ function MentoringBlock(runtime, element) {
if (!clickedInside(question_feedback_selector, question_feedback_selector)) { if (!clickedInside(question_feedback_selector, question_feedback_selector)) {
$(question_feedback_selector).not(':hidden').each(function (i, el) { $(question_feedback_selector).not(':hidden').each(function (i, el) {
$(el).hide(); $(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) { ...@@ -118,5 +118,5 @@ function MentoringBlock(runtime, element) {
MentoringAssessmentView(runtime, element, mentoring); 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) { ...@@ -112,7 +112,7 @@ function MentoringAssessmentView(runtime, element, mentoring) {
$(child.element).show(); $(child.element).show();
$(child.element).find("input, textarea").first().focus(); $(child.element).find("input, textarea").first().focus();
mentoring.publish_event({ mentoring.publish_event({
event_type: 'xblock.mentoring.assessment.shown', event_type: 'xblock.problem_builder.assessment.shown',
exercise_id: child.name exercise_id: child.name
}); });
......
function MentoringEditComponents(runtime, element) { function MentoringEditComponents(runtime, element) {
"use strict"; "use strict";
// Disable "add" buttons when a message of that type already exists: // 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() { var updateButtons = function() {
$buttons.each(function() { $buttons.each(function() {
var msg_type = $(this).data('boilerplate'); var msg_type = $(this).data('boilerplate');
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="new-component"> <div class="new-component">
<ul class="new-component-type"> <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="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> </ul>
</div> </div>
</div> </div>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="add-xblock-component new-component-item adding"> <div class="add-xblock-component new-component-item adding">
<div class="new-component"> <div class="new-component">
<ul class="new-component-type"> <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> </ul>
</div> </div>
</div> </div>
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
<div class="new-component"> <div class="new-component">
<h5>{% trans "Add New Component" %}</h5> <h5>{% trans "Add New Component" %}</h5>
<ul class="new-component-type"> <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="pb-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="pb-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="pb-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-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="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="pb-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="pb-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="pb-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="pb-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-message" data-boilerplate="max_attempts_reached">{% trans "Message (Max # Attempts)" %}</a></li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<div class="add-xblock-component new-component-item adding"> <div class="add-xblock-component new-component-item adding">
<div class="new-component"> <div class="new-component">
<ul class="new-component-type"> <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="pb-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-tip">{% trans "Add Tip" %}</a></li>
</ul> </ul>
</div> </div>
</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> <html_demo>
<p>This paragraph is shared between <strong>all</strong> questions.</p> <p>This paragraph is shared between <strong>all</strong> questions.</p>
<p>Please answer the questions below.</p> <p>Please answer the questions below.</p>
</html_demo> </html_demo>
<answer name="goal" question="What is your goal?"> <pb-answer name="goal" question="What is your goal?">
</answer> </pb-answer>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes"> <pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip> <pb-tip values="yes">Great!</pb-tip>
<tip values="maybenot">Ah, damn.</tip> <pb-tip values="maybenot">Ah, damn.</pb-tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip> <pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</mcq> </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"> <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">
<choice value="notwant">I don't want to rate it</choice> <pb-choice value="notwant">I don't want to rate it</pb-choice>
<tip values="4,5">I love good grades.</tip> <pb-tip values="4,5">I love good grades.</pb-tip>
<tip values="1,2,3">Will do better next time...</tip> <pb-tip values="1,2,3">Will do better next time...</pb-tip>
<tip values="notwant">Your loss!</tip> <pb-tip values="notwant">Your loss!</pb-tip>
</rating> </pb-rating>
<mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty"> <pb-mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty">
<choice value="elegance">Its elegance</choice> <pb-choice value="elegance">Its elegance</pb-choice>
<choice value="beauty">Its beauty</choice> <pb-choice value="beauty">Its beauty</pb-choice>
<choice value="gracefulness">Its gracefulness</choice> <pb-choice value="gracefulness">Its gracefulness</pb-choice>
<choice value="bugs">Its bugs</choice> <pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip> <pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip> <pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<tip values="bugs">Nah, there isn't any!</tip> <pb-tip values="bugs">Nah, there isn't any!</pb-tip>
</mrq> </pb-mrq>
</mentoring> </problem-builder>
<mentoring display_name="Default Title" weight="1" mode="standard"> <problem-builder display_name="Default Title" weight="1" mode="standard">
<html_demo> <html_demo>
<p>Please answer the questions below.</p> <p>Please answer the questions below.</p>
</html_demo> </html_demo>
<answer name="goal" question="What is your goal?"> <pb-answer name="goal" question="What is your goal?">
</answer> </pb-answer>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes"> <pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip> <pb-tip values="yes">Great!</pb-tip>
<tip values="maybenot">Ah, damn.</tip> <pb-tip values="maybenot">Ah, damn.</pb-tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip> <pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</mcq> </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"> <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">
<choice value="notwant">I don't want to rate it</choice> <pb-choice value="notwant">I don't want to rate it</pb-choice>
<tip values="4,5">I love good grades.</tip> <pb-tip values="4,5">I love good grades.</pb-tip>
<tip values="1,2,3">Will do better next time...</tip> <pb-tip values="1,2,3">Will do better next time...</pb-tip>
<tip values="notwant">Your loss!</tip> <pb-tip values="notwant">Your loss!</pb-tip>
</rating> </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!"> <pb-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> <pb-choice value="elegance">Its elegance</pb-choice>
<choice value="beauty">Its beauty</choice> <pb-choice value="beauty">Its beauty</pb-choice>
<choice value="gracefulness">Its gracefulness</choice> <pb-choice value="gracefulness">Its gracefulness</pb-choice>
<choice value="bugs">Its bugs</choice> <pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip> <pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip> <pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<tip values="bugs">Nah, there aren't any!</tip> <pb-tip values="bugs">Nah, there aren't any!</pb-tip>
</mrq> </pb-mrq>
<mentoring-message type="completed"> <pb-message type="completed">
<p>Congratulations!</p> <p>Congratulations!</p>
</mentoring-message> </pb-message>
<mentoring-message type="incomplete"> <pb-message type="incomplete">
<p>Still some work to do...</p> <p>Still some work to do...</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
<vertical_demo> <vertical_demo>
<html_demo><h1>Mentoring Demo</h1></html_demo> <html_demo><h1>Problem Builder Demo</h1></html_demo>
<mentoring display_name="Basic Usage: Questions" weight="1" mode="standard"> <problem-builder display_name="Basic Usage: Questions" weight="1" mode="standard">
<html_demo> <html_demo>
<p>At its most basic, a mentoring block can contain instructions (like this sentence), long answer questions, and various forms of multiple choice question.</p> <p>At its most basic, a mentoring block can contain instructions (like this sentence), long answer questions, and various forms of multiple choice question.</p>
<p>Here is an example of a long answer question:</p> <p>Here is an example of a long answer question:</p>
</html_demo> </html_demo>
<answer name="fav-quote" question="What is your favourite quote (from a book, movie, speech, song, etc.)?"> <pb-answer name="fav-quote" question="What is your favourite quote (from a book, movie, speech, song, etc.)?">
</answer> </pb-answer>
<html_demo><p>Answer this one too:</p></html_demo> <html_demo><p>Answer this one too:</p></html_demo>
<answer name="fav-food" question="What is your favourite food?"> <pb-answer name="fav-food" question="What is your favourite food?">
</answer> </pb-answer>
<html_demo><p>Notice the submit button below will only be enabled once you have completed both questions.</p></html_demo> <html_demo><p>Notice the submit button below will only be enabled once you have completed both questions.</p></html_demo>
</mentoring> </problem-builder>
<mentoring display_name="Basic Long Answer Question" weight="1" mode="standard"> <problem-builder display_name="Basic Long Answer Question" weight="1" mode="standard">
<html_demo> <html_demo>
<p>And here is an example of a Multiple Choice Question (MCQ):</p> <p>And here is an example of a Multiple Choice Question (MCQ):</p>
</html_demo> </html_demo>
<mcq name="plain_mcq" question="Which book includes the line &quot;But I have one want which I have never yet been able to satisfy, and the absence of the object of which I now feel as a most severe evil. I have no friend.&quot;?" correct_choices="frankenstein"> <pb-mcq name="plain_mcq" question="Which book includes the line &quot;But I have one want which I have never yet been able to satisfy, and the absence of the object of which I now feel as a most severe evil. I have no friend.&quot;?" correct_choices="frankenstein">
<choice value="frankenstein"><em>Frankenstein</em></choice> <pb-choice value="frankenstein"><em>Frankenstein</em></pb-choice>
<choice value="moby"><em>Moby-Dick; or, The Whale</em></choice> <pb-choice value="moby"><em>Moby-Dick; or, The Whale</em></pb-choice>
<choice value="twist"><em>Oliver Twist</em></choice> <pb-choice value="twist"><em>Oliver Twist</em></pb-choice>
<choice value="darkness"><em>Heart of Darkness</em></choice> <pb-choice value="darkness"><em>Heart of Darkness</em></pb-choice>
</mcq> </pb-mcq>
<html_demo> <html_demo>
<p>Notice that you can re-try the question as many times as you'd like.</p> <p>Notice that you can re-try the question as many times as you'd like.</p>
</html_demo> </html_demo>
</mentoring> </problem-builder>
<mentoring display_name="Multiple Choice Rating Question" weight="1" mode="standard"> <problem-builder display_name="Multiple Choice Rating Question" weight="1" mode="standard">
<html_demo> <html_demo>
<p>Multiple choice questions can be configured with only one correct answer or with many accepted answers. There is also a special type of multiple choice question, a rating question, which provides a Likert Scale (5-point scale) prompt. Here is an example rating question where any answer is acceptable:</p> <p>Multiple choice questions can be configured with only one correct answer or with many accepted answers. There is also a special type of multiple choice question, a rating question, which provides a Likert Scale (5-point scale) prompt. Here is an example rating question where any answer is acceptable:</p>
<p>How did you like <em>To Kill a Mockingbird</em>?</p> <p>How did you like <em>To Kill a Mockingbird</em>?</p>
</html_demo> </html_demo>
<rating name="rate_mockingbird" low="I really disliked it" high="I loved it" correct_choices="1,2,3,4,5" /> <pb-rating name="rate_mockingbird" low="I really disliked it" high="I loved it" correct_choices="1,2,3,4,5" />
</mentoring> </problem-builder>
<mentoring display_name="Multiple Response Question (and introducing tips)" weight="1" mode="standard"> <problem-builder display_name="Multiple Response Question (and introducing tips)" weight="1" mode="standard">
<html_demo><p>A fourth type of question is the Multiple Response Question (MRQ), which allows student to select multiple answers. Each answer can be marked as required, not required, or acceptable either way. The following question contains examples of each possibility. Try getting it wrong and see how it provides feedback to guide you to a correct answer.</p></html_demo> <html_demo><p>A fourth type of question is the Multiple Response Question (MRQ), which allows student to select multiple answers. Each answer can be marked as required, not required, or acceptable either way. The following question contains examples of each possibility. Try getting it wrong and see how it provides feedback to guide you to a correct answer.</p></html_demo>
<mrq name="future_movies" question="Which of these films are set in the future?" required_choices="apes" ignored_choices="2001"> <pb-mrq name="future_movies" question="Which of these films are set in the future?" required_choices="apes" ignored_choices="2001">
<choice value="starwars">Star Wars Episode V: The Empire Strikes Back</choice> <pb-choice value="starwars">Star Wars Episode V: The Empire Strikes Back</pb-choice>
<choice value="2001">2001: A Space Odyssey</choice> <pb-choice value="2001">2001: A Space Odyssey</pb-choice>
<choice value="apes">Planet of the Apes (1968)</choice> <pb-choice value="apes">Planet of the Apes (1968)</pb-choice>
<tip values="starwars">Star Wars takes place "A long time ago in a galaxy far, far away"</tip> <pb-tip values="starwars">Star Wars takes place "A long time ago in a galaxy far, far away"</pb-tip>
<tip values="2001">You could argue this one either way. When the film was released in 1968, it was set in the future. However, 2001 is now in the past.</tip> <pb-tip values="2001">You could argue this one either way. When the film was released in 1968, it was set in the future. However, 2001 is now in the past.</pb-tip>
<tip values="apes">The majority of the film takes place in the year 3978.</tip> <pb-tip values="apes">The majority of the film takes place in the year 3978.</pb-tip>
</mrq> </pb-mrq>
<mentoring-message type="incomplete"> <pb-message type="incomplete">
<p>Not quite right! Try clicking on the checkmarks/exclamation marks to view <strong>tips</strong> that explain the answers.</p> <p>Not quite right! Try clicking on the checkmarks/exclamation marks to view <strong>tips</strong> that explain the answers.</p>
</mentoring-message> </pb-message>
<mentoring-message type="completed"> <pb-message type="completed">
<p>Nicely done. Even though you got this correct, you can still click on the checkmarks/exclamation marks to view <strong>tips</strong> that explain the answers.</p> <p>Nicely done. Even though you got this correct, you can still click on the checkmarks/exclamation marks to view <strong>tips</strong> that explain the answers.</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
<mentoring display_name="MCQ With Tips" weight="1" mode="standard"> <problem-builder display_name="MCQ With Tips" weight="1" mode="standard">
<html_demo> <html_demo>
<p>Like the MRQ above, multiple choice and rating questions can also provide feedback based on which answer was selected and whether the answer is correct or not. Here's an example:</p> <p>Like the MRQ above, multiple choice and rating questions can also provide feedback based on which answer was selected and whether the answer is correct or not. Here's an example:</p>
</html_demo> </html_demo>
<mcq name="subjunctive" question="Which sentence correctly uses the subjunctive case?" correct_choices="d"> <pb-mcq name="subjunctive" question="Which sentence correctly uses the subjunctive case?" correct_choices="d">
<choice value="a">To buy or not to buy, that is the question.</choice> <pb-choice value="a">To buy or not to buy, that is the question.</pb-choice>
<choice value="b">Renting gives you more flexibility.</choice> <pb-choice value="b">Renting gives you more flexibility.</pb-choice>
<choice value="c">If I was you, I'd buy the house.</choice> <pb-choice value="c">If I was you, I'd buy the house.</pb-choice>
<choice value="d">If I were you, I'd rent the house.</choice> <pb-choice value="d">If I were you, I'd rent the house.</pb-choice>
<tip values="a,b">This sentence is not discussing hypotheticals or impossibilities.</tip> <pb-tip values="a,b">This sentence is not discussing hypotheticals or impossibilities.</pb-tip>
<tip values="c">This sentence should be using the subjunctive case since it's dicsussing a hypothetical, but "was" is the wrong case.</tip> <pb-tip values="c">This sentence should be using the subjunctive case since it's dicsussing a hypothetical, but "was" is the wrong case.</pb-tip>
<tip values="d">Correct. "was" has become "were" to indicate the subjunctive case.</tip> <pb-tip values="d">Correct. "was" has become "were" to indicate the subjunctive case.</pb-tip>
</mcq> </pb-mcq>
<mentoring-message type="incomplete"> <pb-message type="incomplete">
<p>Read the tip above and try again.</p> <p>Read the tip above and try again.</p>
</mentoring-message> </pb-message>
<mentoring-message type="completed"> <pb-message type="completed">
<p>Nicely done. If I were you, I'd be proud of myself.</p> <p>Nicely done. If I were you, I'd be proud of myself.</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
<mentoring display_name="Reviewing Answers"> <problem-builder display_name="Reviewing Answers">
<html_demo><p>A student's responses to long answer questions can be displayed later in the course. (<strong>Note:</strong> If you're going through this demo all at once, you may need to refresh the page.) Below is your favorite quote.</p></html_demo> <html_demo><p>A student's responses to long answer questions can be displayed later in the course. (<strong>Note:</strong> If you're going through this demo all at once, you may need to refresh the page.) Below is your favorite quote.</p></html_demo>
<answer-recap display_name="Your Favorite Quote" name="fav-quote" /> <pb-answer-recap display_name="Your Favorite Quote" name="fav-quote" />
<html_demo><p>Answer recaps can also be displayed in table form:</p></html_demo> <html_demo><p>Answer recaps can also be displayed in table form:</p></html_demo>
<mentoring-table> <pb-table>
<mentoring-column header="Favorite Quote"> <pb-column header="Favorite Quote">
<answer-recap name="fav-quote" /> <pb-answer-recap name="fav-quote" />
</mentoring-column> </pb-column>
<mentoring-column header="Favorite Food"> <pb-column header="Favorite Food">
<answer-recap name="fav-food" /> <pb-answer-recap name="fav-food" />
</mentoring-column> </pb-column>
<mentoring-column header="Favorite City"> <pb-column header="Favorite City">
<answer-recap name="some-other-question" /> <pb-answer-recap name="some-other-question" />
<html_demo><p>(This column shows what an answer recap looks like when the student has not yet answered the particular question)</p></html_demo> <html_demo><p>(This column shows what an answer recap looks like when the student has not yet answered the particular question)</p></html_demo>
</mentoring-column> </pb-column>
</mentoring-table> </pb-table>
</mentoring> </problem-builder>
<mentoring display_name="Assessment Example" mode="assessment"> <problem-builder display_name="Assessment Example" mode="assessment">
<html_demo><p>Mentoring questions can also be asked in "Assessment" mode, where each question is asked one at a time, and a final score is shown at the end. The author can set how many attempts each student is given to go through the assessment.</p></html_demo> <html_demo><p>Mentoring questions can also be asked in "Assessment" mode, where each question is asked one at a time, and a final score is shown at the end. The author can set how many attempts each student is given to go through the assessment.</p></html_demo>
<mcq name="aq1" question="What is 7+3?" correct_choices="ten"> <pb-mcq name="aq1" question="What is 7+3?" correct_choices="ten">
<choice value="ten">10</choice> <pb-choice value="ten">10</pb-choice>
<choice value="prime">104,297</choice> <pb-choice value="prime">104,297</pb-choice>
<choice value="infinity">Infinity</choice> <pb-choice value="infinity">Infinity</pb-choice>
<choice value="undefined">Undefined</choice> <pb-choice value="undefined">Undefined</pb-choice>
</mcq> </pb-mcq>
<mcq name="aq2" question="What is the square root of nine?" correct_choices="three"> <pb-mcq name="aq2" question="What is the square root of nine?" correct_choices="three">
<choice value="zero">1</choice> <pb-choice value="zero">1</pb-choice>
<choice value="three">3</choice> <pb-choice value="three">3</pb-choice>
<choice value="nine">9</choice> <pb-choice value="nine">9</pb-choice>
<choice value="infinity">Infinity</choice> <pb-choice value="infinity">Infinity</pb-choice>
<choice value="undefined">Undefined</choice> <pb-choice value="undefined">Undefined</pb-choice>
</mcq> </pb-mcq>
<mcq name="aq3" question="What is 10&#247;0?" correct_choices="infinity,undefined"> <pb-mcq name="aq3" question="What is 10&#247;0?" correct_choices="infinity,undefined">
<choice value="zero">0</choice> <pb-choice value="zero">0</pb-choice>
<choice value="ten">10</choice> <pb-choice value="ten">10</pb-choice>
<choice value="negten">-10</choice> <pb-choice value="negten">-10</pb-choice>
<choice value="infinity">Infinity</choice> <pb-choice value="infinity">Infinity</pb-choice>
<choice value="undefined">Undefined</choice> <pb-choice value="undefined">Undefined</pb-choice>
</mcq> </pb-mcq>
</mentoring> </problem-builder>
<html_demo> <html_demo>
<h1>See the details</h1> <h1>See the details</h1>
<p>Check out the XML source below to get an idea of how these mentoring questions were set up and what kind of options authors have available.</p> <p>Check out the XML source below to get an idea of how these mentoring questions were set up and what kind of options authors have available.</p>
......
<mentoring display_name="Default Title" weight="1" mode="standard"> <problem-builder display_name="Default Title" weight="1" mode="standard">
<html_demo> <html_demo>
<p>Please answer the questions below.</p> <p>Please answer the questions below.</p>
</html_demo> </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"> <pb-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> <pb-choice value="elegance">Its elegance</pb-choice>
<choice value="beauty">Its beauty</choice> <pb-choice value="beauty">Its beauty</pb-choice>
<choice value="gracefulness">Its gracefulness</choice> <pb-choice value="gracefulness">Its gracefulness</pb-choice>
<choice value="bugs">Its bugs</choice> <pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip> <pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip> <pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<tip values="bugs">Nah, there aren't any!</tip> <pb-tip values="bugs">Nah, there aren't any!</pb-tip>
</mrq> </pb-mrq>
<mentoring-message type="completed"> <pb-message type="completed">
<p>Congratulations!</p> <p>Congratulations!</p>
</mentoring-message> </pb-message>
<mentoring-message type="incomplete"> <pb-message type="incomplete">
<p>Still some work to do...</p> <p>Still some work to do...</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
<vertical_demo> <vertical_demo>
<mentoring url_name="answer_blank_read_only" enforce_dependency="false"> <problem-builder url_name="answer_blank_read_only" enforce_dependency="false">
<answer-recap name="answer_blank" /> <pb-answer-recap name="answer_blank" />
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<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> <html_demo>
<p>This should be displayed in the answer_edit scenario</p> <p>This should be displayed in the answer_edit scenario</p>
</html_demo> </html_demo>
<answer name="answer_1" /> <pb-answer name="answer_1" />
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring url_name="answer_edit_2" enforce_dependency="false"> <problem-builder url_name="answer_edit_2" enforce_dependency="false">
<answer-recap name="answer_1" /> <pb-answer-recap name="answer_1" />
<answer name="answer_1" /> <pb-answer name="answer_1" />
</mentoring> </problem-builder>
</vertical_demo> </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> <html_demo>
<p>This paragraph is shared between <strong>all</strong> questions.</p> <p>This paragraph is shared between <strong>all</strong> questions.</p>
...@@ -12,34 +12,34 @@ ...@@ -12,34 +12,34 @@
</html_demo> </html_demo>
<acid/> <acid/>
<answer name="goal" question="What is your goal?" /> <pb-answer name="goal" question="What is your goal?" />
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes"> <pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip> <pb-tip values="yes">Great!</pb-tip>
<tip values="maybenot">Ah, damn.</tip> <pb-tip values="maybenot">Ah, damn.</pb-tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip> <pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</mcq> </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"> <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">
<choice value="notwant">I don't want to rate it</choice> <pb-choice value="notwant">I don't want to rate it</pb-choice>
<tip values="4,5">I love good grades.</tip> <pb-tip values="4,5">I love good grades.</pb-tip>
<tip values="1,2,3">Will do better next time...</tip> <pb-tip values="1,2,3">Will do better next time...</pb-tip>
<tip values="notwant">Your loss!</tip> <pb-tip values="notwant">Your loss!</pb-tip>
</rating> </pb-rating>
<mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty"> <pb-mrq name="mrq_1_1" question="What do you like in this MRQ?" required_choices="gracefulness,elegance,beauty">
<choice value="elegance">Its elegance</choice> <pb-choice value="elegance">Its elegance</pb-choice>
<choice value="beauty">Its beauty</choice> <pb-choice value="beauty">Its beauty</pb-choice>
<choice value="gracefulness">Its gracefulness</choice> <pb-choice value="gracefulness">Its gracefulness</pb-choice>
<choice value="bugs">Its bugs</choice> <pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip> <pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip> <pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<tip values="bugs">Nah, there isn't any!</tip> <pb-tip values="bugs">Nah, there isn't any!</pb-tip>
</mrq> </pb-mrq>
</mentoring> </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> <html_demo>
<p>This paragraph is shared between <strong>all</strong> questions.</p> <p>This paragraph is shared between <strong>all</strong> questions.</p>
<p>Please answer the questions below.</p> <p>Please answer the questions below.</p>
</html_demo> </html_demo>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes"> <pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip> <pb-tip values="yes">Great!</pb-tip>
<tip values="maybenot">Ah, damn.</tip> <pb-tip values="maybenot">Ah, damn.</pb-tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip> <pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</mcq> </pb-mcq>
</mentoring> </problem-builder>
<vertical_demo> <vertical_demo>
<mentoring url_name="mcq_1" enforce_dependency="false"> <problem-builder url_name="mcq_1" enforce_dependency="false">
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes"> <pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip> <pb-tip values="yes">Great!</pb-tip>
<tip values="maybenot">Ah, damn.</tip> <pb-tip values="maybenot">Ah, damn.</pb-tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip> <pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</mcq> </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"> <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">
<choice value="notwant">I don't want to rate it</choice> <pb-choice value="notwant">I don't want to rate it</pb-choice>
<tip values="4,5">I love good grades.</tip> <pb-tip values="4,5">I love good grades.</pb-tip>
<tip values="1,2,3">Will do better next time...</tip> <pb-tip values="1,2,3">Will do better next time...</pb-tip>
<tip values="notwant">Your loss!</tip> <pb-tip values="notwant">Your loss!</pb-tip>
</rating> </pb-rating>
<mentoring-message type="completed"> <pb-message type="completed">
All is good now... All is good now...
<p>Congratulations!</p> <p>Congratulations!</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring url_name="mcq_with_comments" display_name="MRQ With Resizable popups" weight="1" enforce_dependency="false"> <problem-builder 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"> <pb-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> <pb-choice value="elegance">Its elegance</pb-choice>
<choice value="beauty">Its beauty</choice> <pb-choice value="beauty">Its beauty</pb-choice>
<choice value="gracefulness">Its gracefulness</choice> <pb-choice value="gracefulness">Its gracefulness</pb-choice>
<choice value="bugs">Its bugs</choice> <pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness" width ="200" height = "200">This MRQ is indeed very graceful</tip> <pb-tip values="gracefulness" width ="200" height = "200">This MRQ is indeed very graceful</pb-tip>
<tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MRQ</tip> <pb-tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MRQ</pb-tip>
<tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</tip> <pb-tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</pb-tip>
<tip values="bugs" width = "100" height = "200">Nah, there isn\'t any!</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> --> <!--<pb-message type="on-submit">This is deliberately commented out to test parsing of XML comments</pb-message> -->
</mrq> </pb-mrq>
<mentoring-message type="completed"> <pb-message type="completed">
<p>Congratulations!</p> <p>Congratulations!</p>
</mentoring-message> </pb-message>
<mentoring-message type="incomplete"> <pb-message type="incomplete">
<p>Still some work to do...</p> <p>Still some work to do...</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring url_name="mcq_with_comments" display_name="MCQ With Resizable popups" weight="1" enforce_dependency="false"> <problem-builder 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"> <pb-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> <pb-choice value="elegance"><strong>Its elegance</strong></pb-choice>
<choice value="beauty"><em>Its beauty</em></choice> <pb-choice value="beauty"><em>Its beauty</em></pb-choice>
<choice value="gracefulness"><strong>Its gracefulness</strong></choice> <pb-choice value="gracefulness"><strong>Its gracefulness</strong></pb-choice>
<choice value="bugs"><span style="font-color:red">Its bugs</span></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> <pb-tip values="gracefulness" width ="200" height = "200">This MCQ is indeed very graceful</pb-tip>
<tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MCQ</tip> <pb-tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MCQ</pb-tip>
<tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</tip> <pb-tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</pb-tip>
<tip values="bugs" width = "100" height = "200">Nah, there isn\'t any!</tip> <pb-tip values="bugs" width = "100" height = "200">Nah, there isn\'t any!</pb-tip>
</mcq> </pb-mcq>
<mentoring-message type="completed"> <pb-message type="completed">
<p>Congratulations!</p> <p>Congratulations!</p>
</mentoring-message> </pb-message>
<mentoring-message type="incomplete"> <pb-message type="incomplete">
<p>Still some work to do...</p> <p>Still some work to do...</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring url_name="mcq_with_comments" display_name="MRQ With Resizable popups" weight="1" enforce_dependency="false"> <problem-builder 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"> <pb-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> <pb-choice value="elegance"><strong>Its elegance</strong></pb-choice>
<choice value="beauty"><em>Its beauty</em></choice> <pb-choice value="beauty"><em>Its beauty</em></pb-choice>
<choice value="gracefulness"><strong>Its gracefulness</strong></choice> <pb-choice value="gracefulness"><strong>Its gracefulness</strong></pb-choice>
<choice value="bugs"><span style="font-color:red">Its bugs</span></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> <pb-tip values="gracefulness" width ="200" height = "200">This MRQ is indeed very graceful</pb-tip>
<tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MRQ</tip> <pb-tip values="elegance" width ="600" height = "800">This is something everyone has to like about this MRQ</pb-tip>
<tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</tip> <pb-tip values="beauty" width ="400" height = "600">This is something everyone has to like about beauty</pb-tip>
<tip values="bugs" width = "100" height = "200">Nah, there aren\'t any!</tip> <pb-tip values="bugs" width = "100" height = "200">Nah, there aren\'t any!</pb-tip>
</mrq> </pb-mrq>
<mentoring-message type="completed"> <pb-message type="completed">
<p>Congratulations!</p> <p>Congratulations!</p>
</mentoring-message> </pb-message>
<mentoring-message type="incomplete"> <pb-message type="incomplete">
<p>Still some work to do...</p> <p>Still some work to do...</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring url_name="answer_no_display_submit" enforce_dependency="false" display_submit="false"> <problem-builder url_name="answer_no_display_submit" enforce_dependency="false" display_submit="false">
<answer name="answer_blank"/> <pb-answer name="answer_blank"/>
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring url_name="mentoring_first" followed_by="progression_2" enforce_dependency="true"> <problem-builder url_name="mentoring_first" followed_by="progression_2" enforce_dependency="true">
<answer name="progression_1_answer" /> <pb-answer name="progression_1_answer" />
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring url_name="progression_2" followed_by="progression_3" enforce_dependency="true"> <problem-builder url_name="progression_2" followed_by="progression_3" enforce_dependency="true">
<answer name="progression_2_answer" /> <pb-answer name="progression_2_answer" />
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring url_name="progression_3" enforce_dependency="true"> <problem-builder url_name="progression_3" enforce_dependency="true">
<answer name="progression_3_answer" /> <pb-answer name="progression_3_answer" />
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring enforce_dependency="false"> <problem-builder enforce_dependency="false">
<answer name="table_1_answer_1" /> <pb-answer name="table_1_answer_1" />
<answer name="table_1_answer_2" /> <pb-answer name="table_1_answer_2" />
</mentoring> </problem-builder>
</vertical_demo> </vertical_demo>
<vertical_demo> <vertical_demo>
<mentoring display_submit="false" enforce_dependency="false"> <problem-builder display_submit="false" enforce_dependency="false">
<mentoring-table> <pb-table>
<mentoring-column header="Header Test 1"> <pb-column header="Header Test 1">
<answer-recap name="table_1_answer_1"/> <pb-answer-recap name="table_1_answer_1"/>
</mentoring-column> </pb-column>
<mentoring-column header="Header Test 2"> <pb-column header="Header Test 2">
<answer-recap name="table_1_answer_2"/> <pb-answer-recap name="table_1_answer_2"/>
</mentoring-column> </pb-column>
</mentoring-table> </pb-table>
</mentoring> </problem-builder>
</vertical_demo> </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> <html_demo>
<p>This paragraph is shared between <strong>all</strong> questions.</p> <p>This paragraph is shared between <strong>all</strong> questions.</p>
<p>Please answer the questions below.</p> <p>Please answer the questions below.</p>
</html_demo> </html_demo>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes"> <pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip> <pb-tip values="yes">Great!</pb-tip>
<tip values="maybenot">Ah, damn.</tip> <pb-tip values="maybenot">Ah, damn.</pb-tip>
<tip values="understand"><div id="test-custom-html">Really?</div></tip> <pb-tip values="understand"><div id="test-custom-html">Really?</div></pb-tip>
</mcq> </pb-mcq>
</mentoring> </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> <html>
<p>This paragraph is shared between <strong>all</strong> questions.</p> <p>This paragraph is shared between <strong>all</strong> questions.</p>
</html> </html>
<html> <html>
<p>Please answer the questions below.</p> <p>Please answer the questions below.</p>
</html> </html>
<answer name="goal" question="What is your goal?"/> <pb-answer name="goal" question="What is your goal?"/>
<mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes"> <pb-mcq name="mcq_1_1" question="Do you like this MCQ?" correct_choices="yes">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great!</tip> <pb-tip values="yes">Great!</pb-tip>
<tip values="maybenot">Ah, damn.</tip> <pb-tip values="maybenot">Ah, damn.</pb-tip>
<tip values="understand"> <pb-tip values="understand">
<div id="test-custom-html">Really?</div> <div id="test-custom-html">Really?</div>
</tip> </pb-tip>
</mcq> </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"> <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">
<choice value="notwant">I don't want to rate it</choice> <pb-choice value="notwant">I don't want to rate it</pb-choice>
<tip values="4,5">I love good grades.</tip> <pb-tip values="4,5">I love good grades.</pb-tip>
<tip values="1,2,3">Will do better next time...</tip> <pb-tip values="1,2,3">Will do better next time...</pb-tip>
<tip values="notwant">Your loss!</tip> <pb-tip values="notwant">Your loss!</pb-tip>
</rating> </pb-rating>
<mrq name="mrq_1_1" question="What do you like in this MRQ?" message="Thank you for answering!" required_choices="gracefulness,elegance,beauty"> <pb-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> <pb-choice value="elegance">Its elegance</pb-choice>
<choice value="beauty">Its beauty</choice> <pb-choice value="beauty">Its beauty</pb-choice>
<choice value="gracefulness">Its gracefulness</choice> <pb-choice value="gracefulness">Its gracefulness</pb-choice>
<choice value="bugs">Its bugs</choice> <pb-choice value="bugs">Its bugs</pb-choice>
<tip values="gracefulness">This MRQ is indeed very graceful</tip> <pb-tip values="gracefulness">This MRQ is indeed very graceful</pb-tip>
<tip values="elegance,beauty">This is something everyone has to like about this MRQ</tip> <pb-tip values="elegance,beauty">This is something everyone has to like about this MRQ</pb-tip>
<tip values="bugs">Nah, there isn't any!</tip> <pb-tip values="bugs">Nah, there isn't any!</pb-tip>
</mrq> </pb-mrq>
<mentoring-message type="completed"> <pb-message type="completed">
<p>Congratulations!</p> <p>Congratulations!</p>
</mentoring-message> </pb-message>
<mentoring-message type="incomplete"> <pb-message type="incomplete">
<p>Still some work to do...</p> <p>Still some work to do...</p>
</mentoring-message> </pb-message>
</mentoring> </problem-builder>
<mentoring enforce_dependency="false" followed_by="past_attempts"> <problem-builder enforce_dependency="false" followed_by="past_attempts">
<html> <html>
<h3>Checking your improvement frog</h3> <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> <p>Now, let's make sure your frog meets the criteria for a strong column 1. Here is your frog:</p>
</html> </html>
<answer-recap name="improvement-frog"/> <pb-answer-recap name="improvement-frog"/>
<mcq name="frog-happy" question="Is this frog happy for you?" correct_choices="yes,maybenot,understand"> <pb-mcq name="frog-happy" question="Is this frog happy for you?" correct_choices="yes,maybenot,understand">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great. Your frog should be happy for you.</tip> <pb-tip values="yes">Great. Your frog should be happy for you.</pb-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> <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>
<tip values="understand"> <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> <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> </pb-tip>
</mcq> </pb-mcq>
<mcq name="frog-implicate" question="Does this frog implicate you?" correct_choices="yes,maybenot,understand"> <pb-mcq name="frog-implicate" question="Does this frog implicate you?" correct_choices="yes,maybenot,understand">
<choice value="yes">Yes</choice> <pb-choice value="yes">Yes</pb-choice>
<choice value="maybenot">Maybe not</choice> <pb-choice value="maybenot">Maybe not</pb-choice>
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="yes">Great. Your frog should implicate you.</tip> <pb-tip values="yes">Great. Your frog should implicate you.</pb-tip>
<tip values="maybenot"> <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> <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> </pb-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> <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>
</mcq> </pb-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"> <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">
<choice value="understand">I don't understand</choice> <pb-choice value="understand">I don't understand</pb-choice>
<tip values="4,5">Great!</tip> <pb-tip values="4,5">Great!</pb-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> <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>
<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> <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>
</rating> </pb-rating>
<mentoring-message type="completed"> <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. 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> </pb-message>
</mentoring> </problem-builder>
<mentoring display_submit="false" enforce_dependency="false"> <problem-builder display_submit="false" enforce_dependency="false">
<mentoring-table type="table_test" url_name="table_2"> <pb-table type="table_test" url_name="table_2">
<mentoring-column header="Header Test 1"> <pb-column header="Header Test 1">
<answer-recap name="table_1_answer_1" /> <pb-answer-recap name="table_1_answer_1" />
</mentoring-column> </pb-column>
<mentoring-column header="Header &lt;strong&gt;Test 2&lt;/strong&gt;"> <pb-column header="Header &lt;strong&gt;Test 2&lt;/strong&gt;">
<answer-recap name="table_1_answer_2" /> <pb-answer-recap name="table_1_answer_2" />
<html><p>Inline HTML</p></html> <html><p>Inline HTML</p></html>
<answer-recap name="table_1_answer_2" /> <pb-answer-recap name="table_1_answer_2" />
</mentoring-column> </pb-column>
</mentoring-table> </pb-table>
</mentoring> </problem-builder>
...@@ -43,11 +43,33 @@ class Change(object): ...@@ -43,11 +43,33 @@ class Change(object):
raise NotImplementedError 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): class RemoveTitle(Change):
""" The old <title> element is now an attribute of <mentoring> """ """ The old <title> element is now an attribute of <mentoring> """
@staticmethod @staticmethod
def applies_to(node): 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): def apply(self):
title = self.node.text.strip() title = self.node.text.strip()
...@@ -60,10 +82,10 @@ class RemoveTitle(Change): ...@@ -60,10 +82,10 @@ class RemoveTitle(Change):
class UnwrapHTML(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 @staticmethod
def applies_to(node): 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): def apply(self):
p = self.node.getparent() p = self.node.getparent()
...@@ -76,28 +98,39 @@ class UnwrapHTML(Change): ...@@ -76,28 +98,39 @@ class UnwrapHTML(Change):
p.remove(self.node) 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): class TableColumnHeader(Change):
""" """
Replace: Replace:
<mentoring-table> <pb-table>
<column> <pb-column>
<header>Answer 1</header> <header>Answer 1</header>
<answer name="answer_1" /> <answer name="answer_1" />
</column> </pb-column>
</mentoring-table> </pb-table>
with with
<mentoring-table> <pb-table>
<mentoring-column header="Answer 1"> <pb-column header="Answer 1">
<answer-recap name="answer_1" /> <answer-recap name="answer_1" />
</mentoring-column> </pb-column>
</mentoring-table> </pb-table>
""" """
@staticmethod @staticmethod
def applies_to(node): 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): def apply(self):
self.node.tag = "mentoring-column"
header_html = u"" header_html = u""
to_remove = [] to_remove = []
for child in list(self.node): for child in list(self.node):
...@@ -107,12 +140,12 @@ class TableColumnHeader(Change): ...@@ -107,12 +140,12 @@ class TableColumnHeader(Change):
for grandchild in list(child): for grandchild in list(child):
header_html += etree.tostring(grandchild) header_html += etree.tostring(grandchild)
to_remove.append(child) to_remove.append(child)
elif child.tag == "answer": elif child.tag == "pb-answer":
child.tag = "answer-recap" child.tag = "pb-answer-recap"
if "read_only" in child.attrib: if "read_only" in child.attrib:
del child.attrib["read_only"] del child.attrib["read_only"]
elif child.tag != "html": elif child.tag != "html":
warnings.warn("Invalid <column> element: Unexpected <{}>".format(child.tag)) warnings.warn("Invalid <pb-column> element: Unexpected <{}>".format(child.tag))
return return
for child in to_remove: for child in to_remove:
self.node.remove(child) self.node.remove(child)
...@@ -121,49 +154,36 @@ class TableColumnHeader(Change): ...@@ -121,49 +154,36 @@ class TableColumnHeader(Change):
self.node.attrib["header"] = header_html 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): 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 @staticmethod
def applies_to(node): def applies_to(node):
return node.tag == "quizz" return node.tag == "quizz"
def apply(self): def apply(self):
self.node.tag = "mcq" self.node.tag = "pb-mcq"
class MCQToRating(Change): class MCQToRating(Change):
""" <mcq type="rating"> is now just <rating>, and we never use type="choices" on MCQ/MRQ """ """ <mcq type="rating"> is now just <rating>, and we never use type="choices" on MCQ/MRQ """
@staticmethod @staticmethod
def applies_to(node): 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): def apply(self):
if self.node.tag == "mcq" and self.node.get("type") == "rating": if self.node.tag == "pb-mcq" and self.node.get("type") == "rating":
self.node.tag = "rating" self.node.tag = "pb-rating"
self.node.attrib.pop("type") # Type attribute is no longer used. self.node.attrib.pop("type") # Type attribute is no longer used.
class ReadOnlyAnswerToRecap(Change): class ReadOnlyAnswerToRecap(Change):
""" <answer read_only="true"> is now <answer-recap/> """ """ <answer read_only="true"> is now <pb-answer-recap/> """
@staticmethod @staticmethod
def applies_to(node): 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): def apply(self):
self.node.tag = "answer-recap" self.node.tag = "pb-answer-recap"
self.node.attrib self.node.attrib
self.node.attrib.pop("read_only") self.node.attrib.pop("read_only")
for name in self.node.attrib: for name in self.node.attrib:
...@@ -183,7 +203,7 @@ class QuestionToField(Change): ...@@ -183,7 +203,7 @@ class QuestionToField(Change):
""" """
@staticmethod @staticmethod
def applies_to(node): 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 return node.tag == "question" and node.getparent().tag in parent_tags
def apply(self): def apply(self):
...@@ -206,7 +226,11 @@ class QuestionSubmitMessageToField(Change): ...@@ -206,7 +226,11 @@ class QuestionSubmitMessageToField(Change):
""" """
@staticmethod @staticmethod
def applies_to(node): 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): def apply(self):
if list(self.node): if list(self.node):
...@@ -223,7 +247,7 @@ class TipChanges(Change): ...@@ -223,7 +247,7 @@ class TipChanges(Change):
""" """
@staticmethod @staticmethod
def applies_to(node): 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): def apply(self):
p = self.node.getparent() p = self.node.getparent()
...@@ -239,7 +263,7 @@ class TipChanges(Change): ...@@ -239,7 +263,7 @@ class TipChanges(Change):
return return
mode = self.node.attrib.keys()[0] mode = self.node.attrib.keys()[0]
value = self.node.attrib[mode] value = self.node.attrib[mode]
if p.tag == "mrq": if p.tag == "pb-mrq":
if mode == "display": if mode == "display":
add_to_list("ignored_choices", value) add_to_list("ignored_choices", value)
elif mode == "require": elif mode == "require":
...@@ -262,7 +286,7 @@ class SharedHeaderToHTML(Change): ...@@ -262,7 +286,7 @@ class SharedHeaderToHTML(Change):
""" <shared-header> element no longer exists. Just use <html> """ """ <shared-header> element no longer exists. Just use <html> """
@staticmethod @staticmethod
def applies_to(node): 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): def apply(self):
self.node.tag = "html" self.node.tag = "html"
...@@ -270,10 +294,12 @@ class SharedHeaderToHTML(Change): ...@@ -270,10 +294,12 @@ class SharedHeaderToHTML(Change):
# An *ordered* list of all XML schema changes: # An *ordered* list of all XML schema changes:
xml_changes = ( xml_changes = (
RenameMentoringTag,
PrefixTags,
RemoveTitle, RemoveTitle,
UnwrapHTML, UnwrapHTML,
RenameTableTag,
TableColumnHeader, TableColumnHeader,
PrefixMessageElements,
QuizzToMCQ, QuizzToMCQ,
MCQToRating, MCQToRating,
ReadOnlyAnswerToRecap, ReadOnlyAnswerToRecap,
......
...@@ -40,26 +40,35 @@ def package_data(pkg, root_list): ...@@ -40,26 +40,35 @@ def package_data(pkg, root_list):
# Main ############################################################## # Main ##############################################################
BLOCKS = [ 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', 'pb-table = mentoring:MentoringTableBlock',
'mentoring-column = mentoring:MentoringTableColumn', 'pb-column = mentoring:MentoringTableColumn',
'answer = mentoring:AnswerBlock', 'pb-answer = mentoring:AnswerBlock',
'answer-recap = mentoring:AnswerRecapBlock', 'pb-answer-recap = mentoring:AnswerRecapBlock',
'mcq = mentoring:MCQBlock', 'pb-mcq = mentoring:MCQBlock',
'rating = mentoring:RatingBlock', 'pb-rating = mentoring:RatingBlock',
'mrq = mentoring:MRQBlock', 'pb-mrq = mentoring:MRQBlock',
'mentoring-message = mentoring:MentoringMessageBlock', 'pb-message = mentoring:MentoringMessageBlock',
'tip = mentoring:TipBlock', 'pb-tip = mentoring:TipBlock',
'choice = mentoring:ChoiceBlock', 'pb-choice = mentoring:ChoiceBlock',
# Deprecated: # Deprecated. You can temporarily uncomment and run 'python setup.py develop' if you have these blocks
'mentoring-answer = mentoring:AnswerBlock', # installed from testing mentoring v2 and need to get past an error message.
'mentoring-answer-recap = mentoring:AnswerRecapBlock', #'answer = mentoring:AnswerBlock',
'mentoring-mcq = mentoring:MCQBlock', #'mentoring-answer = mentoring:AnswerBlock',
'mentoring-rating = mentoring:RatingBlock', #'answer-recap = mentoring:AnswerRecapBlock',
'mentoring-mrq = mentoring:MRQBlock', #'mentoring-answer-recap = mentoring:AnswerRecapBlock',
'mentoring-tip = mentoring:TipBlock', #'mcq = mentoring:MCQBlock',
'mentoring-choice = mentoring:ChoiceBlock', #'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( 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