KCMC - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of KCMC.php

  1. <table style="width:70%;">
  2.   <tr>
  3.     <th style="text-align:left;">Multiple Answer Interaction</th>
  4.     <th style="text-align:left;">Answers: <strong>See bolded text above</strong></th>
  5.   </tr>
  6.   <tr style="background-color:gray; text-align:center;">
  7.     <td colspan="2">Correct Feedback</td>
  8.   </tr>
  9.   <tr>
  10.     <td colspan="2">
  11.       <input type="text" style="width:100%; box-sizing:border-box;" value="Correct! (Rationale)">
  12.     </td>
  13.   </tr>
  14.   <tr style="background-color:gray; text-align:center;">
  15.     <td colspan="2">First Try Incorrect Feedback</td>
  16.   </tr>
  17.   <tr>
  18.     <td colspan="2">
  19.       <input type="text" style="width:100%; box-sizing:border-box;" value="Not quite. (Include rationale) Try again!">
  20.     </td>
  21.   </tr>
  22.   <tr style="background-color:gray; text-align:center;">
  23.     <td colspan="2">Second Try Incorrect Feedback</td>
  24.   </tr>
  25.   <tr>
  26.     <td colspan="2">
  27.       <input type="text" style="width:100%; box-sizing:border-box;" value="Not quite. (Include rationale) Try again!">
  28.     </td>
  29.   </tr>
  30.   <tr style="background-color:gray; text-align:center;">
  31.     <td colspan="2">Third Try Incorrect Feedback</td>
  32.   </tr>
  33.   <tr>
  34.     <td colspan="2">
  35.       <input type="text" style="width:100%; box-sizing:border-box;" value="Your answer is still not correct, and you have exhausted all your attempts. (Rationale)">
  36.     </td>
  37.   </tr>
  38. </table>
  39. <button onclick="copyTable()">Copy</button>
  40.  
  41. <script>
  42.   function copyTable() {
  43.     // get the table element
  44.     var table = document.querySelector("table");
  45.     
  46.     // create a copy of the table
  47.     var tableCopy = table.cloneNode(true);
  48.     
  49.     // insert the copy after the original table
  50.     table.parentNode.insertBefore(tableCopy, table.nextSibling);
  51.     
  52.     // clear the input values in the copy
  53.     var inputs = tableCopy.querySelectorAll("input");
  54.     inputs.forEach(function(input) {
  55.       input.value = "";
  56.     });
  57.   }
  58. </script>
  59.  
  60.  
File Description
  • KCMC
  • PHP Code
  • 19 Dec-2022
  • 1.85 Kb
You can Share it: