1) {
$thisis=str_replace($cwikistuffs[$ii], $cwikistuffs[$ii] . '#' . explode('"', $biois[1])[0], $thisis);
file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'enneagram_type_game.php', $thisis);
$cwikistuffs[$ii].='#' . explode('"', $biois[1])[0];
}
}
array_push($wikidesignations, $cwikistuffs[$ii]);
array_push($wikidescriptions, $otherde);
}
$otherde='';
}
}
}
}
$sofar=';';
for ($i=0; $i<9; $i++) {
$j=rand(0, (-1 + sizeof($wikidesignations)));
if ($crandlist == '') {
$crandlist='' . $j;
$sofar.=$wikidescriptions[$j] . ';';
} else if (strpos((',' . $crandlist . ','), (',' . $j . ',')) !== false || strpos($sofar, ';' . $wikidescriptions[$j] . ';') !== false) {
while (strpos((',' . $crandlist . ','), (',' . $j . ',')) !== false || strpos($sofar, ';' . $wikidescriptions[$j] . ';') !== false) {
$j=rand(0, (-1 + sizeof($wikidesignations)));
}
$crandlist.=',' . $j;
$sofar.=$wikidescriptions[$j] . ';';
} else {
$crandlist.=',' . $j;
$sofar.=$wikidescriptions[$j] . ';';
}
}
$sofar=';';
$ccrandlist='';
for ($i=1; $i<=9; $i++) {
$j=rand(1, 9);
if ($ccrandlist == '') {
$ccrandlist='' . $j;
$sofar.='' . $j . ';';
} else if (strpos((',' . $ccrandlist . ','), (',' . $j . ',')) !== false) {
while (strpos((',' . $ccrandlist . ','), (',' . $j . ',')) !== false) {
$j=rand(1, 9);
}
$ccrandlist.=',' . $j;
$sofar.='' . $j . ';';
} else {
$ccrandlist.=',' . $j;
$sofar.='' . $j . ';';
}
}
$randlist=explode(',', "1,2,3,4,5,6,7,8,9"); //$crandlist);
$randlist=explode(',', $crandlist);
$rrandlist=explode(',', $ccrandlist);
$randmode=rand(0,1);
$correctans=rand(0,8);
$callbackurl='./enneagram_type_game.php';
$templategame=file_get_contents('./experimental_drag_and_drop.htm');
for ($i=1; $i<=9; $i++) {
$templategame=str_replace('>' . $i . '<', '>##' . $rrandlist[-1 + $i] . '<', $templategame);
}
$templategame=str_replace('>##', '>', $templategame);
$templategame=str_replace('
', '', $templategame);
$templategame=str_replace('>Game<', '>Enneagram Type Game ... drag to matching correct answer to score<', $templategame);
$templategame=str_replace('>', '>' . $scorebit . '', $templategame);
$thepsource=explode('f0;">', explode("", $templategame)[0])[-1 + sizeof(explode('f0;">', explode("", $templategame)[0]))];
$templategame=str_replace(', 2023<', ', 2023 ... thanks to The Nine Enneagram Type Descriptions & The Enneagram Types of Your Favorite Movie Stars & Wikipedia<', $templategame);
$templategame=str_replace('>Reset example<', ' style="display:none;">Reset example<', $templategame);
//echo $crandlist . "\n" . $thepsource . "\n" . $correctans . "\n";
//exit;
//echo $crandlist . "\n";
//echo "" . $randlist[$correctans] . "\n" . $wikidescriptions[$randlist[$correctans]] . "\n" . $wikidesignations[$randlist[$correctans]];
//exit;
//file_put_contents('x.x', '' . $randmode . "\n" . $crandlist . "\n" . $thepsource . "\n" . $correctans . "\n" . $crandlist . "\n" . $randlist[$correctans] . "\n" . $wikidescriptions[$randlist[$correctans]] . "\n" . $wikidesignations[$randlist[$correctans]]);
if ($randmode == 0) { // designation up top and descriptions in drop zone
$templategame=str_replace('>' . (1 + $correctans) . '<', ' data-answer="' . explode(' ... ', $wikidescriptions[$randlist[$correctans]])[0] . '">' . $categorizations[$correctans] . '<', $templategame);
if (strpos($wikidesignations[$randlist[$correctans]], '#') !== false) {
$templategame=str_replace(' style="background-color:#f0f0f0;"', ' ', $templategame);
$templategame=str_replace('>' . $thepsource . '<', ' data-answer="' . explode(' ... ', $wikidescriptions[$randlist[$correctans]])[0] . '" style="background-color:#f0f0f0;background:URL(' . str_replace('http:','',explode('#', $wikidesignations[$randlist[$correctans]])[1]) . '); background-repeat: no-repeat; background-size: contain;background-position: center right;border:5px dashed pink;" alt="f0;">
' . explode('#', $wikidesignations[$randlist[$correctans]])[0] . '
<', $templategame);
} else {
$templategame=str_replace('>' . $thepsource . '<', ' data-answer="' . explode(' ... ', $wikidescriptions[$randlist[$correctans]])[0] . '">' . explode('#', $wikidesignations[$randlist[$correctans]])[0] . '<', $templategame);
}
for ($i=1; $i<=9; $i++) {
if ((-1 + $i) != $correctans) {
$templategame=str_replace('>' . $i . '' . $categorizations[-1 + $i] . '' . (1 + $correctans) . '<', ' data-answer="' . explode('#', $wikidesignations[$randlist[$correctans]])[0] . '" style="background-color:#f0f0f0;background:URL(' . str_replace('http:','',explode('#', $wikidesignations[$randlist[$correctans]])[1]) . '); background-repeat: no-repeat; background-size: contain;background-position: center right;" alt="f0;">' . explode('#', $wikidesignations[$randlist[$correctans]])[0] . '<', $templategame);
} else {
$templategame=str_replace('>' . (1 + $correctans) . '<', ' data-answer="' . explode('#', $wikidesignations[$randlist[$correctans]])[0] . '">' . explode('#', $wikidesignations[$randlist[$correctans]])[0] . '<', $templategame);
}
if (strpos($wikidesignations[$randlist[$correctans]], '#') !== false && 1 == 7) {
$templategame=str_replace('>' . $thepsource . '<', ' data-answer="' . explode('#',$wikidesignations[$randlist[$correctans]])[0] . '" style="background:URL(' . str_replace('http:','',explode('#', $wikidesignations[$randlist[$correctans]])[1]) . '); background-repeat: no-repeat; background-size: contain;background-position: center right;border:5px dashed pink;" alt="f0;">
' . $wikidescriptions[$randlist[$correctans]] . '
<', $templategame);
} else {
$templategame=str_replace(' style="border:5px dashed pink;background-color:#f0f0f0;"', ' ', $templategame);
$templategame=str_replace('>' . $thepsource . '<', ' style="border:5px dashed pink;background-color:#f0f0f0;" data-answer="' . explode('#', $wikidesignations[$randlist[$correctans]])[0] . '">' . $wikidescriptions[$randlist[$correctans]] . '<', $templategame);
}
for ($i=1; $i<=9; $i++) {
if ((-1 + $i) != $correctans) {
if (strpos($wikidesignations[$randlist[-1 + $i]], '#') !== false) {
$templategame=str_replace('>' . $i . '' . explode('#', $wikidesignations[$randlist[-1 + $i]])[0] . '' . $i . '' . explode('#', $wikidesignations[$randlist[-1 + $i]])[0] . '