Commit 01678c3b by Valera Rozuvan

Merge pull request #70 from edx/valera/gst_fixes_hsph

GST fixes
parents 13fa5512 d9651d74
......@@ -98,8 +98,10 @@ define('ElOutput', ['logme'], function (logme) {
);
logme('Error message: "' + err.message + '".');
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not create a function from string "' + funcString + '".' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
if (state.showDebugInfo) {
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not create a function from string "' + funcString + '".' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
}
paramNames.pop();
......
......@@ -87,8 +87,10 @@ define('GLabelElOutput', ['logme'], function (logme) {
);
logme('Error message: "' + err.message + '".');
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not create a function from string "' + funcString + '".' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
if (state.showDebugInfo) {
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not create a function from string "' + funcString + '".' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
}
paramNames.pop();
......
......@@ -242,8 +242,10 @@ define('Graph', ['logme'], function (logme) {
);
logme('Error message: "' + err.message + '"');
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not create a function from the string "' + funcString + '".' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
if (state.showDebugInfo) {
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not create a function from the string "' + funcString + '".' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
}
paramNames.pop();
......@@ -709,15 +711,17 @@ define('Graph', ['logme'], function (logme) {
);
logme('Error message: "' + err.message + '"');
$('#' + gstId).html(
'<div style="color: red;">' + 'ERROR IN ' +
'XML: Could not create a function from the string "' +
funcString + '" for xrange.min.' + '</div>'
);
$('#' + gstId).append(
'<div style="color: red;">' + 'Error ' +
'message: "' + err.message + '".' + '</div>'
);
if (state.showDebugInfo) {
$('#' + gstId).html(
'<div style="color: red;">' + 'ERROR IN ' +
'XML: Could not create a function from the string "' +
funcString + '" for xrange.min.' + '</div>'
);
$('#' + gstId).append(
'<div style="color: red;">' + 'Error ' +
'message: "' + err.message + '".' + '</div>'
);
}
return false;
}
......@@ -790,15 +794,17 @@ define('Graph', ['logme'], function (logme) {
);
logme('Error message: "' + err.message + '"');
$('#' + gstId).html(
'<div style="color: red;">' + 'ERROR IN ' +
'XML: Could not create a function from the string "' +
funcString + '" for xrange.max.' + '</div>'
);
$('#' + gstId).append(
'<div style="color: red;">' + 'Error message: "' +
err.message + '".' + '</div>'
);
if (state.showDebugInfo) {
$('#' + gstId).html(
'<div style="color: red;">' + 'ERROR IN ' +
'XML: Could not create a function from the string "' +
funcString + '" for xrange.max.' + '</div>'
);
$('#' + gstId).append(
'<div style="color: red;">' + 'Error message: "' +
err.message + '".' + '</div>'
);
}
return false;
}
......@@ -1006,8 +1012,10 @@ define('Graph', ['logme'], function (logme) {
);
logme('Error message: "' + err.message + '"');
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not create a function from the string "' + funcString + '".' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
if (state.showDebugInfo) {
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not create a function from the string "' + funcString + '".' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
}
paramNames.pop();
paramNames.pop();
......@@ -1133,8 +1141,10 @@ define('Graph', ['logme'], function (logme) {
logme('ERROR: Could not determine xrange start.');
logme('Error message: "' + err.message + '".');
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not determine xrange start from defined function.' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
if (state.showDebugInfo) {
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not determine xrange start from defined function.' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
}
return false;
}
......@@ -1144,8 +1154,10 @@ define('Graph', ['logme'], function (logme) {
logme('ERROR: Could not determine xrange end.');
logme('Error message: "' + err.message + '".');
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not determine xrange end from defined function.' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
if (state.showDebugInfo) {
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not determine xrange end from defined function.' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
}
return false;
}
......@@ -1175,8 +1187,10 @@ define('Graph', ['logme'], function (logme) {
logme('ERROR: Could not generate data.');
logme('Error message: "' + err.message + '".');
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not generate data from defined function.' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
if (state.showDebugInfo) {
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not generate data from defined function.' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
}
return false;
}
......@@ -1204,8 +1218,10 @@ define('Graph', ['logme'], function (logme) {
logme('ERROR: Could not generate data.');
logme('Error message: "' + err.message + '".');
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not generate data from function.' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
if (state.showDebugInfo) {
$('#' + gstId).html('<div style="color: red;">' + 'ERROR IN XML: Could not generate data from function.' + '</div>');
$('#' + gstId).append('<div style="color: red;">' + 'Error message: "' + err.message + '".' + '</div>');
}
return false;
}
......
......@@ -51,6 +51,8 @@ define(
// state object.
state = State(gstId, config);
state.showDebugInfo = false;
// It is possible that something goes wrong while extracting parameters
// from the JSON config object. In this case, we will not continue.
if (state === undefined) {
......
## The JS for this is defined in xqa_interface.html
${module_content}
%if location.category in ['problem','video','html','combinedopenended']:
%if location.category in ['problem','video','html','combinedopenended','graphical_slider_tool']:
% if edit_link:
<div>
<a href="${edit_link}">Edit</a>
......
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