ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilWikiContributor Class Reference

Class ilWikiContributor. More...

+ Collaboration diagram for ilWikiContributor:

Static Public Member Functions

static _lookupStatus ($a_obj_id, $a_user_id)
 Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED) More...
 
static _lookupStatusTime ($a_obj_id, $a_user_id)
 Lookup last change in mark or success status. More...
 
static _writeStatus ($a_obj_id, $a_user_id, $a_status)
 Write success status. More...
 

Data Fields

const STATUS_NOT_GRADED = 0
 
const STATUS_PASSED = 1
 
const STATUS_FAILED = 2
 

Detailed Description

Class ilWikiContributor.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 33 of file class.ilWikiContributor.php.

Member Function Documentation

◆ _lookupStatus()

static ilWikiContributor::_lookupStatus (   $a_obj_id,
  $a_user_id 
)
static

Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED)

Parameters
int$a_obj_idexercise id
int$a_user_idmember id
Returns
mixed false (if user is no member) or notgraded|passed|failed

Definition at line 46 of file class.ilWikiContributor.php.

References $DIC, $ilDB, $row, and array.

Referenced by ilWikiContributorsTableGUI\fillRow(), ilObjWikiGUI\infoScreen(), and ilObjWikiGUI\saveGradingObject().

47  {
48  global $DIC;
49 
50  $ilDB = $DIC->database();
51 
52  $set = $ilDB->queryF(
53  "SELECT status FROM il_wiki_contributor " .
54  "WHERE wiki_id = %s and user_id = %s",
55  array("integer", "integer"),
56  array($a_obj_id, $a_user_id)
57  );
58  if ($row = $ilDB->fetchAssoc($set)) {
59  return $row["status"];
60  }
61  return false;
62  }
global $DIC
Definition: saml.php:7
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupStatusTime()

static ilWikiContributor::_lookupStatusTime (   $a_obj_id,
  $a_user_id 
)
static

Lookup last change in mark or success status.

Parameters
int$a_obj_idexercise id
int$a_user_idmember id
Returns
mixed false (if user is no member) or notgraded|passed|failed

Definition at line 71 of file class.ilWikiContributor.php.

References $DIC, $ilDB, $row, and array.

Referenced by ilWikiContributorsTableGUI\fillRow().

72  {
73  global $DIC;
74 
75  $ilDB = $DIC->database();
76 
77  $set = $ilDB->queryF(
78  "SELECT status_time FROM il_wiki_contributor " .
79  "WHERE wiki_id = %s and user_id = %s",
80  array("integer", "integer"),
81  array($a_obj_id, $a_user_id)
82  );
83  if ($row = $ilDB->fetchAssoc($set)) {
84  return $row["status_time"];
85  }
86  return false;
87  }
global $DIC
Definition: saml.php:7
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ _writeStatus()

static ilWikiContributor::_writeStatus (   $a_obj_id,
  $a_user_id,
  $a_status 
)
static

Write success status.

Parameters
int$a_obj_idexercise id
int$a_user_idmember id
int$statusstatus: STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED
Returns
int number of affected rows

Definition at line 98 of file class.ilWikiContributor.php.

References $DIC, $ilDB, array, and ilUtil\now().

Referenced by ilObjWikiGUI\saveGradingObject().

99  {
100  global $DIC;
101 
102  $ilDB = $DIC->database();
103 
104  $ilDB->manipulate("DELETE FROM il_wiki_contributor WHERE " .
105  " wiki_id = " . $ilDB->quote($a_obj_id, "integer") .
106  " AND user_id = " . $ilDB->quote($a_user_id, "integer"));
107 
108  $ilDB->manipulateF(
109  "INSERT INTO il_wiki_contributor (status, wiki_id, user_id, status_time) " .
110  "VALUES (%s,%s,%s,%s)",
111  array("integer", "integer", "integer", "timestamp"),
112  array($a_status, $a_obj_id, $a_user_id, ilUtil::now())
113  );
114  }
global $DIC
Definition: saml.php:7
static now()
Return current timestamp in Y-m-d H:i:s format.
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ STATUS_FAILED

const ilWikiContributor::STATUS_FAILED = 2

◆ STATUS_NOT_GRADED

const ilWikiContributor::STATUS_NOT_GRADED = 0

◆ STATUS_PASSED

const ilWikiContributor::STATUS_PASSED = 1

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