Classes Xapi#265
Open
Mandvii wants to merge 17 commits into
Open
Conversation
mikedawson
reviewed
Jun 5, 2026
| */ | ||
| const val ID_ASSIGN = "http://activitystrea.ms/schema/1.0/assign" | ||
|
|
||
| private const val ID_TYPE_CLASS = "http://id.openeel.org/xapi/activity-type/class" |
Member
There was a problem hiding this comment.
These do not belong here on XapiVerb: they are not verb ids, and are not related to verbs.
- Add `XapiClassExt.kt` with extension properties and helper functions for handling class-management xAPI statements. - Update `ClazzEditViewModel` and `ClazzEditScreen` to use `XapiStatement` as the primary data model instead of the legacy `Clazz` model. - Implement xAPI-based persistence in `ClazzEditViewModel` using `XapiStatementsResource`.
- Add `XapiClassExt.kt` with extension properties and helper functions for handling class-management xAPI statements. - Update `ClazzEditViewModel` and `ClazzEditScreen` to use `XapiStatement` as the primary data model instead of the legacy `Clazz` model. - Implement xAPI-based persistence in `ClazzEditViewModel` using `XapiStatementsResource`.
- Add `XapiClassExt.kt` with extension properties and helper functions for handling class-management xAPI statements. - Update `ClazzEditViewModel` and `ClazzEditScreen` to use `XapiStatement` as the primary data model instead of the legacy `Clazz` model. - Implement xAPI-based persistence in `ClazzEditViewModel` using `XapiStatementsResource`.
mikedawson
reviewed
Jun 9, 2026
| * The activity definition name for a class statement. | ||
| */ | ||
| @OptIn(ExperimentalUuidApi::class) | ||
| val XapiStatement.classDefinitionTitle: String |
Collaborator
Author
There was a problem hiding this comment.
For Class title and description I referred how things are done in XapiAssignmentExt so similarly i did in the XapiClassExt so shall i follow the same way or is there any better way to do it
@OptIn(ExperimentalUuidApi::class)
val XapiStatement.activityDefinitionTitle: String
get() = (this.`object` as? XapiActivity)?.definition?.name?.values?.firstOrNull() ?: ""
val XapiStatement.assignmentDescription: String
get() = (this.`object` as? XapiActivity)?.definition?.description?.values?.firstOrNull() ?: ""
@OptIn(ExperimentalUuidApi::class)
val XapiStatement.classDefinitionTitle: String
get() = (this.`object` as? XapiActivity)?.definition?.name?.values?.firstOrNull() ?: ""
val XapiStatement.classDefinitionDescription: String
get() = (this.`object` as? XapiActivity)?.definition?.description?.values?.firstOrNull() ?: ""
mikedawson
reviewed
Jun 9, 2026
| import kotlin.uuid.ExperimentalUuidApi | ||
| import kotlin.uuid.Uuid | ||
|
|
||
| const val XAPI_LANG_KEY = "" |
Member
There was a problem hiding this comment.
@Mandvii this does not comply with the coding guidelines: a constant called "XAPI_LANG_KEY" that is a blank string (clearly not a valid language key).
Whilst it may be that the right way to do this is unclear, this is a clearly a wrong way and should not have been committed as per procedure.
… legacy `Clazz` data models. - Replace `Clazz` model usage with `XapiStatement` in `ClazzDetailViewModel` and `ClazzListViewModel`. - Update `ClazzDetailViewModel` to fetch class data via `schoolDataSource.xapiStatementsResource` using the activity ID from navigation. - Refactor `ClazzListViewModel` to filter and display the most recent class-related xAPI statements instead of using a paging source. - Update `ClazzDetailScreen` and `ClazzListScreen` to bind data from xAPI statement definitions (title and description). - Update navigation routes and related use cases to utilize activity IDs.
…es and descriptions. - Replace custom `classDefinitionTitle` and `classDefinitionDescription` extensions with standard `objectActivityNameOrNull` and `objectActivityOrNull` from the xAPI library. - Update `ClazzEditScreen` to use `LangMapTextField` for editing localized name and description maps. - Update `ClazzDetailViewModel`, `ClazzListScreen`, and `ClazzDetailScreen` to handle language map conversions for UI display using `asLangMapUiText` and `langMapString`. - Remove obsolete xAPI helper functions and constants from `XapiClassExt.kt`. - Move `ACTIVITY_ID_PATH` to `ClazzEditViewModel` companion object.
…ityId` extensions in `ClazzListScreen` and `ClazzListViewModel`.
…ta is missing during class creation or when statement data is null during save.
…PersonFromClass` within `ClazzDetailViewModel`.
…d `ClazzDetailScreen`.
…d `ClazzDetailScreen`.
…ClazzDetailViewModel`.
… `ClazzEditViewModel`.
… `ClazzEditViewModel`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.