Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use html in xAPI language fields #10

Open
garemoko opened this issue Jan 2, 2017 · 9 comments
Open

Don't use html in xAPI language fields #10

garemoko opened this issue Jan 2, 2017 · 9 comments

Comments

@garemoko
Copy link

garemoko commented Jan 2, 2017

The description.en-US field concatenates the Task Description and Text Field with a <br/> tag to separate them. HTML is not allowed in these fields however and will lead to formatting problems when the data is displayed in reports not specifically designed for H5P. Instead, I recommend separating these fields by a space or possibly even some text e.g.

<task description> Text Field: <text field>

@thomasmars
Copy link
Member

Thanks. HTML is prohibited in all language fields ? What is the standard way of representing newlines ?
I have created an issue for fixing this at: https://h5ptechnology.atlassian.net/browse/HFP-428

@garemoko
Copy link
Author

garemoko commented Jan 3, 2017

Yes. Strictly speaking it's not probihited but the field is plain text so any html should be assumed to be part of the text, e.g. in an exam question about html: what does the <br/> tag mean?

See https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#42-language-maps

I don't think there's any good way to include new lines in those fields.

@thomasmars
Copy link
Member

I see, thanks for the clarification.
Is it okay to include html codes in custom fields, e.g. extensions or for instance a "long-fill-in" ?

@garemoko
Copy link
Author

garemoko commented Jan 3, 2017

You can include html in extensions yes, but if you do that i recommend also including the plain text version in the normal field.

Can you give an example of what you mean for the long-fill-in?

@thomasmars
Copy link
Member

thomasmars commented Jan 3, 2017

Yes, i see.

An example of a long-fill-in would be several sentences that you would want to separate with line-breaks or other styling. A bad example:

Oslo is the capital of ______

The cow says _______

You don't want these to appear on the same line in a report.

@garemoko
Copy link
Author

garemoko commented Jan 3, 2017

Is this for the object.definition.name.en field? I don't have a good solution for including line breaks in that field. Sorry!

@thomasmars
Copy link
Member

I'm sorry. This is in the object.definition.description.en-US field as well, that was a bad example.I could not find any good examples where html was needed as part of a field other than language field. I suppose that is where it is most needed, at least in our use cases.

Do you have any suggestions for how to model an xAPI statement like H5P.DragText that has the 'matching' interaction type in between words. Or a 'long-fill-in' like H5P.Blanks that has multiple 'fill-in' mixed into the sentence. I could not find any examples of this use-case. Does it make sense to have the text with placeholders in object.definition.description and then a separate extension for the formatting ? Or should the object.definition.description be as small as possible, without the actual task text, e.g. just 'drag the words to the correct dropzones' and a separate extension for the actual task with the formatting ?

Anyway I suppose any additional (formatted) info needed for generating reports, and for providing metadata should be included as an extension ?

@garemoko
Copy link
Author

garemoko commented Jan 3, 2017

My assumption is that you are just asking for examples of the description field rather than the complete statement. Is that right?

In that case, then i think that the approach H5P currently uses of inserting ______ for blanks makes sense. e.g.

"definition": {
    "name": {
        "en-US": "Match the words to the blanks."
    },
    "description": {
        "en-US": "The sky is ______. The grass is ______."
    },
    "type": "http://adlnet.gov/expapi/activities/cmi.interaction",
    "interactionType": "matching",
    "correctResponsesPattern": [
        "green[.]1[,]blue[.]2"
    ],
    "source": [
        {
            "id": "blue",
            "description": {
                "en-US": "blue"
            }
        },
        {
            "id": "green",
            "description": {
                "en-US": "green"
            }
        }
    ],
    "target": [
        {
            "id": "1",
            "description": {
                "en-US": "Blank 1"
            }
        },
        {
            "id": "2",
            "description": {
                "en-US": "Blank 2"
            }
        }
    ],
    "extensions": {
        "https://h5p.org/xapi/extensions/activity-definition/html-description": "{
            "en-US": "The sky is ______.<br/>The grass is ______."
        }
    }
}

@thomasmars
Copy link
Member

Yes, that's exactly what I was looking for. Thanks a lot.

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

No branches or pull requests

2 participants