{"_id":"@adlete/client-ts","_rev":"1-c4150c8f1bc51309a1e93a1ffd731a4d","name":"@adlete/client-ts","dist-tags":{"latest":"0.0.2-beta"},"versions":{"0.0.1-beta":{"name":"@adlete/client-ts","version":"0.0.1-beta","description":"A client plugin to connect typescript-based virtual learning environments to the adaptive engine @adlete/service.","authors":["Florian Gnadlinger <florian.gnadlinger@htw-berlin.de>","André Selmanagić <and.selm@gmail.com>"],"contributors":[{"name":"Anel Abu Awad","email":"anel.abuawad@student.htw-berlin.de"}],"license":"MIT","main":"build/index.js","type":"module","typesVersions":{"*":{"*":["src/*","src/index.ts","src/*/index.ts"]}},"dependencies":{"@adlete/framework":"0.0.1-beta","@adlete/engine-blocks":"0.0.1-beta","graphql":"16.5.0","graphql-request":"4.2.0"},"types":"./build/index.d.ts","gitHead":"44abf1426f8908a6a4315c0ce283dcddeb4ffbd5","_id":"@adlete/client-ts@0.0.1-beta","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-WDVOj1LUXhygVDCIl3jPIpO7a5RPvp2XZ/658qOl3rIltuM7tDoqc1ZOMsoCtHvm656YxNa2ozPU83x4dNsmFw==","shasum":"01cb1d813567778dbcd0e5936582e8bcd8e7f4bf","tarball":"https://registry.npmjs.org/@adlete/client-ts/-/client-ts-0.0.1-beta.tgz","fileCount":24,"unpackedSize":47677,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCanfLAEizr21PVuxJmKO+NwY/shnU3WwlazNS7Wyht5gIgORmbDUnb/cVDE+wl9suAoZBfZ9JcJcOQkvOuHcV0ZIw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB5JDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFZw//XBvlff8tqiBulJY8DLpnV5NtTsdRw4G3QMQgBR/vrXi5vUep\r\nzNpxpFNTTaW6kMLPEl13rkuqur7iE6mkqMZPc9xasZ7PJbCOdGCOqBRbQmJt\r\nz8J8s51aI4Hsj7dE5sTrDDXWRO5D6i1BZE5yjlE14JFR5tprjStQvwQPh2JM\r\nlAzD/gcerUUtQs4Ux4rx04NppFNHUUhvzfMnQg5Be0NbB1SndA3SLNVm5dDV\r\nmeiKuEmVZh3VrYTU5KvMe1XzRwqRUnBrpf4msHS+eNNigNDL9hzK9qH6bbtR\r\nw9zqKqz+fWvjQP0uFHav5b74sZetp2xZ1Mzvvs3szwSW3d4Iy1w+M7o4SF/k\r\njWhZeputGjfj+85Yl5jhv9A7AJ7nrsZjpp7edHqXCP1s354jfL90NY+7cFlE\r\nRS3nIyqJIg9kW77nudU1N8o0tSW3m5K7976xjqFDzYfl06NZFyvLmSq9FgZy\r\n25Ha3BPIOUcquqHl6t+vSOIggSeHA5WjAcxxdC4Ge1zBcajRAGyJ43DUoZnZ\r\n/B8vociI3S/PIzrRIpvTvOOg0zQeE7L5OeUNJ54WmBWZpUS5jcnd0ZHHDsCE\r\nppjA6R3PATp3iiPXfBtuuupPg4H5ql+BNGVfhJCMcGWx9tMwqHQzDo1vsOjF\r\nxKW3FemA2WUle39GZBqSc0SfCStWRkqTF44=\r\n=jmrf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"creative-media","email":"npm@creativemedia.berlin"},"directories":{},"maintainers":[{"name":"florian.gnadlinger","email":"florian.gnadlinger@htw-berlin.de"},{"name":"creative-media","email":"npm@creativemedia.berlin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/client-ts_0.0.1-beta_1661440578762_0.6845577520843702"},"_hasShrinkwrap":false},"0.0.2-beta":{"name":"@adlete/client-ts","version":"0.0.2-beta","description":"A client plugin to connect typescript-based virtual learning environments to the adaptive engine @adlete/service.","authors":["Florian Gnadlinger <florian.gnadlinger@htw-berlin.de>","André Selmanagić <and.selm@gmail.com>"],"contributors":[{"name":"Anel Abu Awad","email":"anel.abuawad@student.htw-berlin.de"}],"license":"MIT","main":"build/index.js","type":"module","exports":{".":"./build/index.js","./*":"./build/*.js","./package.json":"./package.json"},"typesVersions":{"*":{"*":["src/*","src/index.ts","src/*/index.ts"]}},"scripts":{"build":"tsc","watch:build":"tsc --watch","build:scripts":"tsc","test":"jest --config ./test/jest.config.json","build:docs":"typedoc --out ./docs/ ./src","lint":"eslint ./src/**"},"devDependencies":{"@types/lodash.clonedeep":"4.5.6","@types/node":"10.17.9","typedoc":"0.23.10","typescript":"4.7.4","@adlete/dev-config":"*"},"dependencies":{"@adlete/framework":"0.0.2-beta","@adlete/engine-blocks":"0.0.2-beta","graphql":"16.5.0","graphql-request":"4.2.0"},"prettier":"@adlete/dev-config/prettier","types":"./build/index.d.ts","gitHead":"5ae1b6473895b0bc191dee7c92e4a69592be0b0e","_id":"@adlete/client-ts@0.0.2-beta","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-pcwmEJzacvd9WrFSL+87McwbD0QWklUSBADB3/tpOCSqi92IO7FU3Bb4/v3NyEwJkikhGTAjjCogymSGt52BHA==","shasum":"6104713f86b6778fd451872c806766af92e5c79d","tarball":"https://registry.npmjs.org/@adlete/client-ts/-/client-ts-0.0.2-beta.tgz","fileCount":44,"unpackedSize":133530,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2SI0IVcQimnbWoOp7CcVRbuyU0BEt4lpXGUFy21+P/wIhAJ8dd5nIVx+bBc0Odzmu4A0EIzcDpuifN+n/63IRSyLh"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjCOGgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoM2A/+OJkYPOgMwJlOCovQENJr4u3i7NRvM2HA7aK4+9/MoepcQ9AJ\r\n8yijJfbtfAmq4L+jJw9F57nfuOybUe4TvM5B5MsUy+JQRKsvNREDXkUthJCN\r\n0K/nLyoDH3GEZ3JQAqu2Q4N/sWjtEWjfMaKeAgzD58mY5QU6D8gPaCnB/ZBD\r\nqkhwY7yjB+w171FkZqMpppou7oYjTNel8vXtss3EKgADH/dT1bvBiHk9hgd2\r\nevr+OwAWp1Jig1/wK7LlJS/bOqPfsnW6p688WA8oGt5+T6ZSZ6m6AGnSx3Sd\r\nfsRBeD13bMWoBwIY9e2fv3Gpklcg29cMIh4wfKJAOeMX5blgUPFbAfs+b7YV\r\n4HvkgkKhzoY73YPuhbKsIjPA/xYi2sirbQdnJL7rJP6iUQjgBh7fLM16QcPK\r\nuK+8ursYe1S9f+BXy6YS1Vrtc8K+jdZkXYmF7nNBF03JJ43O5SvEjk1z5rwm\r\ndQWd36LOKDoR+POTqFnOFbdnNx4Cy9P77U0sx4k6z/RmTTyB4jtBgsLE/sB0\r\n8SS2hlMpYhFkCjQE3WS88fxNYVf7NxPfMqxbn1CEMDOYxpJXf2kW70HobaDI\r\nqm1ehMzsFsIpFUSpi1mOZ4CVpZra6y+zWeIjKlr0iSWky3lpTQMiHF10lYTu\r\n+JvKAY9uS7I/0OBdpXw56a+P9x1gZTt9uz0=\r\n=nAuh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"creative-media","email":"npm@creativemedia.berlin"},"directories":{},"maintainers":[{"name":"florian.gnadlinger","email":"florian.gnadlinger@htw-berlin.de"},{"name":"creative-media","email":"npm@creativemedia.berlin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/client-ts_0.0.2-beta_1661526432509_0.025565029656904104"},"_hasShrinkwrap":false}},"time":{"created":"2022-08-25T15:16:18.698Z","0.0.1-beta":"2022-08-25T15:16:18.994Z","modified":"2022-08-26T15:07:12.850Z","0.0.2-beta":"2022-08-26T15:07:12.742Z"},"maintainers":[{"name":"florian.gnadlinger","email":"florian.gnadlinger@htw-berlin.de"},{"name":"creative-media","email":"npm@creativemedia.berlin"}],"description":"A client plugin to connect typescript-based virtual learning environments to the adaptive engine @adlete/service.","contributors":[{"name":"Anel Abu Awad","email":"anel.abuawad@student.htw-berlin.de"}],"license":"MIT","readme":"# @adlete/client-ts\r\n\r\nA client plugin to connect typescript-based virtual learning environments to the adaption engine @adlete/service.\r\n\r\n## Example - Before the main trainings loop of your virtual learning environment starts\r\n\r\n```\r\n/* Before the main trainings loop */\r\n\r\n/* Create a new instance of the service connection */\r\nconst adleteServiceConnection = new AdleteServiceConnection(this.token, this.host, 'arithmetic-game');\r\n\r\n/* Check if the service is available. */\r\nconst {statusCode, statusDescription} = await adleteService.checkStatus();\r\nif (statusCode !== 200) {\r\n      console.error('Unable to connect to adlete service! Error message: ' + statusDescription);\r\n}\r\n\r\n/* If you do not have a learner create one and login. Otherwise just use login. */\r\nconst {statusInfo, learnerId} = await adleteService.createNewLearnerAndLogin();\r\nif (statusInfo.statusCode !== 200) {\r\n    console.error('Unable to create learner! Error message: ' + statusInfo.statusDescription);\r\n}\r\n\r\n/* Whenever the a new practicing session starts create a new session. */\r\nconst startedSession = await adleteService.startSession();\r\nif (startedSession.StatusInfo.statusCode !== 200) {\r\n    console.error('Unable to start session! Error message: ' + startedSession.StatusInfo.statusDescription);\r\n}\r\n```\r\n\r\n## Example - Within the main trainings loop of your virtual learning environment\r\n\r\n```\r\n/* Before your virtual learning environment creates each new exercises you can request *\r\n * a recommendation for a specific exercise type and difficulty level. Exercise types  *\r\n * and difficulty levels are described and can be defined via the @adlete/service.        */\r\nconst recommendation = await adleteService.fetchNextExerciseRecommendation();\r\nif (recommendation.statusInfo.statusCode !== 200) {\r\n    console.error('Unable to fetch recommendation! Error message: ' + recommendation.StatusInfo.statusDescription);\r\n}\r\n\r\n/* Create new exercise with the recommended exercises type/name and the difficulty level *\r\n * For example if your virtual learning environment supports the training of the basic   *\r\n * mathematic operation addition and subtraction this could look like this:              */\r\nif(recommendation.nextExerciseName == \"exerciseAddition\") {\r\n    console.log(\"Please calculate:\")\r\n    if(recommendation.nextExerciseDifficulty < 0.3) {\r\n        console.log(\"1 + 1 = ?\")\r\n        generatedDifficulty\r\n    } else if(recommendation.nextExerciseDifficulty < 0.6) {\r\n        console.log(\"152 + 65 = ?\")\r\n    } else {\r\n       console.log(\"1545206787 + 596 = ?\")\r\n    }\r\n}\r\nif(recommendation.nextExerciseName == \"exerciseSubtraction\") {\r\n    //etc...\r\n}\r\n\r\n/* the user has given an answer and the given answer was validated. 1 = correct, 0 = incorrect */\r\nconst correctness = 1\r\n/* define the difficulty level of your exercise. This is a balancing parameter, since your *\r\n * exercises would most like do not meet the actual difficulty level */\r\nconst generatedDifficulty = 0.5\r\n\r\nconst submitResults = await adleteService.submitResults(recommendation.nextExerciseName, recommendation.nextExerciseDifficulty, correctness, generatedDifficulty);\r\nif (response.statusCode !== 200) {\r\n    console.error('Unable to submit results! Error message: ' + recommendation.StatusInfo.statusDescription);\r\n}\r\n```\r\n\r\n## Example - After the main trainings loop of your virtual learning environment ended\r\n\r\n```\r\nconst stopSessionResponse = await adleteService.stopSession();\r\nif (stopSessionResponse.statusCode !== 200) {\r\n    console.error('Unable to stop session! Error message: ' + stopSessionResponse.StatusInfo.statusDescription);\r\n}\r\n```\r\n\r\n## Development\r\n\r\n### Dependencies\r\n\r\n- [node](https://nodejs.org/en/)\r\n- [yarn](https://yarnpkg.com/en/)\r\n\r\n### Install package dependencies\r\n\r\n```bash\r\nyarn install\r\n```\r\n\r\n### Building code\r\n\r\nThis package uses [Typescript](http://typescriptlang.org/).\r\n\r\n```bash\r\n# clean and build\r\nyarn build\r\n\r\n# watch and build\r\nyarn watch:build\r\n```\r\n\r\n### Building documentation\r\n\r\n```bash\r\nyarn build:docs\r\n```\r\n\r\n### IDE\r\n\r\n#### Editorconfig\r\n\r\nThis package uses [Editorconfig](https://editorconfig.org/).\r\n\r\n#### Linting\r\n\r\nThis package uses a prettier configuration to set a style format for all source code files, we ship this config in the package @adlete/dev-config.\r\n\r\n### Version Control\r\n\r\nUse the [bluejava git commit message guide](https://github.com/bluejava/git-commit-guide).\r\n","readmeFilename":"README.md"}