Commit 5d6bcbbe by Will Daly

Move JS server object into a common directory so it's shared with LMS and Studio

parent 3e3cef09
......@@ -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'
},
......
/**
Interface for server-side XBlock handlers.
Encapsulate interactions with OpenAssessment XBlock handlers.
**/
// Since the server is included by both LMS and Studio views,
// skip loading it the second time.
if (typeof OpenAssessment.Server == "undefined" || !OpenAssessment.Server) {
/**
Interface for server-side XBlock handlers.
Args:
Args:
runtime (Runtime): An XBlock runtime instance.
element (DOM element): The DOM element representing this XBlock.
Returns:
Returns:
OpenAssessment.Server
**/
OpenAssessment.Server = function(runtime, element) {
**/
OpenAssessment.Server = function(runtime, element) {
this.runtime = runtime;
this.element = element;
};
};
OpenAssessment.Server.prototype = {
OpenAssessment.Server.prototype = {
/**
Construct the URL for the handler, specific to one instance of the XBlock on the page.
......@@ -463,4 +471,5 @@ OpenAssessment.Server.prototype = {
});
}).promise();
}
};
};
}
\ No newline at end of file
......@@ -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