Skip to content

Instantly share code, notes, and snippets.

@WilCF
Created January 13, 2014 20:33
Show Gist options
  • Save WilCF/8407570 to your computer and use it in GitHub Desktop.
Save WilCF/8407570 to your computer and use it in GitHub Desktop.
I added an "aggregation=avg" to the cml:checkboxes element. I copied the job and ran it on the internal channel and submitted my judgments. The results came out in the hidden field "results_percentage", so at least that part works.
As for making test questions, I don't know how to do that, because as they said in their email, the choices are created dynamically in javascript. If he wants to completely re-do the way he's built the job, here's one idea I can think of.
For each unit in their csv, create new columns titled
"category_1_name"
"category_2_name"
"category_3_name"
"category_4_name"
Then split out the contents of the column "categories" into those columns. In the cml he would do
<cml:checkboxes label="" validates="required" instructions="" name="" class="" gold="true" aggregation="agg">
{% if category_1_name != '' and category_1_name != 'No data available' and category_1_name != empty %}
<cml:checkbox label="category_1_name" value="category_1_name"></cml:checkbox>
{% endif %}
{% if category_2_name != '' and category_2_name != 'No data available' and category_2_name != empty %}
<cml:checkbox label="category_2_name" value="category_2_name"></cml:checkbox>
{% endif %} {% if category_3_name != '' and category_3_name != 'No data available' and category_3_name != empty %}
<cml:checkbox label="category_3_name" value="category_3_name"></cml:checkbox>
{% endif %}
{% if category_4_name != '' and category_4_name != 'No data available' and category_4_name != empty %}
<cml:checkbox label="category_4_name" value="category_4_name"></cml:checkbox>
{% endif %}
<cml:checkbox label="None of the above" value="none"></cml:checkbox>
</cml:checkboxes>
So it would only show the choices if they are in the data. Then he can dig gold.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment