Hi Michael,
Unfortunately, there's not an easy way to do either of your requests currently. I have created two workarounds that may suit your needs.
For your first item, you would need to create a numeric question on a page before the drag-and-drop question and ask the respondent how many items they want to rank. Then in your drag-and-drop, you would set the partial field to [% NumericQuestion %].
The workaround for the second item uses constructed lists:
1. Create a new predefined list with one of the items set to "Other Specify."
2. Create a checkbox-type select question that uses this list.
3. Create a new constructed list. Use the predefined list as the constructed list's parent, and give the constructed list this code: AIC(SelectQuestion).
4. On a new page, create a drag-and-drop ranking question that uses the constructed list.
For both workarounds, you would need to be mindful of any skips involved in your study to ensure that respondents don't skip to the ranking question before answering the "helper" questions.
I hope these can serve your needs. I've brought up your ideas to other members of the team, so they will hopefully be considered for future versions of Lighthouse.
2016/10/17 EDIT:
I have created some code that can allow for a minimum and maximum number of items to rank in drag-to-container ranking questions!
Start by setting the ranking question to require the maximum number of items you want to allow a respondent to submit. Now put this code in your ranking question's footer:
<script>
$(document).ready(function(){
var maxRanked = 4;
var totalItems = 8;
var loadInterval = setInterval(function() {
if ($('.draggable_button').length == totalItems) {
// Move items to unranked
var ranked = Number($('#FreeFormatQ_Var').val());
for (var i = ranked + 1; i <= maxRanked; i++) {
$('.unranked_sort_area').append($('.ranked_sort_area > .draggable_button:last-child'));
$('.unranked_sort_area > .draggable_button:last-child > .rank_display').css('visibility', 'hidden');
$('.unranked_sort_area > .draggable_button:last-child > input').val('');
}
// End interval
clearInterval(loadInterval)
}
}, 100);
})
</script>
Lines 3 and 4 need to be updated with the maximum number of items the respondent can rank and the total number of items in the ranking question, respectively.
Next, give the ranking question this custom JavaScript to be called BEFORE system verification:
var minRanked = 2;
var maxRanked = 4;
var ranked = $('.ranked_sort_area > .draggable_button').length;
$('#FreeFormatQ_Var').val(ranked);
if (ranked < minRanked) {
strErrorMessage = 'Too few items ranked.';
}
else {
for (var i = ranked + 1; i <= maxRanked; i++) {
$('.ranked_sort_area').append($('.unranked_sort_area > div:first-child'));
$('.ranked_sort_area > .draggable_button:last-child').hide();
$('.ranked_sort_area > .draggable_button:last-child > input').val(i);
}
}
Lines 1 and 2 should be updated with the minimum and maximum number of items the respondent can rank, respectively.
Now, create a free format question on the same page as the ranking question. The FF question needs a hidden numerical variable. The HTML of this question should be this:
<input name="FreeFormatQ_Var" id="FreeFormatQ_Var" type="hidden" value="0">
Finally, put this code anywhere on the page that comes after the ranking question:
[% Begin Unverified Perl
my $maxRanked = 8;
my $ranked = GETVALUE('FreeFormatQ_Var');
for (my $i = 1; $i <= $maxRanked; $i++) {
if (GETVALUE('RankingQ_' . $i) > $ranked) {
SETVALUE('RankingQ_' . $i, '');
}
}
End Unverified %]
Line 2 should be updated with the maximum number of items that can be ranked.
In all of the above codes, "RankingQ" should be replaced with the name of the ranking question and "FreeFormatQ_Var" should be replaced with the name of the free format question and its variable.
2017/02/28 EDIT:
Both of these requests are now possible in 9.3.0!
https://www.sawtoothsoftware.com/support/knowledge-base/sales-questions/253-support/software-downloads/question-library/1751-library-ranged-dnd-ranking
https://www.sawtoothsoftware.com/support/knowledge-base/sales-questions/253-support/software-downloads/question-library/1749-library-other-specify-dnd-ranking