Commit b647d067 by gradyward

Added in templates for Student Training Authoring

Included:
- HTML Templating using current problem defininition
- Styles
Not included:
- JavaScript changes
- Python test cleanup
parent 84b85443
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class = "drag-handle action"></div> <div class = "drag-handle action"></div>
<div class = "openassessment_inclusion_wrapper"> <div class = "openassessment_inclusion_wrapper">
<input type="checkbox" id="include_student_training" <input type="checkbox" id="include_student_training"
{% if assessments.student_training %} checked="true" {% endif %} > {% if assessments.student_training %} checked="true" {% endif %}>
<label for="include_student_training">{% trans "Step: Student Training" %}</label> <label for="include_student_training">{% trans "Step: Student Training" %}</label>
</div> </div>
<div class = "openassessment_assessment_module_editor"> <div class = "openassessment_assessment_module_editor">
...@@ -16,49 +16,62 @@ ...@@ -16,49 +16,62 @@
{% trans "Enter one or more sample responses that you've created, together with the scores you would give those responses. Be sure to format the responses and scores according to the placeholder text below." %} {% trans "Enter one or more sample responses that you've created, together with the scores you would give those responses. Be sure to format the responses and scores according to the placeholder text below." %}
</p> </p>
<ol> <ol>
<li class="openassessment_training_example is-collapsible"> {% for example in assessments.training.examples%}
<li class="openassessment_training_example is-collapsible">
<div class="openassessment_training_example_header view-outline"> <div class="openassessment_training_example_header view-outline">
<a class="action expand-collapse collapse"> <a class="action expand-collapse collapse">
<i class="icon-caret-down ui-toggle-expansion"></i> <i class="icon-caret-down ui-toggle-expansion"></i>
</a> </a>
<h6 class="openassessment_training_example_header_title"> <h6 class="openassessment_training_example_header_title">
{% blocktrans %} Scored Response {% endblocktrans %} {% blocktrans %} Scored Response {% endblocktrans %}
</h6> </h6>
<div class="openassessment_training_example_remove"> <div class="openassessment_training_example_remove">
<h2>{% trans "Remove" %}</h2> <h2>{% trans "Remove" %}</h2>
</div>
</div> </div>
</div>
<div class="openassessment_training_example_body"> <div class="openassessment_training_example_body">
<div class="openassessment_training_example_scored_rubric wrapper-comp-settings"> <div class="openassessment_training_example_scored_rubric wrapper-comp-settings">
<h2>{% trans "Scored Rubric" %}</h2> <h2>{% trans "Scored Rubric" %}</h2>
<ol class="openassessment_training_example_criteria_selections list-input settings-list"> <ol class="openassessment_training_example_criteria_selections list-input settings-list">
{% for criterion in criteria %} {% for criterion in criteria %}
<li class="field comp-setting-entry"> <li class="field comp-setting-entry">
<div class="wrapper-comp-setting"> <div class="wrapper-comp-setting">
<label class="openassessment_training_example_criterion_name setting-label"> <label class="openassessment_training_example_criterion_name setting-label">
{{criterion.name}} {{criterion.name}}
<select class="openassessment_training_example_criterion_option setting-input"> <select class="openassessment_training_example_criterion_option setting-input">
<option value="Not Scored">{% trans "Not Scored" %}</option> <option value="Not Scored">{% trans "Not Scored" %}</option>
{% for option in criterion.options %} {% for option in criterion.options %}
<option value={{option.name}}>{{option.name}} - {{option.points}} {% trans "points" %}</option> <option value={{option.name}}
{% endfor %} {% for opt_sel in example.options_selected %}
</select> {% if opt_sel.criterion == criterion.name and opt_sel.option == option.name %}
</label> selected
</div> {% endif %}
</li> {% endfor %}
{% endfor %} >
</ol> {{option.name}} - {{option.points}} {% trans "points" %}
</div> </option>
<div class="openassessment_training_example_essay_wrapper"> {% endfor %}
<h2> </select>
{% trans "Response" %} </label>
</h2> </div>
<textarea class="openassessment_training_example_essay"></textarea> </li>
{% endfor %}
</ol>
</div>
<div class="openassessment_training_example_essay_wrapper">
<h2>
{% trans "Response" %}
</h2>
<textarea class="openassessment_training_example_essay">
{{example.answer}}
</textarea>
</div>
</div> </div>
</div>
</li> </li>
{% endfor %}
</ol> </ol>
<div> <div>
<h2 class='openassessment_add_training_example'>{% trans "Add Scored Response" %}</h2> <h2 class='openassessment_add_training_example'>{% trans "Add Scored Response" %}</h2>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
} }
.openassessment_assessment_module_settings_editor{ .openassessment_assessment_module_settings_editor{
padding: 5px; padding: 5px 20px 5px 5px;
margin: 10px; margin: 10px;
border: 1px solid $edx-gray-l3; border: 1px solid $edx-gray-l3;
border-radius: 3px; border-radius: 3px;
...@@ -750,6 +750,7 @@ ...@@ -750,6 +750,7 @@
left: 10px; left: 10px;
height: 100%; height: 100%;
textarea { textarea {
min-height: 90px;
height: Calc(100% - 35px); height: Calc(100% - 35px);
resize: none; resize: none;
box-sizing: border-box; box-sizing: border-box;
...@@ -773,8 +774,11 @@ ...@@ -773,8 +774,11 @@
float: right; float: right;
.openassessment_training_example_criteria_selections { .openassessment_training_example_criteria_selections {
.comp-setting-entry { .comp-setting-entry {
.wrapper-comp-setting{
min-width: 100px;
}
margin: 0; margin: 0;
padding: 7.5px 5px; padding: 10px;
label{ label{
width: 100%; width: 100%;
margin-left: 0; margin-left: 0;
...@@ -790,16 +794,17 @@ ...@@ -790,16 +794,17 @@
} }
.openassessment_add_training_example { .openassessment_add_training_example {
:before {
font-family: "FontAwesome";
display: inline-block;
margin-left: 5px;
margin-right: 10px;
width: auto;
height: auto;
content: "\f067";
}
color: #009fe6; color: #009fe6;
}
.openassessment_add_training_example:before {
font-family: "FontAwesome";
display: inline-block;
margin-left: 5px;
margin-right: 10px;
width: auto;
height: auto;
content: "\f067";
margin-left: 10px; margin-left: 10px;
} }
......
...@@ -85,17 +85,7 @@ class StudioMixin(object): ...@@ -85,17 +85,7 @@ class StudioMixin(object):
'student-training' 'student-training'
) )
if student_training_module: if student_training_module:
student_training_module = copy.deepcopy(student_training_module) assessments['training'] = copy.deepcopy(student_training_module)
try:
examples = xml.serialize_examples_to_xml_str(
student_training_module
)
student_training_module["examples"] = examples
assessments['training'] = student_training_module
# We do not expect serialization to raise an exception, but if it does,
# handle it gracefully.
except:
logger.exception("An error occurred while serializing the XBlock")
submission_due = self.submission_due if self.submission_due else '' submission_due = self.submission_due if self.submission_due else ''
submission_start = self.submission_start if self.submission_start else '' submission_start = self.submission_start if self.submission_start else ''
......
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