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,6 +16,7 @@ ...@@ -16,6 +16,7 @@
{% 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>
{% for example in assessments.training.examples%}
<li class="openassessment_training_example is-collapsible"> <li class="openassessment_training_example is-collapsible">
<div class="openassessment_training_example_header view-outline"> <div class="openassessment_training_example_header view-outline">
...@@ -42,7 +43,15 @@ ...@@ -42,7 +43,15 @@
<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}}
{% for opt_sel in example.options_selected %}
{% if opt_sel.criterion == criterion.name and opt_sel.option == option.name %}
selected
{% endif %}
{% endfor %}
>
{{option.name}} - {{option.points}} {% trans "points" %}
</option>
{% endfor %} {% endfor %}
</select> </select>
</label> </label>
...@@ -51,14 +60,18 @@ ...@@ -51,14 +60,18 @@
{% endfor %} {% endfor %}
</ol> </ol>
</div> </div>
<div class="openassessment_training_example_essay_wrapper"> <div class="openassessment_training_example_essay_wrapper">
<h2> <h2>
{% trans "Response" %} {% trans "Response" %}
</h2> </h2>
<textarea class="openassessment_training_example_essay"></textarea> <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,7 +794,10 @@ ...@@ -790,7 +794,10 @@
} }
.openassessment_add_training_example { .openassessment_add_training_example {
:before { color: #009fe6;
}
.openassessment_add_training_example:before {
font-family: "FontAwesome"; font-family: "FontAwesome";
display: inline-block; display: inline-block;
margin-left: 5px; margin-left: 5px;
...@@ -798,8 +805,6 @@ ...@@ -798,8 +805,6 @@
width: auto; width: auto;
height: auto; height: auto;
content: "\f067"; content: "\f067";
}
color: #009fe6;
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