So I have this code:
foreach ($xml->PrintQuestion as $PrintQuestion) {
//if hint doesn't exist, store question id
if (!$PrintQuestion->content->multichoice->feedback->hint->Passage) {
fwrite($fp, "<contentid filename=\"$value\">" . $PrintQuestion->attributes()->id . "</contentid>");
}
}
Basically, I'm trying to save IDs to an XML file if the Passage
node exists, but it seems to be storing every ID whether nodes exist within Passage
or not.