Skills Assessment
[insert_php]
//print it
//end print instructions
//print it
$relevant=$_GET[’emailid’];
echo “
for $relevant
“;
[/insert_php]
Version 1.0
[insert_php]date_default_timezone_set(‘UK/London’);$date = date(‘m/d/Y h:i:s a’, time());echo $date;[/insert_php]
1.0 Audit configuration
1.1 Participants
[insert_php]
global $wpdb;
$relevant=$_GET[’emailid’];
$fid=$_GET[‘fid’];
echo “This report is for :”.$relevant.PHP_EOL.PHP_EOL;
$current_user = wp_get_current_user();
$fordb=$current_user->user_login;
$uem=$current_user->user_email;
//echo $uem.PHP_EOL;
$experiflaps= $_GET[‘title’];
if (empty($experiflaps)) {
$formid=$current_user->description;}
if (!empty($experiflaps)) {
echo $experiflaps;
$formid= $_GET[‘title’];}
$get_admins = array(
‘role’ => ‘subscriber’,
);
$filterz=’http://’.$fordb;
///experiment begins here
$args = array(
‘search’ => $filterz,
‘search_columns’ => array( ‘user_url’ )
);
$user_query = new WP_User_Query($args);
$users = (array) $user_query->results;
usort( $users, function( $a, $b ) use( $uids ) {
return array_search( $a->ID, $uids) < array_search( $b->ID, $uids ) ? -1 : 1;
} );
// use as usual
foreach ( $users as $user ) {
// echo ‘
‘ . $user->display_name . ‘
‘;
}
//ends here
//$tryout=get_users();
//print_r($tryout);
$current_user = wp_get_current_user();
$fordb=$current_user->user_login;
//$blogusers = get_users($get_admins);
$blogusers=$users;
//echo “So-far, a total of “.count($blogusers).” participants were sent invites to //complete the audit, across a wide set of disciplines, as per the list below: -“;echo PHP_EOL;echo PHP_EOL;
//foreach ($blogusers as $user) {
//echo $user->user_email;echo PHP_EOL;}
$blogusers=$relevant;
[/insert_php]
1.2 Skills questions
[insert_php]
global $wpdb;
$current_user = wp_get_current_user();
$fordb=$current_user->user_login;
$uem=$current_user->user_email;
//echo $uem.PHP_EOL;
$experiflaps= $_GET[‘title’];
if (empty($experiflaps)) {
$formid=$current_user->description;}
if (!empty($experiflaps)) {
echo $experiflaps;
$formid= $_GET[‘title’];}
//begin
if (!empty($fid)) {
$formid=$fid;}
//
$formid==25;
echo “Form number >”.$formid.PHP_EOL;
$sql=”SELECT layout FROM i3121151_wp1.wp_fsq_form WHERE id=25″;
$sqll=”SELECT design FROM i3121151_wp1.wp_fsq_form WHERE id=25″;
$fname= $wpdb->get_var($sql);
$testing= $wpdb->get_var($sqll);
$sections=((substr_count($fname, ‘”title”‘))-1);
//echo “Number of sections>”.$sections.PHP_EOL;
$finda='”title”‘;
$findb=”subtitle”;
$headings=array();$totalq=array();
for ($x = 2; $x <= $sections; $x++) {
$sectiona=strposx($fname,"timer",$x);
$sectionb=strposx($fname,"timer",$x+1);
$newsection=substr($fname,$sectiona,($sectionb-$sectiona));
$quests=substr_count($newsection,"container");
//echo "Quests>“.$quests;
$totalq[$x-1]=$quests;
$posa=strposx($fname,$finda,$x+1);
$posb=strposx($fname,$findb,$x+1);
$newstring=substr($fname,$posa+10,(($posb-10)-$posa));
$quotestart=strposx($newstring,'”‘,1);
$quoteend=strposx($newstring,'”‘,2);
$newstring=substr($newstring,$quotestart+1,(($quoteend-$quotestart)-1));
//echo $newstring.PHP_EOL;
$headings[$x-1]=$newstring;
}
//print_r($headings);
//print_r($totalq);
//$sql=”SELECT mcq FROM i3121151_wp1.wp_fsq_form WHERE id=’25′”;
//$fname= $wpdb->get_var($sql);
//echo “Number of questions>”.((substr_count($fname, ‘”slider”‘))/2).PHP_EOL;
//$qtot=((substr_count($fname, ‘”slider”‘))/2);
//echo $fname.PHP_EOL.PHP_EOL;
mysqli_close();
function rev ($string, $char)
{
if (false !== strrpos ($string, $char))
{
return strlen ($string) – strrpos ($string, $char) – 1;
}
}
function strposX($haystack, $needle, $number){
if($number == ‘1’){
return strpos($haystack, $needle);
}elseif($number > ‘1’){
return strpos($haystack, $needle, strposX($haystack, $needle, $number – 1) + strlen($needle));
}else{
return error_log(‘Error: Value for parameter $number is out of range’);
}
}
//extract sub questions
$count=0;$qnumber=0;
$subq=array();
foreach($headings as $key => $value) {
for ($x = 1; $x <= $totalq[$key]; $x++)
{$finder="Question P".($x+$qnumber);
//echo $finder.PHP_EOL;
$whereit=strpos($testing,$finder);
$keepers=substr($testing ,0,$whereit);
$whereit2=rev($keepers,"richtext");
$whereit3=strlen($keepers)-$whereit2;
$lengy=$whereit3-$whereit;
//echo "HERE ".$whereit." IS IS ".$whereit3." LENG>“.$lengy.PHP_EOL;
$mememe=substr($testing,$whereit3,($whereit-$whereit3));
$gobegin=strposx($mememe,”:”,4);
$goend=strposx($mememe,”:”,5);
$tada=substr($mememe,$gobegin+2,($goend-$gobegin)-5);
$count=$count+1;$subq[$count]=$tada;
//echo $tada.PHP_EOL;
}
$qnumber=$qnumber+$totalq[$key];
}
$len = count($subq);
//echo “Lengbth>”.$len;
$nsq = array_slice($subq,0,$len/2);
//print_r($nsq);
$resulttable=”wp_fsqm_direct_”.$formid;
$sqll=”SELECT count(id) FROM $resulttable”;
$resulter= $wpdb->get_var($sqll);
//echo “THIS IS IT>”.$resulter.PHP_EOL;
//echo $sqll.PHP_EOL;
$sqll=”SELECT pinfo0 FROM $resulttable”;
$namelist=$wpdb->get_results($sqll);
//NAMELIST
//print_r($namelist);
$namelistfull=array();
foreach ($namelist as $key => $value) {
$namelistfull[$key]=$value->pinfo0;
}
//print_r($namelistfull);
for ($x = 1; $x <= $resulter; $x++) {
$offer=$x-1;
//PERSONALISATION
$sql="SELECT * FROM $resulttable WHERE pinfo1='$relevant' ORDER BY id LIMIT 1 OFFSET $offer";
//SQLECHO
//echo $sql;
$resultz= $wpdb->get_row($sql);
//print_r($resultz);
$userinput=array();$count=0;
foreach ($resultz as $key => $value) {
$subs = substr($key, 0, 3);
//$subsit = substr($key, 0, 6);
//echo “SUBS”.$sbusit.PHP_EOL;
if ($subs==”mcq”){$count=$count+1;$userinput[$count]=$value;}
}
//print_r($userinput);
$len = count($userinput);
$r[$x]= array_slice($userinput,0, $len / 2);
$p[$x]=array_slice($userinput, $len / 2);
//print_r($r);
//print_r($p);
}
//print_r($r);
//print_r($p);
$len = count($headings);
$newheadings= array_slice($headings,0, $len / 2);
//print_r($newheadings);
$totalqc=count($totalq);
$totalqc=$totalqc-1;
$sublooper = array_slice($totalq, 0, $totalqc / 2);
//echo “Total subqs”.$totalqc.PHP_EOL;
//print_r($sublooper);
$cola=array();$colb=array();$colc=array();$cold=array();$cole=array();
$fruit = array (
“0p0” => array(“0”),
“0p1” => array(“0”),
“0p2” => array(“0”),
“0p3” => array(“0”),
“0p4” => array(“0”),
“0p5” => array(“0”),
“0p6” => array(“0”),
“0p7” => array(“0”),
“0p8” => array(“0”),
“0p9” => array(“0”),
“0p10” => array(“0”),
“1p0” => array(“0”),
“1p1” => array(“0”),
“1p2” => array(“0”),
“1p3” => array(“0”),
“1p4” => array(“0”),
“1p5” => array(“0”),
“1p6” => array(“0”),
“1p7” => array(“0”),
“1p8” => array(“0”),
“1p9” => array(“0”),
“1p10” => array(“0”),
“2p0” => array(“0”),
“2p1” => array(“0”),
“2p2” => array(“0”),
“2p3” => array(“0”),
“2p4” => array(“0”),
“2p5” => array(“0”),
“2p6” => array(“0”),
“2p7” => array(“0”),
“2p8” => array(“0”),
“2p9” => array(“0”),
“2p10” => array(“0”),
“3p0” => array(“0”),
“3p1” => array(“0”),
“3p2” => array(“0”),
“3p3” => array(“0”),
“3p4” => array(“0”),
“3p5” => array(“0”),
“3p6” => array(“0”),
“3p7” => array(“0”),
“3p8” => array(“0”),
“3p9” => array(“0”),
“3p10” => array(“0”),
“4p0” => array(“0”),
“4p1” => array(“0”),
“4p2” => array(“0”),
“4p3” => array(“0”),
“4p4” => array(“0”),
“4p5” => array(“0”),
“4p6” => array(“0”),
“4p7” => array(“0”),
“4p8” => array(“0”),
“4p9” => array(“0”),
“4p10” => array(“0”),
“5p0” => array(“0”),
“5p1” => array(“0”),
“5p2” => array(“0”),
“5p3” => array(“0”),
“5p4” => array(“0”),
“5p5” => array(“0”),
“5p6” => array(“0”),
“5p7” => array(“0”),
“5p8” => array(“0”),
“5p9” => array(“0”),
“5p10” => array(“0”),
“6p0” => array(“0”),
“6p1” => array(“0”),
“6p2” => array(“0”),
“6p3” => array(“0”),
“6p4” => array(“0”),
“6p5” => array(“0”),
“6p6” => array(“0”),
“6p7” => array(“0”),
“6p8” => array(“0”),
“6p9” => array(“0”),
“6p10” => array(“0”),
“7p0” => array(“0”),
“7p1” => array(“0”),
“7p2” => array(“0”),
“7p3” => array(“0”),
“7p4” => array(“0”),
“7p5” => array(“0”),
“7p6” => array(“0”),
“7p7” => array(“0”),
“7p8” => array(“0”),
“7p9” => array(“0”),
“7p10” => array(“0”),
“8p0” => array(“0”),
“8p1” => array(“0”),
“8p2” => array(“0”),
“8p3” => array(“0”),
“8p4” => array(“0”),
“8p5” => array(“0”),
“8p6” => array(“0”),
“8p7” => array(“0”),
“8p8” => array(“0”),
“8p9” => array(“0”),
“8p10” => array(“0”),
“9p0” => array(“0”),
“9p1” => array(“0”),
“9p2” => array(“0”),
“9p3” => array(“0”),
“9p4” => array(“0”),
“9p5” => array(“0”),
“9p6” => array(“0”),
“9p7” => array(“0”),
“9p8” => array(“0”),
“9p9” => array(“0”),
“9p10” => array(“0”),
“10p0” => array(“0”),
“10p1” => array(“0”),
“10p2” => array(“0”),
“10p3” => array(“0”),
“10p4” => array(“0”),
“10p5” => array(“0”),
“10p6” => array(“0”),
“10p7” => array(“0”),
“10p8” => array(“0”),
“10p9” => array(“0”),
“10p10” => array(“0”),);
$allin=array();
for ($x = 1; $x <= $resulter; $x++) {
foreach ($p[$x] as $key => $value) {
$fruitref=$r[$x][$key].”p”.$p[$x][$key];
//echo $fruitref.PHP_EOL;
$fruitnow=$fruit[$fruitref][$x-1];
$fruitnow=$fruitnow+1;
$fruit[$fruitref][$x-1]=$fruitnow;
$datalog=”Null”;$gapo=999;
//relgoeshere
if ($r[$x][$key]>4){
$rscore=$r[$x][$key];
$pscore=$p[$x][$key];
$gapo=(int)($rscore-$pscore);
//echo $rscore.”>”.$pscore.”>”.$gapo.PHP_EOL;
if ($gapo==0){$cola[$key]=$cola[$key]+1;}
if ($gapo==1){$colb[$key]=$colb[$key]+1;}
if ($gapo==2){$colc[$key]=$colc[$key]+1;}
if ($gapo==3){$cold[$key]=$cold[$key]+1;}
if ($gapo>3){$cole[$key]=$cole[$key]+1;}
if ($r[$x][$key]-$p[$x][$key]>1){$datalog=”Medium”;}
if ($r[$x][$key]-$p[$x][$key]>3){$datalog=”Highly”;}
}
$allin[$x][$key]=$r[$x][$key].”,”.$p[$x][$key].”,'”.$datalog.”GAP>”.$gapo.”,”;
}
//print_r($fruit);
}
//print_r($allin);
$googleit=””;
for ($x = 1; $x <= $resulter; $x++) {
foreach ($p[$x] as $key => $value) {
$fruitref=$r[$x][$key].”p”.$p[$x][$key];
$allin[$x][$key]=$allin[$x][$key].”,”.$fruit[$fruitref][$x-1];
$googleit=$googleit.”[‘X’,”.$allin[$x][$key].”],”.”
“;
}
}
//print_r($allin);
$googleit=substr($googleit, 0, -5);
$googlemore=substr($googlemore, 0, -5);
//echo $googleit;
//echo “ColumnA”.PHP_EOL;
//print_r($cola);
//echo “ColumnB”.PHP_EOL;
//print_r($colb);
//echo “ColumnC”.PHP_EOL;
//print_r($colc);
//echo “ColumnD”.PHP_EOL;
//print_r($cold);
//echo “ColumnE”.PHP_EOL;
//print_r($cole);
//echo “Results.”.$resulter.PHP_EOL;
[/insert_php]
[insert_php]
//print_r($nsq);
$totalqq=$totalqc/2;
echo “The audit consisted of “.array_sum($sublooper).” questions arranged in “.$totalqq.” themes. These were as follows:-“;
echo “
“;
$cntr=0;
for ($x = 0; $x <= $totalqq-1; $x++) {
$themenum=$x+1;
echo "
Theme “.$themenum.”: “.$newheadings[$x].”
“;
for ($y = 0; $y <= $sublooper[$x]-1; $y++) {
echo "
“;
$cntr=$cntr+1;
}echo “
“;}
global $ipt_fsqm_info, $wpdb;
$current_user = wp_get_current_user();
$formid=$current_user->description;
echo “FORM>>”,$formid.PHP_EOL;
$fordb=$current_user->user_login;
$syntax=’blog_id=1&orderby=nicename&role=subscriber’;
$blogusers = get_users($syntax);
$total=0;
foreach ( $blogusers as $user ) {
$ematch=$user->user_email;
$user = get_user_by( ’email’, $ematch );
$checker=$user->description;
if ($fordb==$checker){
//echo $ematch;
$sql=”SELECT mcq FROM i3121151_wp1.wp_fsq_data WHERE (form_id = $formid AND email=’$ematch’)”;
$sqlx=”SELECT * FROM i3121151_wp1.wp_fsq_data WHERE (form_id = $formid AND email=’$ematch’)”;
$myrows = $wpdb->get_var($sql);
$myheaders = mysql_query($sqlx);
//print_r($myrows);
//
echo “GOING FOR IT>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>”.PHP_EOL;
$needle = “i:”;
$lastPos = 0;
$positions = array();
while (($lastPos = strpos($myrows, $needle, $lastPos))!== false) {
$positions[] = $lastPos;
$lastPos = $lastPos + strlen($needle);
}
// Displays 3 and 10
$counter=0;
foreach ($positions as $value) {
// echo $value .”
“;
$postart[$counter]=$value;
$counter=$counter+1;
}
//
echo “DOING END THING>>>>>>>>>>>>”.PHP_EOL;
$needle = “:{s:”;
$lastPos = 0;
$positions = array();
while (($lastPos = strpos($myrows, $needle, $lastPos))!== false) {
$positions[] = $lastPos;
$lastPos = $lastPos + strlen($needle);
}
// Displays 3 and 10
$counter=0;
foreach ($positions as $value) {
//echo $value .”
“;
$posend[$counter]=$value;
$subby[$counter]=substr($myrows,$postart[$counter]+2,$posend[$counter]-$postart[$counter]);
//echo $subby.PHP_EOL;
$counter=$counter+1;
}
//
$counter=0;
foreach ($subby as $value) {
$itshere=strpos($value,”;”);
$dada=substr($value,0,$itshere);
echo $dada.PHP_EOL;
$mcqer[$counter]=$dada;
$counter=counter+1;
}
//
//CHECKITOUT
echo “NOW GOING TO REPORT ON HEADERS>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>”;
$i = 0;
while ($i < mysql_num_fields($sqlx)) {
echo "Information for column $i:
\n”;
$meta = mysql_fetch_field($myheaders, $i);
if (!$meta) {
echo “No information available
\n”;
}
echo “
blob: $meta->blob max_length: $meta->max_length multiple_key: $meta->multiple_key name: $meta->name not_null: $meta->not_null numeric: $meta->numeric primary_key: $meta->primary_key table: $meta->table type: $meta->type unique_key: $meta->unique_key unsigned: $meta->unsigned zerofill: $meta->zerofill
“;
$i++;
}
//
if (empty($myrows)){echo ‘>’;$total=$total+1;} else {
$real=$real+1;}
}}
//echo $total.” participants failed to complete the survey in time”.PHP_EOL;
//begin print instructions
//echo “
Submissions in the last year
“;
//$construct=”
No data yet.
“;//echo do_shortcode($construct);
//$construct=”
No data yet
“;//{}}i:
[/insert_php]