Commit 0be2bc41 by solashirai Committed by Piotr Mitros

changed "flagged" to "reported"

parent 6930813b
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
align-self: flex-end; align-self: flex-end;
} }
div[data-rate="flag"]{ div[data-rate="report"]{
font-weight: bold; font-weight: bold;
} }
...@@ -69,15 +69,15 @@ div[data-rate="downvote"] { ...@@ -69,15 +69,15 @@ div[data-rate="downvote"] {
font-weight: bold; font-weight: bold;
} }
.csh_flagged_hints { .csh_reported_hints {
background-color: red; background-color: red;
} }
.crowdsourcehinter_block .csh_flagged_hints { .crowdsourcehinter_block .csh_reported_hints {
visibility: hidden; visibility: hidden;
display: none; display: none;
} }
.crowdsourcehinter_block_is_staff .csh_flagged_hints { .crowdsourcehinter_block_is_staff .csh_reported_hints {
visibility: visible; visibility: visible;
} }
......
...@@ -10,17 +10,17 @@ ...@@ -10,17 +10,17 @@
<div role="button" class="csh_rate_hint" data-rate="downvote"> <div role="button" class="csh_rate_hint" data-rate="downvote">
<b>Rate as Unhelpful</b> <b>Rate as Unhelpful</b>
</div> </div>
<div role="button" class="csh_rate_hint" data-rate="flag" data-icon="flag" title="Report this hint."> <div role="button" class="csh_rate_hint" data-rate="report" data-icon="report" title="Report this hint.">
<b></b> <b></b>
</div> </div>
</div> </div>
</div> </div>
</script> </script>
<script type="x-tmpl/mustache" id="show_flagged_feedback"> <script type="x-tmpl/mustache" id="show_reported_feedback">
<div class="csh_hint_value" value ="{{hint}}"> <div class="csh_hint_value" value ="{{hint}}">
<div class="csh_hint">{{hint}}</div> <div class="csh_hint">{{hint}}</div>
<div role="button" class="csh_staff_rate" data-rate="unflag" aria-label="unflag"> <div role="button" class="csh_staff_rate" data-rate="unreport" aria-label="unreport">
<u><b>Return hint for use in the hinter</b></u> <u><b>Return hint for use in the hinter</b></u>
</div> </div>
<div role="button" class="csh_staff_rate" data-rate="remove" aria-label="remove"> <div role="button" class="csh_staff_rate" data-rate="remove" aria-label="remove">
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<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>-</b> <b>-</b>
</div> </div>
<div role="button" class="csh_rate_hint" data-rate="flag" title="Report this hint"> <div role="button" class="csh_rate_hint" data-rate="report" title="Report this hint">
<b></b> <b></b>
</div> </div>
</div> </div>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<span class='Thankyou'></span> <span class='Thankyou'></span>
</p> </p>
<div class="csh_feedback"> <div class="csh_feedback">
<div class="csh_flagged_hints"> <div class="csh_reported_hints">
<span>moderate reported hints</span> <span>moderate reported hints</span>
</div> </div>
</div> </div>
......
...@@ -80,7 +80,7 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -80,7 +80,7 @@ function CrowdsourceHinter(runtime, element, data){
function showHintFeedback(hint, student_answer){ function showHintFeedback(hint, student_answer){
//Append answer-specific hints for each student answer during the feedback stage. //Append answer-specific hints for each student answer during the feedback stage.
//This appended div includes upvote/downvote/flagging buttons, the hint, and the hint's rating //This appended div includes upvote/downvote/reporting buttons, the hint, and the hint's rating
$(".csh_student_answer", element).each(function(){ $(".csh_student_answer", element).each(function(){
if ($(this).find('.csh_answer_text').attr('answer') == student_answer){ if ($(this).find('.csh_answer_text').attr('answer') == student_answer){
var html = ""; var html = "";
...@@ -100,17 +100,17 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -100,17 +100,17 @@ function CrowdsourceHinter(runtime, element, data){
}); });
} }
function showFlaggedFeedback(result){ function showReportedFeedback(result){
//For staff use, shows hints that have been flagged by students and allows for the hints' unflagging/removal. //For staff use, shows hints that have been reporteded by students and allows for the hints' unreporting/removal.
var html = ""; var html = "";
$(function(){ $(function(){
var template = $('#show_flagged_feedback').html(); var template = $('#show_reported_feedback').html();
var data = { var data = {
hint: result hint: result
}; };
html = Mustache.render(template, data); html = Mustache.render(template, data);
}); });
$(".csh_flagged_hints", element).append(html); $(".csh_reported_hints", element).append(html);
} }
function setStudentAnswers(student_answers){ function setStudentAnswers(student_answers){
...@@ -131,15 +131,15 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -131,15 +131,15 @@ function CrowdsourceHinter(runtime, element, data){
if(isStaff){ if(isStaff){
$('.crowdsourcehinter_block', element).attr('class', 'crowdsourcehinter_block_is_staff'); $('.crowdsourcehinter_block', element).attr('class', 'crowdsourcehinter_block_is_staff');
$.each(result, function(index, value) { $.each(result, function(index, value) {
if(value == "Flagged") { if(value == "Reported") {
//index represents the flagged hint's text //index represents the reported hint's text
showFlaggedFeedback(index); showReportedFeedback(index);
} }
}); });
} }
if(!isShowingHintFeedback){ if(!isShowingHintFeedback){
$.each(result, function(index, value) { $.each(result, function(index, value) {
if(value != "Flagged"){ if(value != "Reported"){
setStudentAnswers(value); setStudentAnswers(value);
student_answer = value; student_answer = value;
hint = index; hint = index;
...@@ -160,7 +160,7 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -160,7 +160,7 @@ function CrowdsourceHinter(runtime, element, data){
} }
}); });
} }
//flagged hints have their corresponding answer set to "Flagged" //reported hints have their corresponding answer set to "Reported"
else{ else{
showHintFeedback(hint, student_answer); showHintFeedback(hint, student_answer);
} }
...@@ -201,7 +201,7 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -201,7 +201,7 @@ function CrowdsourceHinter(runtime, element, data){
$('.csh_submitbutton', element).show(); $('.csh_submitbutton', element).show();
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: runtime.handlerUrl(element, 'give_hint'), url: runtime.handlerUrl(element, 'add_new_hint'),
data: JSON.stringify({"submission": newhint, "answer": answerdata}), data: JSON.stringify({"submission": newhint, "answer": answerdata}),
success: function(result){ success: function(result){
$.ajax({ $.ajax({
...@@ -218,8 +218,8 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -218,8 +218,8 @@ function CrowdsourceHinter(runtime, element, data){
}) })
$(element).on('click', '.csh_rate_hint', function(){ $(element).on('click', '.csh_rate_hint', function(){
if ($(this).attr('data-rate') == "flag"){ if ($(this).attr('data-rate') == "report"){
alert("This hint has been flagged for review."); alert("This hint has been reported for review.");
} }
hint = $('.csh_HintsToUse', element).attr('hint_received'); hint = $('.csh_HintsToUse', element).attr('hint_received');
student_answer = $('.csh_HintsToUse', element).attr('student_answer'); student_answer = $('.csh_HintsToUse', element).attr('student_answer');
...@@ -233,10 +233,10 @@ function CrowdsourceHinter(runtime, element, data){ ...@@ -233,10 +233,10 @@ function CrowdsourceHinter(runtime, element, data){
}); });
$(element).on('click', '.csh_staff_rate', function(){ $(element).on('click', '.csh_staff_rate', function(){
//Staff ratings are the removal or unflagging of flagged hints from the database. The attribute 'data-rate' is used //Staff ratings are the removal or unreporting of reported hints from the database. The attribute 'data-rate' is used
//to determine whether to unflag or delete the hint. //to determine whether to unreport or delete the hint.
hint = $(this).parent().find(".csh_hint").text(); hint = $(this).parent().find(".csh_hint").text();
student_answer = "Flagged"; student_answer = "Reported";
Logger.log('crowd_hinter.staff_rate_hint.click.event', {"hint": hint, "student_answer": student_answer, "rating": $(this).attr('data-rate')}); Logger.log('crowd_hinter.staff_rate_hint.click.event', {"hint": hint, "student_answer": student_answer, "rating": $(this).attr('data-rate')});
$.ajax({ $.ajax({
type: "POST", type: "POST",
......
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