Skip to content

Classes Xapi#265

Open
Mandvii wants to merge 17 commits into
mainfrom
dev-classes-xapi
Open

Classes Xapi#265
Mandvii wants to merge 17 commits into
mainfrom
dev-classes-xapi

Conversation

@Mandvii

@Mandvii Mandvii commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@divyahariharan2103 divyahariharan2103 linked an issue Jun 5, 2026 that may be closed by this pull request
*/
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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These do not belong here on XapiVerb: they are not verb ids, and are not related to verbs.

Mandvii added 4 commits June 8, 2026 23:08
- 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`.
* The activity definition name for a class statement.
*/
@OptIn(ExperimentalUuidApi::class)
val XapiStatement.classDefinitionTitle: String

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() ?: ""

import kotlin.uuid.ExperimentalUuidApi
import kotlin.uuid.Uuid

const val XAPI_LANG_KEY = ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Mandvii added 12 commits June 9, 2026 15:58
… 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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Classes saved using xAPI

2 participants