Tools page advance
This commit is contained in:
@@ -17,9 +17,11 @@ class Printables extends BaseController
|
||||
|
||||
public function show(string $printableCode)
|
||||
{
|
||||
$data = [];
|
||||
//$mModel =new MathsModel();
|
||||
$mModel =model('MathsModel'); // MathsModel();
|
||||
echo $mModel->PageData($printableCode);
|
||||
$data['result'] = $mModel->PageData($printableCode);
|
||||
|
||||
/*
|
||||
|
||||
|
||||
@@ -41,7 +43,7 @@ class Printables extends BaseController
|
||||
'databaseServerTemplates' => AuxPaceClient::getDatabaseServerTemplateList()
|
||||
]);
|
||||
*/
|
||||
return view('printables/index');
|
||||
return view('printables/index', $data);
|
||||
}
|
||||
|
||||
}
|
||||
+202
-1
@@ -14,8 +14,209 @@ class MathsModel extends Model
|
||||
|
||||
public function PageData($printableCode){
|
||||
|
||||
// Check if function is available first
|
||||
return $this->$printableCode();
|
||||
}
|
||||
|
||||
private function SIMULTAN1(){
|
||||
$data = [];
|
||||
for ($ii = 0; $ii < 50; $ii++) {
|
||||
|
||||
$la1 = array("x","a","p","r","q","s"); // your choice for variale name
|
||||
$la2 = array("y","z","n","m","u","f"); // your choice for variale name different from list la1
|
||||
|
||||
$let1 = $la1[rand(0,5)]; // pick a variale name to use
|
||||
$let2 = $la2[rand(0,5)]; // pick a variale name to use
|
||||
|
||||
$ans1 = rand(1,9); // generate the solution 1
|
||||
$ans2 = rand(2,11); // generate the solution 2
|
||||
if ($ans2 == $ans1) $ans2 = rand(2,11); // regenrate it
|
||||
|
||||
$c1 = rand(1,6);
|
||||
$c2 = rand(1,6);
|
||||
$c3 = rand(1,6); if ($c3 == $c1) $c3 = rand(2,11); // regenrate it
|
||||
$c4 = rand(1,6); if ($c4 == $c2) $c4 = rand(2,11); // regenrate it
|
||||
|
||||
$mopt = array(1,-1);
|
||||
$mp1 =$mopt[rand(0,1)];
|
||||
$mp2 =$mopt[rand(0,1)];
|
||||
|
||||
$tot1 = $c1*$ans1 + $mp1*$c2*$ans2;
|
||||
$tot2 = $c3*$ans1 + $mp2*$c4*$ans2;
|
||||
|
||||
$question1 = " $c1$let1" .( $mp1>0?"+":"-"). "$c2$let2 = $tot1 ";
|
||||
$question2 = " $c3$let1" .( $mp2>0?"+":"-"). "$c4$let2 = $tot2 ";
|
||||
$question3 = " What is $let1 and $let2 ?";
|
||||
|
||||
$realQ = array(
|
||||
'no'=>$ii+1,
|
||||
'l1'=>$question1,
|
||||
'l2'=>$question2,
|
||||
'l3'=>$question3,
|
||||
'q'=>$question1 ."<br>".$question2 ."<br>". $question3,
|
||||
'ans'=> $ans1.",".$ans2
|
||||
);
|
||||
$data[] = $realQ;
|
||||
|
||||
}
|
||||
|
||||
$result =array(
|
||||
'desc' =>'Basic Simultaneous Equations',
|
||||
'detail'=> 'Basic Simultaneous Equations Practice',
|
||||
'col' => 1,
|
||||
'frame'=>'line',
|
||||
'data'=>$data
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function EQUATION1(){
|
||||
$data = [];
|
||||
|
||||
$p1=['Apple','Banana','Gape'];
|
||||
$p2=['Lemon','Mango','Orange'];
|
||||
$txtL1 = $p1[rand(0,2)];
|
||||
$txtL2 = $p2[rand(0,2)];
|
||||
for ($ii = 0; $ii < 24; $ii++) {
|
||||
|
||||
$xpart = rand(1, 2);
|
||||
$xp = "";
|
||||
for ($i = 0; $i < $xpart; $i++) {
|
||||
$xc = rand(1,4);
|
||||
$xp .= ($xc>1?$xc:'')." ".$txtL1.($xc>1?"s":'').($i< $xpart-1?" + ":'');
|
||||
// $i=$i+$xc;
|
||||
}
|
||||
|
||||
$ypart = rand(1, 2);
|
||||
$yp = "";
|
||||
for ($iy = 0; $iy < $ypart; $iy++) {
|
||||
$yc = rand(1,6);
|
||||
$yp .= " + ". ($yc>1?$yc:'')." ".$txtL2.($yc>1?"s":'');
|
||||
}
|
||||
$question = $xp . $yp. " = ";
|
||||
|
||||
$realQ = array(
|
||||
'no'=>$ii+1,
|
||||
'l1'=>$xp,
|
||||
'l2'=>$yp,
|
||||
'l3'=>'',
|
||||
'q'=>$question,
|
||||
'ans'=> ''
|
||||
);
|
||||
$data[] = $realQ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$result =array(
|
||||
'desc' =>'Basic Equations Level 1',
|
||||
'detail'=> 'Basic Equations Level 1 Practice, Simplify the expressions',
|
||||
'col' => 1,
|
||||
'frame'=>'line',
|
||||
'data'=>$data
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function EXPONENT1(){
|
||||
$data = [];
|
||||
$la1 = array("x","a","p","r","q","s","y","z","n","m","u","f");
|
||||
|
||||
for ($ii = 0; $ii < 50; $ii++) {
|
||||
$numV = rand(2,3);
|
||||
|
||||
$var_list= array();
|
||||
|
||||
for ($i=0; $i<$numV; $i++){
|
||||
$var_list[$i] = $la1[rand(0,(count($la1)-1))];
|
||||
}
|
||||
|
||||
$numQ = rand(4,8);
|
||||
|
||||
$quest_list= array();
|
||||
$quest ="";
|
||||
for ($i=0; $i<$numQ; $i++){
|
||||
$quest_list[$i] = $var_list[rand(0,(count($var_list)-1))];
|
||||
$quest .= ($i>0?" . ":'').$quest_list[$i];
|
||||
}
|
||||
|
||||
$realQ = array(
|
||||
'no'=>$ii+1,
|
||||
'l1'=>'',
|
||||
'l2'=>'',
|
||||
'l3'=>'',
|
||||
'q'=>$quest." = ",
|
||||
'ans'=> ''
|
||||
);
|
||||
$data[] = $realQ;
|
||||
}
|
||||
|
||||
$result =array(
|
||||
'desc' =>'Basic Exponential Expression',
|
||||
'detail'=> 'Basic Exponential Expression Level 1, Simplify the expressions',
|
||||
'col' => 1,
|
||||
'frame'=>'line',
|
||||
'data'=>$data
|
||||
);
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
private function EQUATION4(){
|
||||
$data = [];
|
||||
|
||||
$la1 = array("x","a","p","r","q","s","y","z","n","m","u","f");
|
||||
|
||||
for ($ii = 0; $ii < 50; $ii++) {
|
||||
$numV = rand(2, 3);
|
||||
|
||||
$var_list = array();
|
||||
|
||||
for ($i = 0; $i < $numV; $i++) {
|
||||
$var_list[$i] = $la1[rand(0, (count($la1) - 1))];
|
||||
}
|
||||
|
||||
$numQ = rand(4, 8);
|
||||
$sign_arr = array("+", "-");
|
||||
|
||||
$quest_list = array();
|
||||
$quest = "";
|
||||
for ($i = 0; $i < $numQ; $i++) {
|
||||
$quest_list[$i] = $var_list[rand(0, (count($var_list) - 1))];
|
||||
$sgn = $sign_arr[rand(0, 1)];
|
||||
if ($i == 0 && $sgn == "+") {
|
||||
$sgn = "";
|
||||
}
|
||||
$que = rand(1, 5);
|
||||
if ($que == 1) {
|
||||
$que = "";
|
||||
}
|
||||
|
||||
$quest .= " ".$sgn . $que . $quest_list[$i];
|
||||
}
|
||||
|
||||
$realQ = array(
|
||||
'no' => $ii + 1,
|
||||
'l1' => '',
|
||||
'l2' => '',
|
||||
'l3' => '',
|
||||
'q' => $quest . " = ",
|
||||
'ans' => ''
|
||||
);
|
||||
$data[] = $realQ;
|
||||
|
||||
|
||||
}
|
||||
$result =array(
|
||||
'desc' =>'Equation Simplification IV',
|
||||
'detail'=> 'Basic Exponential Expression Level 1, Simplify the expressions',
|
||||
'col' => 1,
|
||||
'frame'=>'line',
|
||||
'data'=>$data
|
||||
);
|
||||
return $result;
|
||||
|
||||
|
||||
return '93939393939'.$printableCode;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -97,14 +97,35 @@
|
||||
<span class="menu-arrow"></span>
|
||||
</span>
|
||||
<div class="menu-sub menu-sub-accordion menu-active-bg">
|
||||
|
||||
<?php
|
||||
$printable_menu=[
|
||||
['ulink'=>'SIMULTAN1','desc'=>'Basic Simultaneous Eq.' ],
|
||||
['ulink'=>'EQUATION1','desc'=>'Basic Equations.' ],
|
||||
['ulink'=>'EXPONENT1','desc'=>'Basic Exponential.' ],
|
||||
['ulink'=>'EQUATION4','desc'=>'Equation Simplification' ],
|
||||
|
||||
];
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
foreach ($printable_menu as $mn){
|
||||
?>
|
||||
<div class="menu-item">
|
||||
<a class="menu-link" href="#">
|
||||
<span class="menu-bullet">
|
||||
<span class="bullet bullet-dot"></span>
|
||||
</span>
|
||||
<span class="menu-title">Overview</span>
|
||||
<a class="menu-link" href="/printables/<?=$mn['ulink']?>">
|
||||
<span class="menu-bullet">
|
||||
<span class="bullet bullet-dot"></span>
|
||||
</span>
|
||||
<span class="menu-title"><?=$mn['desc']?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!-- div class="menu-item">
|
||||
<a class="menu-link" href="#">
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
<!--begin::Header-->
|
||||
<div class="card-header border-0 pt-5">
|
||||
<h3 class="card-title align-items-start flex-column">
|
||||
<span class="card-label fw-bolder fs-3 mb-1">Latest Products</span>
|
||||
<span class="text-muted mt-1 fw-bold fs-7">More than 400 new products</span>
|
||||
<span class="card-label fw-bolder fs-3 mb-1"><?=$result["desc"]?></span>
|
||||
<span class="text-muted mt-1 fw-bold fs-7"><?=$result["detail"]?></span>
|
||||
</h3>
|
||||
<div class="card-toolbar">
|
||||
|
||||
@@ -46,21 +46,26 @@
|
||||
<!--end::Table head-->
|
||||
<!--begin::Table body-->
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
foreach ($result["data"] as $drow)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="symbol symbol-45px me-2">
|
||||
<span class="symbol-label">
|
||||
1
|
||||
</span>
|
||||
<span class="symbol-label">
|
||||
<?=$drow['no']?>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6">Brad Simmons</a>
|
||||
<span class="text-muted fw-bold d-block">Movie Creator</span>
|
||||
<span class="text-muted fw-bold d-block">
|
||||
<?=$drow['q']?>
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-end text-muted fw-bold">React, HTML</td>
|
||||
<td class="text-end text-muted fw-bold"></td>
|
||||
<td class="text-end">
|
||||
<span class="badge badge-light-success">Approved</span>
|
||||
<span class="badge badge-light-success"></span>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<a href="#" class="btn btn-sm btn-icon btn-bg-light btn-active-color-primary">
|
||||
@@ -77,6 +82,11 @@
|
||||
</tr>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
<!--end::Table body-->
|
||||
</table>
|
||||
@@ -85,7 +95,7 @@
|
||||
</div>
|
||||
<!--end::Tap pane-->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Body-->
|
||||
|
||||
Reference in New Issue
Block a user