ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
save_question_post_data.php
Go to the documentation of this file.
1 <?php
2 
19 chdir("../../..");
21 include_once "./components/ILIAS/soap/include/inc.soap_functions.php";
22 $results = [];
23 foreach ($_POST as $key => $value) {
24  if (preg_match("/value_(\d+)_1/", $key, $matches)) {
25  array_push($results, $_POST["value_" . $matches[1] . "_1"]);
26  array_push($results, $_POST["value_" . $matches[1] . "_2"]);
27  array_push($results, $_POST["points_" . $matches[1]]);
28  }
29 }
30 $res = ilSoapFunctions::saveQuestion($_POST["session_id"] . "::" . $_POST["client"], $_POST["active_id"], $_POST["question_id"], $_POST["pass"], $results);
31 if ($res === true) {
32  global $DIC;
33  $lng = $DIC['lng'];
34  $lng->loadLanguageModule("assessment");
35  echo $lng->txt("result_successful_saved");
36 } else {
37  global $DIC;
38  $lng = $DIC['lng'];
39  $lng->loadLanguageModule("assessment");
40  echo $lng->txt("result_unsuccessful_saved");
41 }
static initILIAS()
ilias initialisation
foreach($_POST as $key=> $value) $res
$lng
global $DIC
Definition: shib_login.php:26
$results
static saveQuestion(string $sid, int $active_id, int $question_id, int $pass, array $solution)