Commit 218d7513 by gradyward

Merge branch 'authoring' of https://github.com/edx/edx-ora2 into grady/assessment-reorder

Conflicts:
	openassessment/xblock/static/js/openassessment-lms.min.js
	openassessment/xblock/static/js/openassessment-studio.min.js
parents e26f6eff 78078148
......@@ -17,8 +17,10 @@ module.exports = function(config) {
'lib/jquery.min.js',
'lib/*.js',
'src/oa_shared.js',
'src/*.js',
'src/lms/*.js',
'src/studio/*.js',
'spec/*.js',
'spec/lms/*.js',
'spec/studio/*.js',
......@@ -39,6 +41,7 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'src/*.js': 'coverage',
'src/lms/*.js': 'coverage',
'src/studio/*.js': 'coverage'
},
......
......@@ -68,6 +68,11 @@ describe("OpenAssessment.EditSettingsView", function() {
});
it("builds a description of enabled assessments", function() {
// In this test we also verify that the mechansim that reads off of the DOM is correct, in that it gets
// the right order of assessments, in addition to performing the correct calls. Note that this test's
// success depends on our Template having the original order (as it does in an unconfigured ORA problem)
// of TRAINING -> PEER -> SELF -> AI
// The Peer and Self Editor ID's
var peerID = "oa_peer_assessment_editor";
var selfID = "oa_self_assessment_editor";
......
......@@ -85,33 +85,38 @@ OpenAssessment.StudioView.prototype = {
Installs click listeners which initialize drag and drop functionality for assessment modules.
**/
initializeSortableAssessments: function () {
var liveElement = this.liveElement;
var view = this;
// Initialize Drag and Drop of Assessment Modules
$('#openassessment_assessment_module_settings_editors', liveElement).sortable({
$('#openassessment_assessment_module_settings_editors', view.element).sortable({
// On Start, we want to collapse all draggable items so that dragging is visually simple (no scrolling)
start: function(event, ui) {
// Hide all of the contents (not the headers) of the divs, to collapse during dragging.
$('.openassessment_assessment_module_editor', liveElement).hide();
$('.openassessment_assessment_module_editor', view.element).hide();
// Because of the way that JQuery actively resizes elements during dragging (directly setting
// the style property), the only way to over come it is to use an important tag ( :( ), or
// to tell JQuery to set the height to be Automatic (i.e. resize to the minimum nescesary size.)
// Because all of the information we don't want displayed is now hidden, an auto height will
// perform the apparent "collapse" that we are looking for in the Placeholder and Helper.
var targetHeight = 'auto';
// Shrink the blank area behind the dragged item.
ui.placeholder.height(targetHeight);
// Shrink the dragged item itself.
ui.helper.height(targetHeight);
// Update the sortable
$('#openassessment_assessment_module_settings_editors', liveElement)
// Update the sortable to reflect these changes.
$('#openassessment_assessment_module_settings_editors', view.element)
.sortable('refresh').sortable('refreshPositions');
},
// On stop, we redisplay the divs to their original state
stop: function(event, ui){
$('.openassessment_assessment_module_editor', liveElement).show();
$('.openassessment_assessment_module_editor', view.element).show();
},
snap: true,
axis: "y",
handle: ".drag-handle",
cursorAt: {top: 20}
});
$('#openassessment_assessment_module_settings_editors', liveElement).disableSelection();
$('#openassessment_assessment_module_settings_editors', view.element).disableSelection();
},
/**
......
......@@ -11,8 +11,7 @@ Returns:
**/
OpenAssessment.EditSettingsView = function(element, assessmentViews) {
this.settingsElement = element;
this.assessmentsElement = $('#openassessment_assessment_module_settings_editors',
$(element).closest('#oa_settings_editor_wrapper'));
this.assessmentsElement = $(element).siblings('#openassessment_assessment_module_settings_editors').get(0);
this.assessmentViews = assessmentViews;
};
......
......@@ -19,5 +19,5 @@ if [[ -n "$DEBUG_JS" ]]; then
UGLIFY_EXTRA_ARGS="--beautify"
fi
node_modules/.bin/uglifyjs $STATIC_JS/src/oa_shared.js $STATIC_JS/src/lms/*.js $UGLIFY_EXTRA_ARGS > "$STATIC_JS/openassessment-lms.min.js"
node_modules/.bin/uglifyjs $STATIC_JS/src/oa_shared.js $STATIC_JS/src/studio/*.js $UGLIFY_EXTRA_ARGS > "$STATIC_JS/openassessment-studio.min.js"
node_modules/.bin/uglifyjs $STATIC_JS/src/oa_shared.js $STATIC_JS/src/*.js $STATIC_JS/src/lms/*.js $UGLIFY_EXTRA_ARGS > "$STATIC_JS/openassessment-lms.min.js"
node_modules/.bin/uglifyjs $STATIC_JS/src/oa_shared.js $STATIC_JS/src/*.js $STATIC_JS/src/studio/*.js $UGLIFY_EXTRA_ARGS > "$STATIC_JS/openassessment-studio.min.js"
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