https://github.com/jlumbroso/codepost-stats
A system to compile statistics automatically from a course on the codePost platform.
https://github.com/jlumbroso/codepost-stats
codepost codepost-api codepost-platform gamification grading metrics
Last synced: 2 months ago
JSON representation
A system to compile statistics automatically from a course on the codePost platform.
- Host: GitHub
- URL: https://github.com/jlumbroso/codepost-stats
- Owner: jlumbroso
- License: lgpl-3.0
- Created: 2020-02-25T22:11:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-11T00:44:18.000Z (over 2 years ago)
- Last Synced: 2024-08-10T21:48:44.718Z (about 1 year ago)
- Topics: codepost, codepost-api, codepost-platform, gamification, grading, metrics
- Language: Python
- Homepage: https://codepost-stats.readthedocs.io
- Size: 187 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# codePost Statistics Compiler

[](https://codecov.io/gh/jlumbroso/codepost-stats)
[](https://codepost-stats.readthedocs.io/en/latest/?badge=latest)
[](https://pepy.tech/project/codepost-stats)
[](https://repl.it/github/jlumbroso/codepost-stats)
[](https://github.com/jlumbroso/codepost-stats)A system to compile statistics automatically from a course on the codePost platform.
## Installation
The package is available on PyPI as slacktivate and so is available the usual way, i.e.,
```shell
$ pip install codepost-stats
```## Example
```python
import codepostimport codepost_stats
import codepost_stats.analyzers.abstract.simple
import codepost_stats.analyzers.standard
import codepost_stats.event_loop# Login
codepost.configure_api_key("")# Create Course Analyzer Event Loop
cael = codepost_stats.event_loop.CourseAnalyzerEventLoop(
course_name="COS126",
course_term="S2020",
)# Create Analyzer
class SubmissionsGradedCounter(codepost_stats.analyzers.abstract.simple.CounterAnalyzer):
_name = "submissions.graded"
def _event_submission(
self,
assignment: codepost.models.assignments.Assignments,
submission: codepost.models.submissions.Submissions,
):
# if no grader, nothing to do
if submission.grader is None:
return
# if not finalized, do not want to count it
if not submission.isFinalized:
return
# increase number of graded submission for grader by 1
self._delta_counter(
name=submission.grader,
subcat=assignment.name,
delta=1,
)
sgc = SubmissionsGradedCounter()# Add the analyzer we just created
cael.register(sgc)# Add a few standard analyzers
cael.register(codepost_stats.analyzers.standard.CustomCommentsCounter)
cael.register(codepost_stats.analyzers.standard.RubricCommentsCounter)# Run the aggregation of stats
cael.run()# Extract statistics per user
statistics_per_user = {
name: cael.get_by_name(name)
for name in cael.names
}
```
and the `statistics_per_user` variable would be a dictionary of the form:
```json
{
"grader1@princeton.edu": {
"submissions.graded": {
"hello": 5,
"loops": 6,
"nbody": 0,
"sierpinski": 8,
"programming-exam-1": 6,
"hamming": 0,
"lfsr": 2,
"guitar": 5,
"markov": 6,
"tspp": 4,
"atomic": 29
},
"comments.counter.custom": {
"hello": 9,
"loops": 6,
"nbody": 0,
"sierpinski": 14,
"programming-exam-1": 6,
"hamming": 0,
"lfsr": 4,
"guitar": 8,
"markov": 14,
"tspp": 7,
"atomic": 36
},
"comments.counter.rubric": {
"hello": 7,
"loops": 15,
"nbody": 0,
"sierpinski": 13,
"programming-exam-1": 8,
"hamming": 0,
"lfsr": 6,
"guitar": 10,
"markov": 17,
"tspp": 13,
"atomic": 38
}
},
"grader2@princeton.edu": {
/* ... grader2@princeton.edu's statistics here ... */
},
/* ... more graders ... */
}
```## License
This project is licensed [under the LGPLv3 license](https://www.gnu.org/licenses/lgpl-3.0.en.html),
with the understanding that importing a Python modular is similar in spirit to dynamically linking
against it.- You can use the library/CLI `codepost-stats` in any project, for any purpose,
as long as you provide some acknowledgement to this original project for
use of the library (for open source software, just explicitly including
`codepost-stats` in the dependency such as a `pyproject.toml` or `Pipfile`
is acknowledgement enough for me!).- If you make improvements to `codepost-stats`, you are required to make those
changes publicly available.