AssessmentListModel.swift 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. //
  2. // AssessmentListModel.swift
  3. // LMS
  4. //
  5. // Created by Suraj Kumar Mandal on 13/09/22.
  6. //
  7. // let assessmentList = try? newJSONDecoder().decode(AssessmentList.self, from: jsonData)
  8. import Foundation
  9. // MARK: - AssessmentListModel
  10. class AssessmentListModel: Codable {
  11. var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String?
  12. var id: Int?
  13. var assessment: Assessment?
  14. var batches: [AssessmentBatch]?
  15. var status, comments, startDateTime, endDateTime: String?
  16. var source, scheduleAssessmentCreatorName, scheduleAssessmentApproverName, scheduleAssessmentApprovedDateTime: JSONNull?
  17. var attempted: Bool?
  18. init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, assessment: Assessment?, batches: [AssessmentBatch]?, status: String?, comments: String?, startDateTime: String?, endDateTime: String?, source: JSONNull?, scheduleAssessmentCreatorName: JSONNull?, scheduleAssessmentApproverName: JSONNull?, scheduleAssessmentApprovedDateTime: JSONNull?, attempted: Bool?) {
  19. self.createdBy = createdBy
  20. self.createdDate = createdDate
  21. self.lastModifiedBy = lastModifiedBy
  22. self.lastModifiedDate = lastModifiedDate
  23. self.id = id
  24. self.assessment = assessment
  25. self.batches = batches
  26. self.status = status
  27. self.comments = comments
  28. self.startDateTime = startDateTime
  29. self.endDateTime = endDateTime
  30. self.source = source
  31. self.scheduleAssessmentCreatorName = scheduleAssessmentCreatorName
  32. self.scheduleAssessmentApproverName = scheduleAssessmentApproverName
  33. self.scheduleAssessmentApprovedDateTime = scheduleAssessmentApprovedDateTime
  34. self.attempted = attempted
  35. }
  36. }
  37. // MARK: - Assessment
  38. class Assessment: Codable {
  39. var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String?
  40. var id: Int?
  41. var intervention: AssessmentIntervention?
  42. var level: AssessmentLevel?
  43. var unit: AssessmentUnit?
  44. var lesson: AssessmentLesson?
  45. var type, mode, name, status: String?
  46. var comments: String?
  47. var totalMarks, negativeMarkPerQuestion, totalQuestions: Int?
  48. var fileId, fileType: String?
  49. var assessmentCreatorName, assessmentApproverName, assessmentApprovedDateTime: JSONNull?
  50. var negative, randomized: Bool?
  51. init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, intervention: AssessmentIntervention?, level: AssessmentLevel?, unit: AssessmentUnit?, lesson: AssessmentLesson?, type: String?, mode: String?, name: String?, status: String?, comments: String?, totalMarks: Int?, negativeMarkPerQuestion: Int?, totalQuestions: Int?, fileId: String?, fileType: String?, assessmentCreatorName: JSONNull?, assessmentApproverName: JSONNull?, assessmentApprovedDateTime: JSONNull?, negative: Bool?, randomized: Bool?) {
  52. self.createdBy = createdBy
  53. self.createdDate = createdDate
  54. self.lastModifiedBy = lastModifiedBy
  55. self.lastModifiedDate = lastModifiedDate
  56. self.id = id
  57. self.intervention = intervention
  58. self.level = level
  59. self.unit = unit
  60. self.lesson = lesson
  61. self.type = type
  62. self.mode = mode
  63. self.name = name
  64. self.status = status
  65. self.comments = comments
  66. self.totalMarks = totalMarks
  67. self.negativeMarkPerQuestion = negativeMarkPerQuestion
  68. self.totalQuestions = totalQuestions
  69. self.fileId = fileId
  70. self.fileType = fileType
  71. self.assessmentCreatorName = assessmentCreatorName
  72. self.assessmentApproverName = assessmentApproverName
  73. self.assessmentApprovedDateTime = assessmentApprovedDateTime
  74. self.negative = negative
  75. self.randomized = randomized
  76. }
  77. }
  78. // MARK: - AssessmentIntervention
  79. class AssessmentIntervention: Codable {
  80. var id, incrementor: Int?
  81. var interventionId, interventionName: String?
  82. var interventionLevels: [String]?
  83. var beneficiaryIds: [Int]?
  84. var deleted, active: Bool?
  85. var status: String?
  86. var interventionSchoolMappings, mappedProgramHeads: JSONNull?
  87. var levels: [Level]?
  88. init(id: Int?, incrementor: Int?, interventionId: String?, interventionName: String?, interventionLevels: [String]?, beneficiaryIds: [Int]?, deleted: Bool?, active: Bool?, status: String?, interventionSchoolMappings: JSONNull?, mappedProgramHeads: JSONNull?, levels: [Level]?) {
  89. self.id = id
  90. self.incrementor = incrementor
  91. self.interventionId = interventionId
  92. self.interventionName = interventionName
  93. self.interventionLevels = interventionLevels
  94. self.beneficiaryIds = beneficiaryIds
  95. self.deleted = deleted
  96. self.active = active
  97. self.status = status
  98. self.interventionSchoolMappings = interventionSchoolMappings
  99. self.mappedProgramHeads = mappedProgramHeads
  100. self.levels = levels
  101. }
  102. }
  103. // MARK: - AssessmentLevel
  104. class AssessmentLevel: Codable {
  105. var id, interventionTableId: Int?
  106. var interventionLevels: String?
  107. init(id: Int?, interventionTableId: Int?, interventionLevels: String?) {
  108. self.id = id
  109. self.interventionTableId = interventionTableId
  110. self.interventionLevels = interventionLevels
  111. }
  112. }
  113. // MARK: - AssessmentLesson
  114. class AssessmentLesson: Codable {
  115. var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String?
  116. var id: Int?
  117. var name: String?
  118. var lessonCreatedUserName, lessonApprovedUserName, lessonApprovedDateTime: JSONNull?
  119. var status, comments: String?
  120. var unit: AssessmentUnit?
  121. init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, name: String?, lessonCreatedUserName: JSONNull?, lessonApprovedUserName: JSONNull?, lessonApprovedDateTime: JSONNull?, status: String?, comments: String?, unit: AssessmentUnit?) {
  122. self.createdBy = createdBy
  123. self.createdDate = createdDate
  124. self.lastModifiedBy = lastModifiedBy
  125. self.lastModifiedDate = lastModifiedDate
  126. self.id = id
  127. self.name = name
  128. self.lessonCreatedUserName = lessonCreatedUserName
  129. self.lessonApprovedUserName = lessonApprovedUserName
  130. self.lessonApprovedDateTime = lessonApprovedDateTime
  131. self.status = status
  132. self.comments = comments
  133. self.unit = unit
  134. }
  135. }
  136. // MARK: - AssessmentUnit
  137. class AssessmentUnit: Codable {
  138. var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String?
  139. var id: Int?
  140. var academicYear, name: String?
  141. var unitCreatedUserName, unitApprovedUserName, unitApprovedDateTime: JSONNull?
  142. var status: String?
  143. var intervention: AssessmentIntervention?
  144. var level: Level?
  145. var comments: String?
  146. init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, academicYear: String?, name: String?, unitCreatedUserName: JSONNull?, unitApprovedUserName: JSONNull?, unitApprovedDateTime: JSONNull?, status: String?, intervention: AssessmentIntervention?, level: Level?, comments: String?) {
  147. self.createdBy = createdBy
  148. self.createdDate = createdDate
  149. self.lastModifiedBy = lastModifiedBy
  150. self.lastModifiedDate = lastModifiedDate
  151. self.id = id
  152. self.academicYear = academicYear
  153. self.name = name
  154. self.unitCreatedUserName = unitCreatedUserName
  155. self.unitApprovedUserName = unitApprovedUserName
  156. self.unitApprovedDateTime = unitApprovedDateTime
  157. self.status = status
  158. self.intervention = intervention
  159. self.level = level
  160. self.comments = comments
  161. }
  162. }
  163. // MARK: - AssessmentBatch
  164. class AssessmentBatch: Codable {
  165. var createdBy, createdDate, lastModifiedBy, lastModifiedDate: String?
  166. var id: Int?
  167. var academicYear, batchName: String?
  168. var studentBatch, deleted, active: Bool?
  169. var status, comments: String?
  170. var interventionDTO: AssessmentIntervention?
  171. var schoolDTO: AssessmentSchoolDTO?
  172. var batachUserDtos: [AssessmentBatachUserDto]?
  173. var level: Level?
  174. var createdByUser, approvedByUser, approvalDateTime: JSONNull?
  175. init(createdBy: String?, createdDate: String?, lastModifiedBy: String?, lastModifiedDate: String?, id: Int?, academicYear: String?, batchName: String?, studentBatch: Bool?, deleted: Bool?, active: Bool?, status: String?, comments: String?, interventionDTO: AssessmentIntervention?, schoolDTO: AssessmentSchoolDTO?, batachUserDtos: [AssessmentBatachUserDto]?, level: Level?, createdByUser: JSONNull?, approvedByUser: JSONNull?, approvalDateTime: JSONNull?) {
  176. self.createdBy = createdBy
  177. self.createdDate = createdDate
  178. self.lastModifiedBy = lastModifiedBy
  179. self.lastModifiedDate = lastModifiedDate
  180. self.id = id
  181. self.academicYear = academicYear
  182. self.batchName = batchName
  183. self.studentBatch = studentBatch
  184. self.deleted = deleted
  185. self.active = active
  186. self.status = status
  187. self.comments = comments
  188. self.interventionDTO = interventionDTO
  189. self.schoolDTO = schoolDTO
  190. self.batachUserDtos = batachUserDtos
  191. self.level = level
  192. self.createdByUser = createdByUser
  193. self.approvedByUser = approvedByUser
  194. self.approvalDateTime = approvalDateTime
  195. }
  196. }
  197. // MARK: - AssessmentBatachUserDto
  198. class AssessmentBatachUserDto: Codable {
  199. var userDto: AssessmentUserDto?
  200. var standard, division: String?
  201. var offlineAttendance: JSONNull?
  202. init(userDto: AssessmentUserDto?, standard: String?, division: String?, offlineAttendance: JSONNull?) {
  203. self.userDto = userDto
  204. self.standard = standard
  205. self.division = division
  206. self.offlineAttendance = offlineAttendance
  207. }
  208. }
  209. // MARK: - AssessmentUserDto
  210. class AssessmentUserDto: Codable {
  211. var id: Int?
  212. var name: String?
  213. var middleName: String?
  214. var lastName, username, email: String?
  215. var mobile: String?
  216. var schoolName: JSONNull?
  217. var userType: AssessmentUserType?
  218. var keycloakUserId: String?
  219. var enable, tempPass: Bool?
  220. var batchId: Int?
  221. var intervantions: [Int]?
  222. var password, errorMsg: JSONNull?
  223. init(id: Int?, name: String?, middleName: String?, lastName: String?, username: String?, email: String?, mobile: String?, schoolName: JSONNull?, userType: AssessmentUserType?, keycloakUserId: String?, enable: Bool?, tempPass: Bool?, batchId: Int?, intervantions: [Int]?, password: JSONNull?, errorMsg: JSONNull?) {
  224. self.id = id
  225. self.name = name
  226. self.middleName = middleName
  227. self.lastName = lastName
  228. self.username = username
  229. self.email = email
  230. self.mobile = mobile
  231. self.schoolName = schoolName
  232. self.userType = userType
  233. self.keycloakUserId = keycloakUserId
  234. self.enable = enable
  235. self.tempPass = tempPass
  236. self.batchId = batchId
  237. self.intervantions = intervantions
  238. self.password = password
  239. self.errorMsg = errorMsg
  240. }
  241. }
  242. // MARK: - AssessmentUserType
  243. class AssessmentUserType: Codable {
  244. var id: Int?
  245. var actor, parentActor, discription, defaultRealmRole: String?
  246. var createAccess, deleteAccess, editAccess, viewAccess: String?
  247. var appUrl: String?
  248. init(id: Int?, actor: String?, parentActor: String?, discription: String?, defaultRealmRole: String?, createAccess: String?, deleteAccess: String?, editAccess: String?, viewAccess: String?, appUrl: String?) {
  249. self.id = id
  250. self.actor = actor
  251. self.parentActor = parentActor
  252. self.discription = discription
  253. self.defaultRealmRole = defaultRealmRole
  254. self.createAccess = createAccess
  255. self.deleteAccess = deleteAccess
  256. self.editAccess = editAccess
  257. self.viewAccess = viewAccess
  258. self.appUrl = appUrl
  259. }
  260. }
  261. // MARK: - AssessmentSchoolDTO
  262. class AssessmentSchoolDTO: Codable {
  263. var schoolId, schoolName, state, city: String?
  264. var pincode: Int?
  265. var active, deleted: Bool?
  266. var status: JSONNull?
  267. init(schoolId: String?, schoolName: String?, state: String?, city: String?, pincode: Int?, active: Bool?, deleted: Bool?, status: JSONNull?) {
  268. self.schoolId = schoolId
  269. self.schoolName = schoolName
  270. self.state = state
  271. self.city = city
  272. self.pincode = pincode
  273. self.active = active
  274. self.deleted = deleted
  275. self.status = status
  276. }
  277. }
  278. typealias AssessmentList = [AssessmentListModel]