|
| addExercise ($sid, $target_id, $exercise_xml) |
| add an exercise with id. More...
|
|
| updateExercise ($sid, $ref_id, $exercise_xml) |
| update a exercise with id. More...
|
|
| getExerciseXML ($sid, $ref_id, $attachFileContentsMode) |
| get exercise xml More...
|
|
| __construct ($use_nusoap=true) |
| Constructor. More...
|
|
| initErrorWriter () |
| Overwrite error handler. More...
|
|
| __explodeSid ($sid) |
|
| __setMessage ($a_str) |
|
| __getMessage () |
|
| __appendMessage ($a_str) |
|
| __setMessageCode ($a_code) |
|
| __getMessageCode () |
|
| initAuth ($sid) |
| Init authentication. More...
|
|
| initIlias () |
|
| __initAuthenticationObject ($a_auth_mode=AUTH_LOCAL) |
|
| __raiseError ($a_message, $a_code) |
|
| getNIC ($sid) |
| get client information from current as xml result set More...
|
|
| isFault ($object) |
|
| checkObjectAccess ($ref_id, $expected_type, $permission, $returnObject=false) |
| check access for ref id: expected type, permission, return object instance if returnobject is true More...
|
|
| getInstallationInfoXML () |
|
| getClientInfoXML ($clientid) |
|
◆ addExercise()
ilSoapExerciseAdministration::addExercise |
( |
|
$sid, |
|
|
|
$target_id, |
|
|
|
$exercise_xml |
|
) |
| |
add an exercise with id.
- Parameters
-
string | $session_id | current session |
int | $target_id | refid of parent in repository |
string | $exercise_xml | qti xml description of test |
- Returns
- int reference id in the tree, 0 if not successful
Definition at line 46 of file class.ilSoapExerciseAdministration.php.
References ilExerciseException\$ID_MISMATCH, $ilLog, $target_id, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_isInTrash(), array, ilObjectFactory\getInstanceByRefId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
51 if (!$this->__checkSession($sid)) {
54 global $rbacsystem, $tree,
$ilLog;
57 return $this->
__raiseError(
'No valid target given.',
'Client');
61 return $this->
__raiseError(
"Parent with ID $target_id has been deleted.",
'CLIENT_OBJECT_DELETED');
65 $allowed_types =
array(
'cat',
'grp',
'crs',
'fold',
'root');
66 if (!in_array($target_obj->getType(), $allowed_types)) {
67 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
70 if (!$rbacsystem->checkAccess(
'create',
$target_id,
"exc")) {
75 include_once
'./Modules/Exercise/classes/class.ilObjExercise.php';
76 include_once
'./Modules/Exercise/classes/class.ilExerciseXMLParser.php';
77 include_once
'./Modules/Exercise/exceptions/class.ilExerciseException.php';
82 $exercise->createReference();
85 $exercise->saveData();
92 if ($exerciseXMLParser->start()) {
93 $exerciseXMLParser->getAssignment()->update();
94 return $exercise->update() ? $exercise->getRefId() : -1;
99 $exception->getMessage(),
static _isInTrash($a_ref_id)
checks wether object is in trash
__raiseError($a_message, $a_code)
Create styles array
The data for the language used.
initAuth($sid)
Init authentication.
Exercise XML Parser which completes/updates a given exercise by an xml string.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Exercise exceptions class.
◆ getExerciseXML()
ilSoapExerciseAdministration::getExerciseXML |
( |
|
$sid, |
|
|
|
$ref_id, |
|
|
|
$attachFileContentsMode |
|
) |
| |
get exercise xml
- Parameters
-
string | $sid | |
int | $ref_id | |
int | $attachFileContentsMode | see constants |
- Returns
- xml following ilias_exercise_x.dtd
Definition at line 191 of file class.ilSoapExerciseAdministration.php.
References $ilLog, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
196 if (!$this->__checkSession($sid)) {
199 if (!strlen($ref_id)) {
201 'No ref id given. Aborting!',
205 global $rbacsystem, $tree,
$ilLog;
210 'No exercise found for id: ' . $ref_id,
216 return $this->
__raiseError(
"Parent with ID $ref_id has been deleted.",
'Client');
222 $permission_ok =
false;
223 $write_permission_ok =
false;
225 if ($rbacsystem->checkAccess(
'write', $ref_id)) {
226 $write_permission_ok =
true;
229 if ($rbacsystem->checkAccess(
'read', $ref_id)) {
230 $permission_ok =
true;
235 if (!$permission_ok && !$write_permission_ok) {
237 'No permission to edit the object with id: ' . $ref_id,
244 if (!is_object($exercise) || $exercise->getType()!=
"exc") {
246 'Wrong obj id or type for exercise with id ' . $ref_id,
251 include_once
'./Modules/Exercise/classes/class.ilExerciseXMLWriter.php';
255 $xmlWriter->setExercise($exercise);
256 $xmlWriter->setAttachMembers($write_permission_ok);
257 $xmlWriter->setAttachFileContents($attachFileContentsMode);
260 return $xmlWriter->getXML();
static _isInTrash($a_ref_id)
checks wether object is in trash
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
__raiseError($a_message, $a_code)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
initAuth($sid)
Init authentication.
◆ updateExercise()
ilSoapExerciseAdministration::updateExercise |
( |
|
$sid, |
|
|
|
$ref_id, |
|
|
|
$exercise_xml |
|
) |
| |
update a exercise with id.
- Parameters
-
string | $session_id | current session |
int | $ref_id | refid id of exercise in repository |
string | $exercise_xml | qti xml description of test |
- Returns
- boolean true, if update successful, false otherwise
Definition at line 115 of file class.ilSoapExerciseAdministration.php.
References ilExerciseException\$ID_MISMATCH, $ilLog, ilSoapAdministration\__getMessage(), ilSoapAdministration\__getMessageCode(), ilSoapAdministration\__raiseError(), ilObject\_getAllReferences(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObjectFactory\getInstanceByObjId(), ilSoapAdministration\initAuth(), and ilSoapAdministration\initIlias().
120 if (!$this->__checkSession($sid)) {
123 global $rbacsystem, $tree,
$ilLog;
126 return $this->
__raiseError(
'Cannot perform update since exercise has been deleted.',
'CLIENT_OBJECT_DELETED');
131 'No exercise found for id: ' . $ref_id,
132 'CLIENT_OBJECT_NOT_FOUND' 137 $permission_ok =
false;
139 if ($rbacsystem->checkAccess(
'edit', $ref_id)) {
140 $permission_ok =
true;
145 if (!$permission_ok) {
147 'No permission to edit the exercise with id: ' . $ref_id,
155 if (!is_object($exercise) || $exercise->getType()!=
"exc") {
157 'Wrong obj id or type for exercise with id ' . $ref_id,
158 'CLIENT_OBJECT_NOI_FOUND' 162 include_once
'./Modules/Exercise/classes/class.ilExerciseXMLParser.php';
163 include_once
'./Modules/Exercise/exceptions/class.ilExerciseException.php';
167 if ($exerciseXMLParser->start()) {
168 $exerciseXMLParser->getAssignment()->update();
169 return $exercise->update();
174 $exception->getMessage(),
static _isInTrash($a_ref_id)
checks wether object is in trash
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjectId($a_ref_id)
lookup object id
__raiseError($a_message, $a_code)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
initAuth($sid)
Init authentication.
Exercise XML Parser which completes/updates a given exercise by an xml string.
Exercise exceptions class.
The documentation for this class was generated from the following file: