Commit bde2b6e6 by Stephen Sanchez

Merge pull request #536 from edx/sanchez/validation-alerts

Updating the alerts in the rubric authoring.
parents 6a28da14 6a630378
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
<h2 class="openassessment_alert_title">{% trans "Rubric Change Impacts Settings Section" %}</h2> <h2 class="openassessment_alert_title">{% trans "Rubric Change Impacts Settings Section" %}</h2>
<p class="openassessment_alert_message">{% trans "A change that you made to this assessment's rubric has an impact on some examples laid out in the settings tab. For more information, go to the Settings section and fix areas highlighted in red." %}</p> <p class="openassessment_alert_message">{% trans "A change that you made to this assessment's rubric has an impact on some examples laid out in the settings tab. For more information, go to the Settings section and fix areas highlighted in red." %}</p>
</div> </div>
<a href="" rel="view" class="action openassessment_alert_close">
<i class="icon-remove-sign"></i>
<span class="label is--hidden">{% trans "close alert" %}</span>
</a>
</div> </div>
<div id="openassessment_rubric_instructions"> <div id="openassessment_rubric_instructions">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -20,7 +20,7 @@ OpenAssessment.ItemUtilities = { ...@@ -20,7 +20,7 @@ OpenAssessment.ItemUtilities = {
} }
index++; index++;
} }
return null; return index.toString();
} }
}; };
......
...@@ -96,17 +96,17 @@ OpenAssessment.StudentTrainingListener.prototype = { ...@@ -96,17 +96,17 @@ OpenAssessment.StudentTrainingListener.prototype = {
*/ */
optionRemove: function(data) { optionRemove: function(data) {
var handler = this; var handler = this;
var changed = false; var invalidated = false;
$('.openassessment_training_example_criterion_option', this.element).each(function() { $('.openassessment_training_example_criterion_option', this.element).each(function() {
var criterionOption = this; var criterionOption = this;
if ($(criterionOption).data('criterion') === data.criterionName) { if ($(criterionOption).data('criterion') === data.criterionName) {
if ($(criterionOption).val() == data.name) { if ($(criterionOption).val() === data.name.toString()) {
$(criterionOption).val(""); $(criterionOption).val("");
$(criterionOption).addClass("openassessment_highlighted_field"); $(criterionOption).addClass("openassessment_highlighted_field");
$(criterionOption).click(function() { $(criterionOption).click(function() {
$(criterionOption).removeClass("openassessment_highlighted_field"); $(criterionOption).removeClass("openassessment_highlighted_field");
}); });
changed = true; invalidated = true;
} }
$('option[value="' + data.name + '"]', criterionOption).remove(); $('option[value="' + data.name + '"]', criterionOption).remove();
...@@ -115,12 +115,12 @@ OpenAssessment.StudentTrainingListener.prototype = { ...@@ -115,12 +115,12 @@ OpenAssessment.StudentTrainingListener.prototype = {
// the criterion entirely. // the criterion entirely.
if ($("option", criterionOption).length == 1) { if ($("option", criterionOption).length == 1) {
handler.removeAllOptions(data); handler.removeAllOptions(data);
return; invalidated = false;
} }
} }
}); });
if (changed) { if (invalidated) {
this.displayAlertMsg( this.displayAlertMsg(
gettext("Option Deletion Led to Invalidation"), gettext("Option Deletion Led to Invalidation"),
gettext("Because you deleted an option, some student training examples had to be reset.") gettext("Because you deleted an option, some student training examples had to be reset.")
......
...@@ -9,9 +9,15 @@ Returns: ...@@ -9,9 +9,15 @@ Returns:
Openassessment.ValidationAlert Openassessment.ValidationAlert
*/ */
OpenAssessment.ValidationAlert = function (element) { OpenAssessment.ValidationAlert = function (element) {
var alert = this;
this.element = element; this.element = element;
this.title = $(".openassessment_alert_title", this.element); this.title = $(".openassessment_alert_title", this.element);
this.message = $(".openassessment_alert_message", this.element); this.message = $(".openassessment_alert_message", this.element);
$(".openassessment_alert_close", element).click(function(eventObject) {
eventObject.preventDefault();
alert.hide();
}
);
}; };
OpenAssessment.ValidationAlert.prototype = { OpenAssessment.ValidationAlert.prototype = {
......
...@@ -439,6 +439,7 @@ ...@@ -439,6 +439,7 @@
padding: 10px; padding: 10px;
position: absolute; position: absolute;
z-index: 10; z-index: 10;
width: 100%;
.openassessment_alert_icon:before{ .openassessment_alert_icon:before{
font-family: FontAwesome; font-family: FontAwesome;
...@@ -463,6 +464,28 @@ ...@@ -463,6 +464,28 @@
color: darkgray; color: darkgray;
} }
} }
// with cancel
.openassessment_alert_close {
display: inline-block;
position: absolute;
top: 0px;
right: 10px;
color: #e9e9e9;
background: #323232;
text-align: center;
padding: 2px 5px;
[class^="icon"] {
width: auto;
margin: 0;
padding: 2px;
}
&:hover {
color: $blue;
}
}
} }
.wrapper-comp-settings{ .wrapper-comp-settings{
......
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