Commit 0fc3ad5c by Braden MacDonald

Fix: Checkmark not shown if answer name is numeric

parent 83ae2b7a
......@@ -106,7 +106,7 @@ function MentoringBlock(runtime, element) {
function getChildByName(name) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child && child.name === name) {
if (child && child.name.toString() === name) {
return child;
}
}
......
......@@ -196,7 +196,7 @@ function MentoringAssessmentView(runtime, element, mentoring) {
if (fire_event) {
mentoring.publish_event({
event_type: 'xblock.problem_builder.assessment.shown',
exercise_id: child.name
exercise_id: child.name.toString()
});
}
}
......@@ -291,7 +291,7 @@ function MentoringAssessmentView(runtime, element, mentoring) {
var data = {};
var child = mentoring.steps[active_child];
if (child && child.name !== undefined) {
data[child.name] = callIfExists(child, handler_name);
data[child.name.toString()] = callIfExists(child, handler_name);
}
var handlerUrl = runtime.handlerUrl(element, handler_name);
if (submitXHR) {
......
......@@ -38,7 +38,7 @@ function MentoringStandardView(runtime, element, mentoring) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child && child.name !== undefined && typeof(child[handler_name]) !== "undefined") {
data[child.name] = child[handler_name]();
data[child.name.toString()] = child[handler_name]();
}
}
var handlerUrl = runtime.handlerUrl(element, handler_name);
......@@ -53,7 +53,7 @@ function MentoringStandardView(runtime, element, mentoring) {
}
function submit() {
calculate_results('submit')
calculate_results('submit');
}
function clearResults() {
......
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