correctanswer=String(default="2.0",scope=Scope.content)#should be irrelevant for completed version
hints=Dict(default={"2":{"Keep significant figures in mind.":1,"So close yet so far.":0,"Try adding a .0.":0},"8.6":{"You might have added all of the horizontal forces together to equal a total of 21 for the horizontal component of this object's force; the two forces are facing opposite direction, so you need to subtract them.":1,"Try 12-9 for the total horizontal force.":0},"1.2":{"Did you remember to add in the vertical component of force for this object?":0},"1.0":{"dummy hint for debugs":0},"one":{"dummy hint again for debugs":0}},scope=Scope.content)
#All hints. sorted by type of mistake. type_of_incorrect_answer{"hint":rating, "hint":rating}
HintsToUse=Dict(default={},scope=Scope.user_state)#Dict of hints to provide user
WrongAnswers=List(default=[],scope=Scope.user_state)#List of mistakes made by user
DefaultHints=Dict(default={"defaulthint1":0,"defaulthint2":0,"defaulthint3":0,"defaulthint4":0,"defaulthint5":0,"bestdefaulthint":3},scope=Scope.content)#Default hints in case no incorrect answers in hints match the user's mistake
DefaultHints=Dict(default={"Start with the equation F=ma":2,"This object has horizontal and vertical components of force. Solve for the total force in each direction, then compare it to the final acceleration":1,"A small example: If an object has a force of 10N applied to it in an upward direction and it's acceleration is 1m/s^2, the mass of that object is 10.0 kg. F=ma, 10N=m*(1m/s^2), m=10/1, m=10.":1},scope=Scope.content)#Default hints in case no incorrect answers in hints match the user's mistake
Used=List(default=[],scope=Scope.user_state)#List of used hints from HintsToUse
correctanswer = String(default="2.0", scope=Scope.content) #should be irrelevant for completed version
hints = Dict(default={"2": {"Keep significant figures in mind.":1, "So close yet so far.":0, "Try adding a .0.":0}, "8.6": {"You might have added all of the horizontal forces together to equal a total of 21 for the horizontal component of this object's force; the two forces are facing opposite direction, so you need to subtract them.":1, "Try 12-9 for the total horizontal force.":0}, "1.2": {"Did you remember to add in the vertical component of force for this object?":0},"1.0":{"dummy hint for debugs":0}, "one":{"dummy hint again for debugs":0}}, scope=Scope.content)
#All hints. sorted by type of mistake. type_of_incorrect_answer{"hint":rating, "hint":rating}
HintsToUse = Dict(default={}, scope=Scope.user_state) #Dict of hints to provide user
WrongAnswers = List(default=[], scope=Scope.user_state) #List of mistakes made by user
DefaultHints = Dict(default={"defaulthint1": 0, "defaulthint2": 0, "defaulthint3": 0, "defaulthint4": 0, "defaulthint5": 0, "bestdefaulthint": 3}, scope=Scope.content) #Default hints in case no incorrect answers in hints match the user's mistake
DefaultHints = Dict(default={"Start with the equation F=ma":2, "This object has horizontal and vertical components of force. Solve for the total force in each direction, then compare it to the final acceleration":1, "A small example: If an object has a force of 10N applied to it in an upward direction and it's acceleration is 1m/s^2, the mass of that object is 10.0 kg. F=ma, 10N=m*(1m/s^2), m=10/1, m=10.":1}, scope=Scope.content) #Default hints in case no incorrect answers in hints match the user's mistake
Used = List(default=[], scope=Scope.user_state)#List of used hints from HintsToUse
$('#submit'+value).append("For your incorrect answer of:"+" "+value+" <p id=\"hintstoshow"+value+"\"> The following hints exist: </p><p> <input id=\""+index+"\" type=\"button\" class=\"submitbutton\" value=\"Submit a hint for this problem\">");
}$('#hintstoshow'+value).append("<p>"+index+"<input data-value=\""+value+"\" id=\""+index+"\" type=\"button\" class=\"hintbutton\" value=\"Upvote this Hint\"></p>");
$('#submit'+value).append("For your incorrect answer of:"+" "+value+" <p id=\"hintstoshow"+value+"\"> The following hints exist: </p><p> <input id=\""+index+"\" type=\"button\" class=\"submitbutton\" value=\"Submit a hint for this problem\">");
}
$('#hintstoshow'+value).append("<p>"+index+"<input data-value=\""+value+"\" id=\""+index+"\" type=\"button\" class=\"hintbutton\" value=\"Upvote this Hint\"></p>");
response = data[1];*/ //use this snippet for actual code? maybe?
//**FOR CHECKING ANSWER CORRECT/NOT**
//check for event problem_check
//Check for success == "incorrect" or success == "correct" to determine? I think?
var answers, response,
_this = this;
answers = data[0];
response = data[1];*/ //use this snippet for actual code? maybe?
function CrowdXBlock(runtime, element){
var WrongAnswer = [];
...
...
@@ -30,11 +25,14 @@ function CrowdXBlock(runtime, element){
$(".problem").show();
$("#feedback").show();
$.each(result, function(index, value) {
console.log( index + ": " + value );
console.log("the type of value is" + ' '+ typeof(value));
if($("#submit"+value).length == 0){
$('.hintansarea').append("<p id=\"submit" + value + "\" class=\"hintsarea\"> </p>");
console.log('hintsarea made for ' + value);
$('#submit'+value).append("For your incorrect answer of:" + " " + value + " <p id=\"hintstoshow" + value + "\"> The following hints exist: </p><p> <input id=\"" + index + "\" type=\"button\" class=\"submitbutton\" value=\"Submit a hint for this problem\">");
}$('#hintstoshow'+value).append("<p>" + index + "<input data-value=\"" + value + "\" id=\"" + index + "\" type=\"button\" class=\"hintbutton\" value=\"Upvote this Hint\"></p>");
}
$('#hintstoshow'+value).append("<p>" + index + "<input data-value=\"" + value + "\" id=\"" + index + "\" type=\"button\" class=\"hintbutton\" value=\"Upvote this Hint\"></p>");
console.log("the value is " + value);
});
};
...
...
@@ -66,7 +64,7 @@ function CrowdXBlock(runtime, element){
$("#answer").val('');})
$('#caus', element).click(function(eventObject) {
console.debug("ca working");
console.debug("ca working this is edited");
$.ajax({
type: "POST",
url: runtime.handlerUrl(element, 'clear_states'),
...
...
@@ -90,7 +88,7 @@ function CrowdXBlock(runtime, element){
function checkreply(result){
if(result.correct == 1){
if(result.correct == 1){
console.debug("yay");
$('.correct', element).show();
$('.correct', element).text("You're correct! Please choose the best hint, or provide us with one of your own!");
...
...
@@ -115,13 +113,13 @@ function CrowdXBlock(runtime, element){
});
$("#studentsubmit").val('');
/* } else { //answer is correct
$('.correct', element).text("You're correct! Please choose the best hint, or provide us with one of your own!");
$.ajax({
type: "POST",
url: runtime.handlerUrl(element, 'get_feedback'),
data: JSON.stringify({"hello": "world"}),
success: getfeedback
});
};*/
$('.correct', element).text("You're correct! Please choose the best hint, or provide us with one of your own!");