ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAsqService Class Reference
+ Collaboration diagram for ilAsqService:

Public Member Functions

 fetchNextAuthoringCommandClass ($nextClass)
 
 determineQuestionTypeByQtiItem (ilQTIItem $qtiItem)
 
 questionTitleExists ($parentObjectId, $questionTitle)
 

Detailed Description

Definition at line 13 of file class.ilAsqService.php.

Member Function Documentation

◆ determineQuestionTypeByQtiItem()

ilAsqService::determineQuestionTypeByQtiItem ( ilQTIItem  $qtiItem)
Parameters
ilQTIItem$qtiItem
Returns
string

Definition at line 44 of file class.ilAsqService.php.

References ilQTIItem\getQuestiontype().

44  : string
45  {
46  // the qti service parses ILIAS question types, so use it
47  // although this may get changed in the future
48  return $qtiItem->getQuestiontype();
49  }
+ Here is the call graph for this function:

◆ fetchNextAuthoringCommandClass()

ilAsqService::fetchNextAuthoringCommandClass (   $nextClass)
Parameters
ilCtrl$ctrl
Returns
string

Definition at line 19 of file class.ilAsqService.php.

References $DIC.

19  : string
20  {
21  global $DIC; /* @var ILIAS\DI\Container $DIC */
22 
23  $row = $DIC->database()->fetchAssoc($DIC->database()->queryF(
24  "SELECT COUNT(question_type_id) cnt FROM qpl_qst_type WHERE ctrl_class = %s",
25  array('text'),
26  array($nextClass)
27  ));
28 
29  if ($row['cnt']) {
30  // current next class is indeed an authoring ctrl class,
31  // return it to have the switch(nextclass) case matching
32  return $nextClass;
33  }
34 
35  // the interface that NOT represents a valid ctrl class,
36  // this will lead to a non matching switch(nextclass) case
37  return 'ilasqquestionauthoring';
38  }
global $DIC
Definition: feed.php:28

◆ questionTitleExists()

ilAsqService::questionTitleExists (   $parentObjectId,
  $questionTitle 
)
Parameters
integer$parentObjectId
string$questionTitle
Returns
bool

Definition at line 56 of file class.ilAsqService.php.

References $DIC.

56  : bool
57  {
58  global $DIC; /* @var ILIAS\DI\Container $DIC */
59 
60  $row = $DIC->database()->fetchAssoc($DIC->database()->queryF(
61  "SELECT COUNT(question_id) cnt FROM qpl_questions WHERE obj_fi = %s AND title = %s",
62  array('integer', 'text'),
63  array($parentObjectId, $questionTitle)
64  ));
65 
66  return $row['cnt'] > 0;
67  }
global $DIC
Definition: feed.php:28

The documentation for this class was generated from the following file: