Zamenhof / api

Public repo for issues and wiki.
0 stars 0 forks source link

Invalid JSON - tab used in teacher responswe #44

Open nftl-agnieszka opened 5 years ago

nftl-agnieszka commented 5 years ago

If teacher prepares his/her notes in text editor( using tab button within that notes) and pastes it into teacher command text field on Zamenhof page JSON file sends as a scored xAPI statement is invalid. For now we have resolution for enter button. JSON example:


            "name": "Satsuki",
            "account": {
                "name": "637c0a63-a5ef-4839-b177-bc88fb74318f",
                "homePage": "http://nftlearning.com/learners/637c0a63-a5ef-4839-b177-bc88fb74318f"
            },
            "objectType": "Agent"
        },
        "context": {
            "instructor": {
                "name": "Julius Malaza",
                "account": {
                    "name": "517",
                    "homePage": "https://zamenhof.net/teacher/517"
                },
                "objectType": "Agent"
            },
            "contextActivities": {
                "grouping": 
                {
                    "id": "https://zamenhof.net/course/1214",
                    "definition": {
                        "type": "http://nftlearning.com/zamenhofactivities/course",
                        "name": {
                            "en": "DS2 - Improve team communication"
                        },
                        "description": {
                            "en": "DS2 - Improve team communication"
                        }
                    }
                },
                "parent": 
                {
                    "id": "https://zamenhof.net/module/1055",
                    "definition": {
                        "type": "http://nftlearning.com/zamenhofactivities/module",
                        "name": {
                            "en": "Module 2: Contribute to a meeting"
                        },
                        "description": {
                            "en": "Module 2: Contribute to a meeting"
                        }
                    }
                }

            }
        },
        "timestamp": "2019-10-17T09:57:27+00:00",
        "verb": {
            "id": "http://adlnet.gov/expapi/verbs/scored",
            "display": {
                "en": "received grade for"
            }
        },"result": {
            "score": {
                "raw": 4.00,
                "scaled": 0.80
            },
            "extensions": {
                "http://nftlearning.com/extensions/scoringCriteria":
                [
                {
                "criteria": "Retention",
                "score": {
                    "raw": 4.0,
                    "min": 1.0,
                    "max": 5.0,
                    "scaled": 0.80
                }
            },{
                "criteria": "Application",
                "score": {
                    "raw": 5.0,
                    "min": 1.0,
                    "max": 5.0,
                    "scaled": 1.00
                }
            },{
                "criteria": "Clarity",
                "score": {
                    "raw": 4.0,
                    "min": 1.0,
                    "max": 5.0,
                    "scaled": 0.80
                }
            },{
                "criteria": "Interactivity",
                "score": {
                    "raw": 4.0,
                    "min": 1.0,
                    "max": 5.0,
                    "scaled": 0.80
                }
            },{
                "criteria": "Courage",
                "score": {
                    "raw": 3.0,
                    "min": 1.0,
                    "max": 5.0,
                    "scaled": 0.60
                }
            },{
                "criteria": "Awareness",
                "score": {
                    "raw": 4.0,
                    "min": 1.0,
                    "max": 5.0,
                    "scaled": 0.80
                }
            }
                ]
            },
            "completion": true,
            "response": "Hi Satsuki,Many thanks for taking my class! It`s my pleasure guiding you on your Business English class. I commend your best effort for expressing your thoughts. You have good understanding of the topic and you`re able to deliver your task well. Keep it up! Just pay more attention to your pronunciation.Anyway, I`d like to share this with you: Teacher Juls` BUSINESS PHRASE OF THE DAY: \"Ahead of the pack\"   Meaning: To be more successful than the competition Example: If we want to stay ahead of the pack, we’ll have to increase our marketing budget.",
            "success": true
        },
        "object": {
            "id": "https://zoom.us/j/919123601",
            "definition": {
                "name": {
                    "en-GB": "Module 2: Contribute to a meeting",
                    "en-US": "Module 2: Contribute to a meeting"
                },
                "description": {
                    "en-GB": "Module 2: Contribute to a meeting",
                    "en-US": "Module 2: Contribute to a meeting"
                },
                "type": "http://adlnet.gov/expapi/activities/meeting",
                "extensions": {
                    "http://nftlearning.com/identifiers/zamenhofId": "9626"
                }
            },
            "objectType": "Activity"
        } ```
indrajitlahiri commented 5 years ago

I have applied code to arrest he tab space, please lets have a test on DEV environment.