ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
save_question_post_data.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 chdir("../../..");
7 include_once "./components/ILIAS/soap/include/inc.soap_functions.php";
8 $results = [];
9 foreach ($_POST as $key => $value) {
10  if (preg_match("/value_(\d+)_1/", $key, $matches)) {
11  array_push($results, $_POST["value_" . $matches[1] . "_1"]);
12  array_push($results, $_POST["value_" . $matches[1] . "_2"]);
13  array_push($results, $_POST["points_" . $matches[1]]);
14  }
15 }
16 $res = ilSoapFunctions::saveQuestion($_POST["session_id"] . "::" . $_POST["client"], $_POST["active_id"], $_POST["question_id"], $_POST["pass"], $results);
17 if ($res === true) {
18  global $DIC;
19  $lng = $DIC['lng'];
20  $lng->loadLanguageModule("assessment");
21  echo $lng->txt("result_successful_saved");
22 } else {
23  global $DIC;
24  $lng = $DIC['lng'];
25  $lng->loadLanguageModule("assessment");
26  echo $lng->txt("result_unsuccessful_saved");
27 }
$_POST['cmd']
Definition: lti.php:27
static initILIAS()
ilias initialisation
foreach($_POST as $key=> $value) $res
$lng
global $DIC
Definition: shib_login.php:25
$results
static saveQuestion(string $sid, int $active_id, int $question_id, int $pass, array $solution)