Commit a151e638 by solashirai Committed by Piotr Mitros

various improvements, in progress

parent 0845dbdf
...@@ -19,13 +19,14 @@ ...@@ -19,13 +19,14 @@
.csh_hint_reveal{ .csh_hint_reveal{
display: flex; display: flex;
flex-direction: column; flex-direction: row;
justify-content: space-between;
} }
.csh_hint_rating_on_incorrect{ .csh_hint_rating_on_incorrect{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-end; justify-content: space-between;
} }
.csh_hint_data{ .csh_hint_data{
...@@ -40,9 +41,8 @@ ...@@ -40,9 +41,8 @@
} }
.csh_rate_hint, .csh_report_hint, .csh_rate_hint_completed, .csh_rate_hint_text { .csh_rate_hint, .csh_report_hint, .csh_rate_hint_completed, .csh_rate_hint_text {
margin-right: 15px;
margin-top: 5px;
align-self: flex-end; align-self: flex-end;
margin-left: 10px;
} }
div[data-rate="report"]{ div[data-rate="report"]{
......
...@@ -66,16 +66,16 @@ ...@@ -66,16 +66,16 @@
</div> </div>
<div class='csh_hint_rating_on_incorrect'> <div class='csh_hint_rating_on_incorrect'>
<div class="csh_rate_hint_text"> <div class="csh_rate_hint_text">
Rate this hint: Rate this hint:
</div> </div>
<div role="button" class="csh_rate_hint" data-rate="upvote" title="This hint was helpful!"> <div role="button" class="csh_rate_hint" data-rate="upvote" title="This hint was helpful!">
<b>Helpful</b> <b> Helpful </b>
</div> </div>
<div role="button" class="csh_rate_hint" data-rate="downvote" title="This hint was not very helpful."> <div role="button" class="csh_rate_hint" data-rate="downvote" title="This hint was not very helpful.">
<b>Unhelpful</b> <b> Unhelpful </b>
</div> </div>
<div role="button" class="csh_report_hint" title="Report this hint"> <div role="button" class="csh_report_hint" title="Report this hint">
<b></b> <b></b>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -78,8 +78,7 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -78,8 +78,7 @@ function CrowdsourceHinter(runtime, element, data){
* @param data is generated by problem_graded event, contains status and data of the problem block * @param data is generated by problem_graded event, contains status and data of the problem block
*/ */
function onStudentSubmission(){ return function(event_type, data, element){ function onStudentSubmission(){ return function(event_type, data, element){
//search method of correctness of problem is brittle due to checking for a class within //search method of correctness of problem is brittle
//the problem block.
if (checkIsAnswerCorrect(data)){ if (checkIsAnswerCorrect(data)){
startHintRating(); startHintRating();
} else { //if the submitted answer is incorrect } else { //if the submitted answer is incorrect
...@@ -112,6 +111,7 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -112,6 +111,7 @@ function CrowdsourceHinter(runtime, element, data){
$('.csh_answer_text', element).append(hintRatingUXTemplate); $('.csh_answer_text', element).append(hintRatingUXTemplate);
var hintCreationTemplate = $(Mustache.render($('#add_hint_creation').html(), {})); var hintCreationTemplate = $(Mustache.render($('#add_hint_creation').html(), {}));
$('.csh_answer_text', element).append(hintCreationTemplate); $('.csh_answer_text', element).append(hintCreationTemplate);
Logger.log("crowd_hinter.hint_rating_UX", {"hint": hint, "student_answer": student_answer});
} }
/** /**
...@@ -166,6 +166,7 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -166,6 +166,7 @@ function CrowdsourceHinter(runtime, element, data){
$('.csh_student_answer', element).append(noHintsTemplate); $('.csh_student_answer', element).append(noHintsTemplate);
var hintCreationTemplate = $(Mustache.render($('#add_hint_creation').html(), {})); var hintCreationTemplate = $(Mustache.render($('#add_hint_creation').html(), {}));
$('.csh_student_answer', element).append(hintCreationTemplate); $('.csh_student_answer', element).append(hintCreationTemplate);
Logger.log("crowd_hinter.hint_rating_UX", {"hint": "null", "student_answer": student_answer});
} else { } else {
showStudentHintRatingUX(hint, student_answer); showStudentHintRatingUX(hint, student_answer);
} }
...@@ -209,7 +210,7 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -209,7 +210,7 @@ function CrowdsourceHinter(runtime, element, data){
url: runtime.handlerUrl(element, 'add_new_hint'), url: runtime.handlerUrl(element, 'add_new_hint'),
data: JSON.stringify({"submission": newHint, "answer": studentAnswer}), data: JSON.stringify({"submission": newHint, "answer": studentAnswer}),
success: function() { success: function() {
Logger.log('crowd_hinter.submit_new.click.event', {"student_answer": studentAnswer, "new_hint_submission": newHint}) Logger.log('crowd_hinter.submit_new_hint', {"student_answer": studentAnswer, "new_hint_submission": newHint})
} }
}); });
$('.csh_student_text_input', element).remove(); $('.csh_student_text_input', element).remove();
......
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