https://github.com/fed/lrn-logger
https://github.com/fed/lrn-logger
learnosity
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fed/lrn-logger
- Owner: fed
- Created: 2019-03-03T23:35:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T14:32:11.000Z (over 2 years ago)
- Last Synced: 2025-01-18T13:33:16.974Z (3 months ago)
- Topics: learnosity
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Logger
Simple logger API to keep track of random values generated dynamically by Items API and analyse their frequency.
## Running the API
```
npm start
```## Logging values
```js
const itemsApp = LearnosityItems.init(window.activity, {
readyListener() {
const nodes = document.querySelectorAll('.lrn_stimulus_content > span > strong');
const values = Array.from(nodes).map(node => Number(node.textContent));fetch(`http://localhost:6789/?values=${values}`).then(() => {
location.reload();
});
}
});
```## Retrieving logged values
Just hit `http://localhost:6789/log`.