ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
save_question_post_data.php
Go to the documentation of this file.
1<?php
2
19chdir("../../..");
21include_once "./components/ILIAS/soap/include/inc.soap_functions.php";
23foreach ($_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);
31if ($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
static saveQuestion(string $sid, int $active_id, int $question_id, int $pass, array $solution)
$_POST['cmd']
Definition: lti.php:27
$results
$lng
foreach($_POST as $key=> $value) $res
global $DIC
Definition: shib_login.php:26