StudentSubmission.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Classroom;
  18. class StudentSubmission extends \Google\Collection
  19. {
  20. /**
  21. * No work type specified. This is never returned.
  22. */
  23. public const COURSE_WORK_TYPE_COURSE_WORK_TYPE_UNSPECIFIED = 'COURSE_WORK_TYPE_UNSPECIFIED';
  24. /**
  25. * An assignment.
  26. */
  27. public const COURSE_WORK_TYPE_ASSIGNMENT = 'ASSIGNMENT';
  28. /**
  29. * A short answer question.
  30. */
  31. public const COURSE_WORK_TYPE_SHORT_ANSWER_QUESTION = 'SHORT_ANSWER_QUESTION';
  32. /**
  33. * A multiple-choice question.
  34. */
  35. public const COURSE_WORK_TYPE_MULTIPLE_CHOICE_QUESTION = 'MULTIPLE_CHOICE_QUESTION';
  36. /**
  37. * No state specified. This should never be returned.
  38. */
  39. public const STATE_SUBMISSION_STATE_UNSPECIFIED = 'SUBMISSION_STATE_UNSPECIFIED';
  40. /**
  41. * The student has never accessed this submission. Attachments are not
  42. * returned and timestamps is not set.
  43. */
  44. public const STATE_NEW = 'NEW';
  45. /**
  46. * Has been created.
  47. */
  48. public const STATE_CREATED = 'CREATED';
  49. /**
  50. * Has been turned in to the teacher.
  51. */
  52. public const STATE_TURNED_IN = 'TURNED_IN';
  53. /**
  54. * Has been returned to the student.
  55. */
  56. public const STATE_RETURNED = 'RETURNED';
  57. /**
  58. * Student chose to "unsubmit" the assignment.
  59. */
  60. public const STATE_RECLAIMED_BY_STUDENT = 'RECLAIMED_BY_STUDENT';
  61. protected $collection_key = 'submissionHistory';
  62. /**
  63. * Absolute link to the submission in the Classroom web UI. Read-only.
  64. *
  65. * @var string
  66. */
  67. public $alternateLink;
  68. /**
  69. * Optional grade. If unset, no grade was set. This value must be non-
  70. * negative. Decimal (that is, non-integer) values are allowed, but are
  71. * rounded to two decimal places. This may be modified only by course
  72. * teachers.
  73. *
  74. * @var
  75. */
  76. public $assignedGrade;
  77. protected $assignedRubricGradesType = RubricGrade::class;
  78. protected $assignedRubricGradesDataType = 'map';
  79. protected $assignmentSubmissionType = AssignmentSubmission::class;
  80. protected $assignmentSubmissionDataType = '';
  81. /**
  82. * Whether this student submission is associated with the Developer Console
  83. * project making the request. See CreateCourseWork for more details. Read-
  84. * only.
  85. *
  86. * @var bool
  87. */
  88. public $associatedWithDeveloper;
  89. /**
  90. * Identifier of the course. Read-only.
  91. *
  92. * @var string
  93. */
  94. public $courseId;
  95. /**
  96. * Identifier for the course work this corresponds to. Read-only.
  97. *
  98. * @var string
  99. */
  100. public $courseWorkId;
  101. /**
  102. * Type of course work this submission is for. Read-only.
  103. *
  104. * @var string
  105. */
  106. public $courseWorkType;
  107. /**
  108. * Creation time of this submission. This may be unset if the student has not
  109. * accessed this item. Read-only.
  110. *
  111. * @var string
  112. */
  113. public $creationTime;
  114. /**
  115. * Optional pending grade. If unset, no grade was set. This value must be non-
  116. * negative. Decimal (that is, non-integer) values are allowed, but are
  117. * rounded to two decimal places. This is only visible to and modifiable by
  118. * course teachers.
  119. *
  120. * @var
  121. */
  122. public $draftGrade;
  123. protected $draftRubricGradesType = RubricGrade::class;
  124. protected $draftRubricGradesDataType = 'map';
  125. /**
  126. * Classroom-assigned Identifier for the student submission. This is unique
  127. * among submissions for the relevant course work. Read-only.
  128. *
  129. * @var string
  130. */
  131. public $id;
  132. /**
  133. * Whether this submission is late. Read-only.
  134. *
  135. * @var bool
  136. */
  137. public $late;
  138. protected $multipleChoiceSubmissionType = MultipleChoiceSubmission::class;
  139. protected $multipleChoiceSubmissionDataType = '';
  140. protected $shortAnswerSubmissionType = ShortAnswerSubmission::class;
  141. protected $shortAnswerSubmissionDataType = '';
  142. /**
  143. * State of this submission. Read-only.
  144. *
  145. * @var string
  146. */
  147. public $state;
  148. protected $submissionHistoryType = SubmissionHistory::class;
  149. protected $submissionHistoryDataType = 'array';
  150. /**
  151. * Last update time of this submission. This may be unset if the student has
  152. * not accessed this item. Read-only.
  153. *
  154. * @var string
  155. */
  156. public $updateTime;
  157. /**
  158. * Identifier for the student that owns this submission. Read-only.
  159. *
  160. * @var string
  161. */
  162. public $userId;
  163. /**
  164. * Absolute link to the submission in the Classroom web UI. Read-only.
  165. *
  166. * @param string $alternateLink
  167. */
  168. public function setAlternateLink($alternateLink)
  169. {
  170. $this->alternateLink = $alternateLink;
  171. }
  172. /**
  173. * @return string
  174. */
  175. public function getAlternateLink()
  176. {
  177. return $this->alternateLink;
  178. }
  179. public function setAssignedGrade($assignedGrade)
  180. {
  181. $this->assignedGrade = $assignedGrade;
  182. }
  183. public function getAssignedGrade()
  184. {
  185. return $this->assignedGrade;
  186. }
  187. /**
  188. * Assigned rubric grades based on the rubric's Criteria. This map is empty if
  189. * there is no rubric attached to this course work or if a rubric is attached,
  190. * but no grades have been set on any Criteria. Entries are only populated for
  191. * grades that have been set. Key: The rubric's criterion ID. Read-only.
  192. *
  193. * @param RubricGrade[] $assignedRubricGrades
  194. */
  195. public function setAssignedRubricGrades($assignedRubricGrades)
  196. {
  197. $this->assignedRubricGrades = $assignedRubricGrades;
  198. }
  199. /**
  200. * @return RubricGrade[]
  201. */
  202. public function getAssignedRubricGrades()
  203. {
  204. return $this->assignedRubricGrades;
  205. }
  206. /**
  207. * Submission content when course_work_type is ASSIGNMENT. Students can modify
  208. * this content using ModifyAttachments.
  209. *
  210. * @param AssignmentSubmission $assignmentSubmission
  211. */
  212. public function setAssignmentSubmission(AssignmentSubmission $assignmentSubmission)
  213. {
  214. $this->assignmentSubmission = $assignmentSubmission;
  215. }
  216. /**
  217. * @return AssignmentSubmission
  218. */
  219. public function getAssignmentSubmission()
  220. {
  221. return $this->assignmentSubmission;
  222. }
  223. /**
  224. * Whether this student submission is associated with the Developer Console
  225. * project making the request. See CreateCourseWork for more details. Read-
  226. * only.
  227. *
  228. * @param bool $associatedWithDeveloper
  229. */
  230. public function setAssociatedWithDeveloper($associatedWithDeveloper)
  231. {
  232. $this->associatedWithDeveloper = $associatedWithDeveloper;
  233. }
  234. /**
  235. * @return bool
  236. */
  237. public function getAssociatedWithDeveloper()
  238. {
  239. return $this->associatedWithDeveloper;
  240. }
  241. /**
  242. * Identifier of the course. Read-only.
  243. *
  244. * @param string $courseId
  245. */
  246. public function setCourseId($courseId)
  247. {
  248. $this->courseId = $courseId;
  249. }
  250. /**
  251. * @return string
  252. */
  253. public function getCourseId()
  254. {
  255. return $this->courseId;
  256. }
  257. /**
  258. * Identifier for the course work this corresponds to. Read-only.
  259. *
  260. * @param string $courseWorkId
  261. */
  262. public function setCourseWorkId($courseWorkId)
  263. {
  264. $this->courseWorkId = $courseWorkId;
  265. }
  266. /**
  267. * @return string
  268. */
  269. public function getCourseWorkId()
  270. {
  271. return $this->courseWorkId;
  272. }
  273. /**
  274. * Type of course work this submission is for. Read-only.
  275. *
  276. * Accepted values: COURSE_WORK_TYPE_UNSPECIFIED, ASSIGNMENT,
  277. * SHORT_ANSWER_QUESTION, MULTIPLE_CHOICE_QUESTION
  278. *
  279. * @param self::COURSE_WORK_TYPE_* $courseWorkType
  280. */
  281. public function setCourseWorkType($courseWorkType)
  282. {
  283. $this->courseWorkType = $courseWorkType;
  284. }
  285. /**
  286. * @return self::COURSE_WORK_TYPE_*
  287. */
  288. public function getCourseWorkType()
  289. {
  290. return $this->courseWorkType;
  291. }
  292. /**
  293. * Creation time of this submission. This may be unset if the student has not
  294. * accessed this item. Read-only.
  295. *
  296. * @param string $creationTime
  297. */
  298. public function setCreationTime($creationTime)
  299. {
  300. $this->creationTime = $creationTime;
  301. }
  302. /**
  303. * @return string
  304. */
  305. public function getCreationTime()
  306. {
  307. return $this->creationTime;
  308. }
  309. public function setDraftGrade($draftGrade)
  310. {
  311. $this->draftGrade = $draftGrade;
  312. }
  313. public function getDraftGrade()
  314. {
  315. return $this->draftGrade;
  316. }
  317. /**
  318. * Pending rubric grades based on the rubric's criteria. This map is empty if
  319. * there is no rubric attached to this course work or if a rubric is attached,
  320. * but no grades have been set on any criteria. Entries are only populated for
  321. * grades that have been set. Key: The rubric's criterion ID. Read-only.
  322. *
  323. * @param RubricGrade[] $draftRubricGrades
  324. */
  325. public function setDraftRubricGrades($draftRubricGrades)
  326. {
  327. $this->draftRubricGrades = $draftRubricGrades;
  328. }
  329. /**
  330. * @return RubricGrade[]
  331. */
  332. public function getDraftRubricGrades()
  333. {
  334. return $this->draftRubricGrades;
  335. }
  336. /**
  337. * Classroom-assigned Identifier for the student submission. This is unique
  338. * among submissions for the relevant course work. Read-only.
  339. *
  340. * @param string $id
  341. */
  342. public function setId($id)
  343. {
  344. $this->id = $id;
  345. }
  346. /**
  347. * @return string
  348. */
  349. public function getId()
  350. {
  351. return $this->id;
  352. }
  353. /**
  354. * Whether this submission is late. Read-only.
  355. *
  356. * @param bool $late
  357. */
  358. public function setLate($late)
  359. {
  360. $this->late = $late;
  361. }
  362. /**
  363. * @return bool
  364. */
  365. public function getLate()
  366. {
  367. return $this->late;
  368. }
  369. /**
  370. * Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION.
  371. *
  372. * @param MultipleChoiceSubmission $multipleChoiceSubmission
  373. */
  374. public function setMultipleChoiceSubmission(MultipleChoiceSubmission $multipleChoiceSubmission)
  375. {
  376. $this->multipleChoiceSubmission = $multipleChoiceSubmission;
  377. }
  378. /**
  379. * @return MultipleChoiceSubmission
  380. */
  381. public function getMultipleChoiceSubmission()
  382. {
  383. return $this->multipleChoiceSubmission;
  384. }
  385. /**
  386. * Submission content when course_work_type is SHORT_ANSWER_QUESTION.
  387. *
  388. * @param ShortAnswerSubmission $shortAnswerSubmission
  389. */
  390. public function setShortAnswerSubmission(ShortAnswerSubmission $shortAnswerSubmission)
  391. {
  392. $this->shortAnswerSubmission = $shortAnswerSubmission;
  393. }
  394. /**
  395. * @return ShortAnswerSubmission
  396. */
  397. public function getShortAnswerSubmission()
  398. {
  399. return $this->shortAnswerSubmission;
  400. }
  401. /**
  402. * State of this submission. Read-only.
  403. *
  404. * Accepted values: SUBMISSION_STATE_UNSPECIFIED, NEW, CREATED, TURNED_IN,
  405. * RETURNED, RECLAIMED_BY_STUDENT
  406. *
  407. * @param self::STATE_* $state
  408. */
  409. public function setState($state)
  410. {
  411. $this->state = $state;
  412. }
  413. /**
  414. * @return self::STATE_*
  415. */
  416. public function getState()
  417. {
  418. return $this->state;
  419. }
  420. /**
  421. * The history of the submission (includes state and grade histories). Read-
  422. * only.
  423. *
  424. * @param SubmissionHistory[] $submissionHistory
  425. */
  426. public function setSubmissionHistory($submissionHistory)
  427. {
  428. $this->submissionHistory = $submissionHistory;
  429. }
  430. /**
  431. * @return SubmissionHistory[]
  432. */
  433. public function getSubmissionHistory()
  434. {
  435. return $this->submissionHistory;
  436. }
  437. /**
  438. * Last update time of this submission. This may be unset if the student has
  439. * not accessed this item. Read-only.
  440. *
  441. * @param string $updateTime
  442. */
  443. public function setUpdateTime($updateTime)
  444. {
  445. $this->updateTime = $updateTime;
  446. }
  447. /**
  448. * @return string
  449. */
  450. public function getUpdateTime()
  451. {
  452. return $this->updateTime;
  453. }
  454. /**
  455. * Identifier for the student that owns this submission. Read-only.
  456. *
  457. * @param string $userId
  458. */
  459. public function setUserId($userId)
  460. {
  461. $this->userId = $userId;
  462. }
  463. /**
  464. * @return string
  465. */
  466. public function getUserId()
  467. {
  468. return $this->userId;
  469. }
  470. }
  471. // Adding a class alias for backwards compatibility with the previous class name.
  472. class_alias(StudentSubmission::class, 'Google_Service_Classroom_StudentSubmission');