ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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("../..");
6 require_once "./include/inc.header.php";
7 include_once "./webservice/soap/include/inc.soap_functions.php";
8 $results = array();
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 }
$lng
global $DIC
Definition: feed.php:28
foreach($_POST as $key=> $value) $res
string $key
Consumer key/client ID value.
Definition: System.php:193
$results
static saveQuestion(string $sid, int $active_id, int $question_id, int $pass, array $solution)