Commit 41fb5594 by Sola

latest changes

parent efda9c97
......@@ -13,7 +13,7 @@ log = logging.getLogger(__name__)
#get_hint and get_feedback are in
class CrowdXBlock(XBlock):
correctanswer = String(default="42", scope=Scope.content) #should be irrelevant for completed version
hints = Dict(default={"2": {"hint1for2":0, "hint2for2":0, "hint3for2":0}, "1": {"hint1for1":0, "hint2for1":0, "hint3for1":0}, "3": {"hint1for3":0, "hint2for3":0, "hint3for3":0}}, scope=Scope.content)
hints = Dict(default={"2": {"hint6for2":0, "hint5for2":0, "hint4for2":0, "hint1for2":0, "hint2for2":0, "hint3for2":0}, "1": {"hint1for1":0, "hint2for1":0, "hint3for1":0}, "3": {"hint1for3":0, "hint2for3":0, "hint3for3":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
......
......@@ -67,7 +67,7 @@ class CrowdXBlock(XBlock):
while NotUsed in self.Used:
NotUsed = random.choice(self.HintsToUse.keys()) #Choose random hint that hasn't already been Used
elif len(self.Used) > 0:
return
return {'HintsToUse': random.choice(self.HintsToUse.keys())}
self.Used.append(NotUsed)
return {'HintsToUse': NotUsed} #note to self dont let python get into endless notused loop
......
......@@ -33,7 +33,7 @@
background: rgb(230, 250,230);
}
.crowdxblock_block .hintsarea {
width: 300px;
width: 600px;
padding: 10px;
border: 5px solid gray;
margin: 0px;
......
......@@ -33,7 +33,7 @@
background: rgb(230, 250,230);
}
.crowdxblock_block .hintsarea {
width: 220px;
width: 300px;
padding: 10px;
border: 5px solid gray;
margin: 0px;
......
......@@ -9,6 +9,11 @@
answers = data[0];
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?
function CrowdXBlock(runtime, element){
var WrongAnswer = [];
var HintUsed = [];
......
......@@ -9,6 +9,11 @@
answers = data[0];
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?
function CrowdXBlock(runtime, element){
var WrongAnswer = [];
var HintUsed = [];
......@@ -31,7 +36,7 @@ function CrowdXBlock(runtime, element){
$.each(result, function(index, value) {
console.log( index + ": " + value );
if($("#submit"+value).length == 0){
$('.hintansarea').append("<p id=\"submit" + value + "\"> class=\"hintsarea\" </p>");
$('.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>");
});
......
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