Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
pmitros committed Jun 7, 2017
2 parents 603966a + d4c016f commit 171651d
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 34 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ The goal of this XBlock is two-fold:
Instructors have a good amount of control over the contents of
the block:

![Screenshot of the FeedbackXBlock](FeedbackXBlock.png)
![Screenshot of the FeedbackXBlock -- good to bad scale](happy_sad_example.png)
![Screenshot of the FeedbackXBlock -- scale where good is in the middle](happy_sad_happy_example.png)
![Screenshot of the FeedbackXBlock -- numerical scale](numerical_example.png)

This can be placed anywhere in the courseware, and students can
provide feedback on those sections. With just a few database queries,
Expand Down
5 changes: 3 additions & 2 deletions feedback/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
DEFAULT_ICON = "face"
DEFAULT_SCALETEXT = ["Excellent", "Good", "Average", "Fair", "Poor"]

ICON_SETS = {'face': u"😁😊😐😞😭",
# Unicode alt faces are cute, but we do nulls instead for a11y.
ICON_SETS = {'face': [""]*5, # u"😁😊😐😞😭",
'num': u"12345",
'midface': u"😞😐😊😐😞"}
'midface': [""]*5} #u"😞😐😊😐😞"}


@XBlock.needs('i18n')
Expand Down
2 changes: 1 addition & 1 deletion feedback/static/html/feedback.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<label class="feedback_header" for="feedback_freeform_textarea">{freeform_prompt}</label>
</div>
<div class="feedback_freeform_input">
<textarea id="feedback_freeform_textarea" class="feedback_freeform_area" rows="6" cols="45" placeholder="{placeholder}">{self.user_freeform}</textarea>
<textarea name="feedback_freeform_textarea" class="feedback_freeform_area" rows="6" cols="45" placeholder="{placeholder}">{self.user_freeform}</textarea>
<div class="feedback_thank_you" aria-live=polite>{response}</div>
</div>
<button type="submit" class="feedback_submit_feedback"> Submit Feedback </button>
Expand Down
2 changes: 1 addition & 1 deletion feedback/static/html/scale_item.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="feedback_likert_rating">
<label title="{scale_text}" class="feedback_likert_label">
<input id="radio_{idx}" name="feedback_scale" class="feedback_radio" type="radio" {active}/>
<input data-id="radio_{idx}" name="feedback_scale" class="feedback_radio" type="radio" {active}/>
<span class="feedback_icon feedback_icon_inactive">
<img src="{ina_icon}" alt="{unicode_icon}"/>
</span>
Expand Down
2 changes: 1 addition & 1 deletion feedback/static/html/staff_item.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="feedback_likert_rating">
<label title="{scale_text}" class="feedback_likert_label">
<input id="radio_{idx}" name="feedback_scale" class="feedback_radio" type="radio" {active}/>
<input data-id="radio_{idx}" name="feedback_scale" class="feedback_radio" type="radio" {active}/>
<span class="feedback_icon feedback_icon_inactive">
<img src="{ina_icon}" alt="{unicode_icon}"/>
</span>
Expand Down
61 changes: 35 additions & 26 deletions feedback/static/html/studio_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,77 +15,86 @@

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="freeform">Freeform prompt</label>
<input class="input setting-input" name="freeform" id="freeform" value="{freeform}" type="text" />
<label class="label setting-label" aria-describedby="ff_p_div">Freeform prompt
<input class="input setting-input" name="freeform" id="freeform" value="{freeform}" type="text" />
</label>
</div>
<span class="tip setting-help">Example: Please provide us feedback on this section.</span>
<span class="tip setting-help" id="ff_p_div">Example: Please provide us feedback on this section.</span>
</li>

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="placeholder">Freeform placeholder</label>
<input class="input setting-input" name="placeholder" id="placeholder" value="{placeholder}" type="text" />
<label aria-describedby="placeholder_span" class="label setting-label>"Freeform placeholder
<input class="input setting-input" name="placeholder" id="placeholder" value="{placeholder}" type="text" />
</label>
</div>
<span class="tip setting-help">This is shown as grayed out text before the student has answered.</span>
<span id="placeholder_span" class="tip setting-help">This is shown as grayed out text before the student has answered.</span>
</li>

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="icon_set">Likert icon set</label>
<label aria-describedby="icon_set_option" class="label setting-label">Likert icon set
<select name="icon_set">
<option value="face">Faces (happy to sad)</option>
<option value="midface">Faces (sad to happy to sad)</option>
<option value="num">Numeric</option></select>
</select>
</label>
</div>
<span class="tip setting-help">We can either show happy/sad faces, or numbers 1-5.</span>
<span id="icon_set_option" class="tip setting-help">We can either show happy/sad faces, or numbers 1-5.</span>
</li>

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="likert">Likert prompt</label>
<input class="input setting-input" name="likert" id="likert" value="{likert}" type="text" />
<label aria-describedby="lik_example" class="label setting-label">Likert prompt
<input class="input setting-input" name="likert" id="likert" value="{likert}" type="text" />
</label>
</div>
<span class="tip setting-help">Example: Please rate your overall experience with this section.</span>
<span id="lik_example" class="tip setting-help">Example: Please rate your overall experience with this section.</span>
</li>

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="likert0">Likert option 1</label>
<input class="input setting-input" name="likert0" id="likert0" value="{likert0}" type="text" />
<label aria-describedby="lik_excel" class="label setting-label">Likert option 1
<input class="input setting-input" name="likert0" id="likert0" value="{likert0}" type="text" />
</label>
</div>
<span class="tip setting-help">Example: Excellent!</span>
<span id="lik_excel" class="tip setting-help">Example: Excellent!</span>
</li>

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="likert1">Likert option 2</label>
<input class="input setting-input" name="likert1" id="likert1" value="{likert1}" type="text" />
<label aria-describedby="lik_good" class="label setting-label">Likert option 2
<input class="input setting-input" name="likert1" id="likert1" value="{likert1}" type="text" />
</label>
</div>
<span class="tip setting-help">Example: Good</span>
<span id="lik_good" class="tip setting-help">Example: Good</span>
</li>

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="likert2">Likert option 3</label>
<input class="input setting-input" name="likert2" id="likert2" value="{likert2}" type="text" />
<label aria-describedby="lik_ave" class="label setting-label">Likert option 3
<input class="input setting-input" name="likert2" id="likert2" value="{likert2}" type="text" />
</div>
<span class="tip setting-help">Example: Average</span>
<span id="lik_ave" class="tip setting-help">Example: Average</span>
</li>

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="likert3">Likert option 4</label>
<input class="input setting-input" name="likert3" id="likert3" value="{likert3}" type="text" />
<label aria-describedby="lik_fair" class="label setting-label">Likert option 4</label>
<input class="input setting-input" name="likert3" id="likert3" value="{likert3}" type="text" />
</label>
</div>
<span class="tip setting-help">Example: Fair</span>
<span id="lik_fair" class="tip setting-help">Example: Fair</span>
</li>

<li class="field comp-setting-entry is-set">
<div class="wrapper-comp-setting">
<label class="label setting-label" for="likert4">Likert option 5</label>
<input class="input setting-input" name="likert4" id="likert4" value="{likert4}" type="text" />
<label aria-describedby="lik_poor" class="label setting-label">Likert option 5</label>
<input class="input setting-input" name="likert4" id="likert4" value="{likert4}" type="text" />
</label>
</div>
<span class="tip setting-help">Example: Poor</span>
<span id="lik_poor" class="tip setting-help">Example: Poor</span>
</li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion feedback/static/js/src/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function FeedbackXBlock(runtime, element) {
if ($(".feedback_radio:checked", element).length === 0) {
vote = -1;
} else {
vote = parseInt($(".feedback_radio:checked", element).attr("id").split("_")[1]);
vote = parseInt($(".feedback_radio:checked", element).attr("data-id").split("_")[1]);
}
return vote;
}
Expand Down
Binary file added happy_sad_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added happy_sad_happy_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion makeicons/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This is a simple script for generating images of faces for use in the
RateXBlock.

You don't need to use this script yourself; they are committed to the
repo.
repo. The only time you might use this is if changing said icons.

If you do want to use this, run:

Expand Down
Binary file added numerical_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 171651d

Please sign in to comment.