Hallo,
ich habe mal wieder die Navigationsleiste in einem OFB programmiert (https://www.soscisurvey.de/help/doku.php/en:create:navigation). Jetzt habe ich allerdings das erste mal Filter in dem Fragebogen, bei dem einzelne Fragen auf Basis einer Variable (0/1) übersprungen werden (php-Filter). Wenn Fragen übersprungen werden, würden ja einzelne Kapitel immer als unvollständig (rotes Kreuz) markiert sein. Gibt es einen Weg SoSci klar zu machen, das Fragen bewusst übersprungen werden und deswegen ein Kapitel als vollständig angesehen wird (also ein Haken und kein rotes Kreuz mehr)?
Edit (mit dem Beispiel das Fragen B014, B016, B019 ggf. übersprungen werden können durch einen Filter):
function navigation() {
// Completion check
$cSampling = (count(array_merge(
checkItem('A002', 'A002_01'),
checkItem('A004', 'A004_01'),
checkItem('A006', 'A006_01'),
checkItem('A010', 'A010_01'),
checkItem('A012', 'A012_01'),
)) === 0 );
$cTranslating = (count(array_merge(
checkItem('B002', 'B002_01'),
checkItem('B004', 'B004_01'),
checkItem('B006', 'B006_01'),
checkItem('B008', 'B008_01'),
checkQst('B010', [1,2,3]),
checkQst('B012', [1,2,3]),
checkItem('B014', 'B014_01'),
checkItem('B016', 'B016_01'),
checkItem('B019', 'B019_01'),
checkItem('B022', 'B022_01'),
checkItem('B023', 'B023_01'),
checkItem('B025', 'B025_01'),
checkItem('B027', 'B027_01'),
checkItem('B028', 'B028_01'),
)) === 0);
$cAdministering = (count(array_merge(
checkQst('C002', [1,2]),
checkItem('C003', 'C003_01'),
checkQst('C005', [1,2,3,4,5,6,7,8,9,10,11,12,13]),
checkItem('C008', 'C008_01'),
checkItem('C010', 'C010_01'),
checkItem('C012', 'C012_01'),
checkItem('C014', 'C014_01'),
checkItem('C016', 'C016_01'),
checkItem('C019', 'C019_01'),
checkItem('C021', 'C021_01'),
checkItem('C023', 'C023_01'),
checkItem('C024', 'C024_01'),
checkItem('C025', 'C025_01'),
checkItem('C027', 'C027_01'),
checkItem('C029', 'C029_01'),
checkItem('C031', 'C031_01'),
checkItem('C033', 'C033_01'),
)) === 0);
$cControl = (count(array_merge(
checkItem('D002', 'D002_01'),
checkItem('D005', 'D005_01'),
checkItem('D007', 'D007_01'),
)) === 0);
$cPreparing = (count(array_merge(
checkItem('E002', 'E002_01'),
checkQst('E004', [1]),
checkItem('E005', 'E005_01'),
checkItem('E007', 'E007_01'),
checkItem('E008', 'E008_01'),
checkItem('E009', 'E009_01'),
checkItem('E010', 'E010_01'),
checkItem('E012', 'E012_01'),
checkItem('E014', 'E014_01'),
)) === 0);
$cDatabases = (count(array_merge(
checkItem('F002', 'F002_01'),
checkItem('F004', 'F004_01'),
checkItem('F006', 'F006_01'),
checkItem('F008', 'F008_01'),
checkItem('F010', 'F010_01'),
checkQst('F013', [1]),
checkItem('F014', 'F014_01'),
)) === 0);
html(
'<div style="border: 2px solid #CCCCCC; border-left: 0 none; border-right: 0 none; padding: 20px 0 12px 0; margin-bottom: 3em;">'.
'<div class="s2flex NavButtons" style="flex-wrap: wrap; margin-right: -8px">'.NL.
// Navigation
buttonToPage('Start').
buttonToPage('Sampling Schools and Classes', NULL, NULL, ($cSampling ? 'complete' : 'incomplete')).
buttonToPage('Adapting and Producing the Assessment Instruments', NULL, NULL, ($cTranslating ? 'complete' : 'incomplete')).
buttonToPage('Administering the Assessment', NULL, NULL, ($cAdministering ? 'complete' : 'incomplete')).
buttonToPage('Implementing the National Quality Control Program', NULL, NULL, ($cControl ? 'complete' : 'incomplete')).
buttonToPage('Preparing for and Scoring the Constructed Response Items', NULL, NULL, ($cPreparing ? 'complete' : 'incomplete')).
buttonToPage('Creating and Submitting the Databases and Documentation', NULL, NULL, ($cDatabases ? 'complete' : 'incomplete')).
'<div style="width: 2em;"></div>'.
buttonToPage('Submit Data').
'</div>'.
'</div>'
);
option('nextbutton', 'Next');
}
function checkQst($qID, $items) {
$fail = [];
foreach ($items as $item) {
$answer = value(id($qID, $item));
if (($answer < -3) or ($answer === '')) {
$text = preg_replace('/:.*/', '', getItemtext($qID, $item));
$fail[] = $text;
}
}
return $fail;
}
function checkItem($varIDs, $textID) {
$fail = [];
if (!is_array($varIDs)) {
$varIDs = [$varIDs];
}
foreach ($varIDs as $varID) {
$answer = value($varID);
if (($answer < -3) or ($answer === '')) {
$text = preg_replace('/:.*/', '', getItemtext($textID));
$fail[] = $text;
// Only one of them
break;
}
}
return $fail;
}
function checkQstMatrix($qID) {
$anySelected = getItems($qID, '>', 0);
$fail = [];
if (count($anySelected) == 0) {
$fail[] = getItemtext($qID, 'question');
}
return $fail;
}
Filter wurden so programmiert ($inhalt2 ist eine 0/1 Variable):
$key = caseSerial();
$inhalt = dbGet($key);
$inhalt2 = $inhalt[5];
registerVariable($inhalt2);
if ($inhalt2 == 1) {
goToPage('Filter1');
}