Commit 58e51cdd by solashirai

fixed naming

parent 8e8e4dd6
......@@ -15,7 +15,7 @@
This is the element of the problem for which the hinter is working. This is the "data-usage-id" of the problem block. It should look something like i4x://edX/DemoX/problem/f958789435cf47218ff32f0d600f1184
</p>
<p>
Problem Element: <textarea type="text" class="csh_hinting_element" value = "{{hinting_element}}"/>
Target Problem: <textarea type="text" class="csh_target_problem" value = "{{target_problem}}"/>
</p>
<p>
<input type="button" class="csh_apply_settings" value="Apply Settings">
......
......@@ -88,7 +88,7 @@ function CrowdsourceHinter(runtime, element, data){
/**
* Set the target problem for which to listen for the problem_graded event. Set target to first
* problem block if no hinting element has been manually entered.
* problem block if no target element has been manually entered.
*/
if(data.target_problem == undefined || data.target_problem == ''){
//contains workaround because the data-usage-id shows up with ";_" in place of "/" in lms
......
......@@ -3,27 +3,27 @@ function CrowdsourceHinterStudio(runtime, element, data){
//set text area values to be what is currently in the hinter. to be replaced by above code.
$('.csh_initial_hints', element).val(data.initial);
$('.csh_generic_hints', element).val(data.generic);
$('.csh_hinting_element', element).val(data.element);
$('.csh_target_problem', element).val(data.target_problem);
/**
* Apply settings for initial hints, generic hints, and the element for which the hinter is
* working.
*/
function apply_settings(){ return function(apply_settings_button){
var initial = unescape($('.csh_initial_hints').val());
var generic = unescape($('.csh_generic_hints').val());
var hinting_element = unescape($('.csh_hinting_element').val());
var initial = $('.csh_initial_hints').val();
var generic = $('.csh_generic_hints').val();
var target_problem = $('.csh_target_problem').val();
$.ajax({
type: "POST",
url: runtime.handlerUrl(element, 'set_initial_settings'),
data: JSON.stringify({"initial_hints": initial, "generic_hints": generic, "element": hinting_element}),
data: JSON.stringify({"initial_hints": initial, "generic_hints": generic, "target_problem": target_problem}),
success: function(result){
if(result.success){
$('.csh_check_success', element).text('hints successfully added to the database');
} else {
$('.csh_check_success', element).text('there was a problem adding your hints to the database. check the format on your hints.');
}
Logger.log('crowd_hinter.staff_edit_hinter', {"generic_hints": generic, "initial_hint": initial, "element": hinting_element, "successfully_set_hints": result.success});
Logger.log('crowd_hinter.staff_edit_hinter', {"generic_hints": generic, "initial_hint": initial, "target_problem": target_problem, "successfully_set_hints": result.success});
}
});
}}
......
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