Guten Tag,
in meiner Studie werden 60 Bilder (in 3 Kategorien) in zufälliger Reihenfolge gezeigt,
und auf Valenz und Arousal (Likert Skalen) und manchmal auch auf Distanz zwischen den Personen (Visual analogue scale) bewertet.
Funktioniert alles gut, aber wenn mal eine Antwort nicht gegeben wird, gibt es Fehlermeldungen.
Wie behebe ich das?
Vielen Dank im Voraus.
LG
CODE ZUM ERSTELLEN DER LISTEN
// list of question IDs and images belonging to them
$list_pics_and_ques = array(
array('Type' => 'Alone', 'Valence' => 'RV01', 'Arousal' => 'RA01', 'Distance' => 'RD01', 'Picture' => 'pro://Beach_4.jpg'),
array('Type' => 'Alone', 'Valence' => 'RV02', 'Arousal' => 'RA02', 'Distance' => 'RD02', 'Picture' etcetera.....);
$total_pictures = count($list_pics_and_ques) ;
registerVariable('total_pictures');
// randomize list
shuffle($list_pics_and_ques);
registerVariable('list_pics_and_ques');
// get names
$list_names;
$list_val;
$list_aro;
$list_dis;
$list_type;
$i = 0;
foreach ($list_pics_and_ques as $arr) {
if ($i == 0){
$list_names = substr($arr["Picture"], 6) . ",";
$list_val = $arr["Valence"] . ",";
$list_aro = $arr["Arousal"] . ",";
$list_dis = $arr["Distance"] . ",";
$list_type = $arr["Type"] . ",";
$i = $i + 1;
} else {
$list_names .= substr($arr["Picture"], 6) . ",";
$list_val .= $arr["Valence"] . ",";
$list_aro .= $arr["Arousal"] . ",";
$list_dis .= $arr["Distance"] . ",";
$list_type .= $arr["Type"] . ",";
$i = $i + 1;
}
}
$list_names = trim($list_names, ',');//removes the final comma
$list_val = trim($list_val, ',');//removes the final comma
$list_aro = trim($list_aro, ',');//removes the final comma
$list_dis = trim($list_dis, ',');//removes the final comma
$list_type = trim($list_type, ',');//removes the final comma
// back to arrays
$list_names_array = explode(",", $list_names);
$list_val_array = explode(",", $list_val);
$list_aro_array = explode(",", $list_aro);
$list_dis_array = explode(",", $list_dis);
$list_type_array = explode(",", $list_type);
registerVariable('list_names_array');
registerVariable('list_val_array');
registerVariable('list_aro_array');
registerVariable('list_dis_array');
registerVariable('list_type_array');
$cnt_i = 1;
registerVariable('cnt_i');
registerVariable('fig_name');
registerVariable('fig_num');
registerVariable('category');
registerVariable('trialnum');
CODE ZUM ZEIGEN VON BILDERN UND RATING SKALEN
$i = loopPage(1,$total_pictures);
$shuffled = 'NO';
$bubu = 0;
option('progress', $i/$total_pictures*60);
if ($i == $cnt_i){
$bubu = sprintf("%01d", ($i == $cnt_i) );
option('progress', $i/$total_pictures*60); // to indicate the progress of the rating
$fig_name = $list_names_array[$i-1];
$sec_id_valence = $list_val_array[$i-1];
$sec_id_arousal = $list_aro_array[$i-1];
$sec_id_distance = $list_dis_array[$i-1];
$sec_id_type = $list_type_array[$i-1];
$cnt_i++;
}
// now put the picture
$real_fig_name = "pro://".$fig_name;
html('
<div class="spacing" style="text-align:center;margin-bottom:10px;">
<img src="'.$real_fig_name .'" alt="pic not found">
</div>
');
// and the rating
question($sec_id_valence); // Valence
question($sec_id_arousal); // Arousal
if ($sec_id_type == "Alone") {
} else {
question($sec_id_distance); // Distance
}
FEHLERMELDUNG:
There is an error in the PHP code:
Questionnaire Error: The PHP variable $sec_id_type has been used but the variable is yet undefined (the variable has no value).
PHP code
040 ');
041
042
043 question($sec_id_valence);
044 question($sec_id_arousal);
045 if ($sec_id_type == "Alone") {
046 } else {
Questionnaire Error: The PHP variable $sec_id_arousal has been used but the variable is yet undefined (the variable has no value).
PHP code
041
042
043 question($sec_id_valence);
044 question($sec_id_arousal);
045 if ($sec_id_type == "Alone") {
046 } else {
047 question($sec_id_distance);
Questionnaire Error: The PHP variable $sec_id_type has been used but the variable is yet undefined (the variable has no value).
PHP code
042
043 question($sec_id_valence);
044 question($sec_id_arousal);
045 if ($sec_id_type == "Alone") {
046 } else {
047 question($sec_id_distance);
048 }
Questionnaire Error: The PHP variable $sec_id_distance has been used but the variable is yet undefined (the variable has no value).
PHP code
044 question($sec_id_arousal);
045 if ($sec_id_type == "Alone") {
046 } else {
047 question($sec_id_distance);
048 }
049
050