Commit ca933c70 by Sola

changes made to how answer/hints show up (rating changes to be made)

parent b212766f
...@@ -52,14 +52,15 @@ function CrowdXBlock(runtime, element){ ...@@ -52,14 +52,15 @@ function CrowdXBlock(runtime, element){
} }
function getfeedback(result){ function getfeedback(result){
howmany = result; $('.WrongAnswer0', element).text("For your incorrect answer of: " + result.wngans0);
console.log(howmany); $('.HintUsed0', element).text("You recieved the hint: " + result.hntusd0);
$.ajax({ $('.WrongAnswer1', element).text("For your incorrect answer of: " + result.wngans1);
type: "POST", $('.HintUsed1', element).text("You recieved the hint: " + result.hntusd1);
url: runtime.handlerUrl(element, 'get_data'), $('.WrongAnswer2', element).text("For your incorrect answer of: " + result.wngans2);
data: JSON.stringify({"ansnum": whichanswer}), $('.HintUsed2', element).text("You recieved the hint: " + result.hntusd2);
success: morefeedback $('.WrongAnswer3', element).text("For your incorrect answer of: " + result.wngans3);
}); $('.HintUsed3', element).text("You recieved the hint: " + result.hntusd3);
} }
function morefeedback(result){ function morefeedback(result){
...@@ -112,7 +113,7 @@ function CrowdXBlock(runtime, element){ ...@@ -112,7 +113,7 @@ function CrowdXBlock(runtime, element){
$('p', element).click(function(eventObject) { //for test $('p', element).click(function(eventObject) { //for test
a += 1 a += 1
if (a != 5) { //when answer is incorrect /*response.search(/class="correct/) === -1*/ if (a != 4) { //when answer is incorrect /*response.search(/class="correct/) === -1*/
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: runtime.handlerUrl(element, 'get_hint'), url: runtime.handlerUrl(element, 'get_hint'),
......
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