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 = [];
...
...
@@ -28,100 +23,103 @@ function CrowdXBlock(runtime, element){
function getfeedback(result){
$("#answer").show();
$(".problem").show();
$("#feedback").show();
$.each(result, function(index, value) {
console.log( index + ": " + value );
$("#feedback").show();
$.each(result, function(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>");
$('#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>");
});
$('.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>");