Hello, already thank your for you time.
I created a survey where people have to rate 11 concepts according to how they know them.
Question 1) how well do you know these concepts (scale from 1 to 5)
Question 2) How similar are hese concepts? (selection of max 4 concepts they know from question 1, only concepts rated before >=3)
Question 3) How well are different items relevant in the definition of these concepts (selection of 3 concepts from question 2)
Is it possible to create a code that distributes more evenly the different concepts in question 2 and 3? In question 2 we select max 4 concepts and in question 3 max 3 concepts, I would like to prioritize the concepts less known by the overall participants (if concept 1 has been rated 100 times in question 2 and 3, I need the programm to show the participant the other concept he knows that have been rated less, like concept 2 rated 30 times overall)
--> to decrease the difference in frequency
I need to count how many times the concepts have been rated in question 2 and 3, and then prioritize the ones that are only rated a few times (get more data for them).
Here is the code we have for question 2:
$known = getItems('M001', 'min', 3); // determine relevant items
$number = count($known);
shuffle($known); // shuffle list
debug($known);
registerVariable($known);
// define questions regarding items
$questions = array(
1 => 'M002',
2 => 'M003',
3 => 'M004',
4 => 'M005',
5 => 'M006',
6 => 'M007',
7 => 'M008',
8 => 'M009',
9 => 'M010',
10 => 'M011',
);
$number = count($known); // this many elements can be asked
debug($number);
registerVariable($number);
if ($number == 0 or $number == 1) {
goToPage('next'); // None used? Then continue!
}
if ($number > 4) {
$number = 4; // carry out a maximum of four concepts
}
$chosen = array_slice($known, 0, $number);
debug($known);
debug($chosen);
for ($i=0; $i<$number; $i++) {
// Create internal variable ID from question ID plus index
$id = id('M024', $i + 1);
// Save the value from the array here
put($id, $known[$i]);
}
for ($i=0; $i<$number; $i++) {
$M001_01 = $known[$i]; // one of the concepts used (1 to 11)
if (!($M001_01==11)){
$M002 = $questions[$M001_01]; // the corresponding question
question($M002, $chosen); // ask question
debug($M001_01);
}
}
And code for question 3:
$questions = array(
1 => 'M012',
2 => 'M013',
3 => 'M014',
4 => 'M015',
5 => 'M016',
6 => 'M017',
7 => 'M018',
8 => 'M019',
9 => 'M020',
10 => 'M021',
11 => 'M022',
);
if ($number == 0) {
goToPage('next'); // None used? Then continue!
}
if ($number > 3) {
$number = 3; // carry out a maximum of three concepts
}
for ($i=0; $i<$number; $i++) {
$M001_01 = $known[$i]; // one of the concepts used (1 to 11)
$M002 = $questions[$M001_01]; // the corresponding question
question($M002); // ask question
}
Do you need more information?
Thank you very much :)