Skip to content

Commit

Permalink
doc(report_quiz): added a README.md (#1)
Browse files Browse the repository at this point in the history
Added a documentation for the report quiz bot
  • Loading branch information
HanslettTheDev authored Oct 1, 2024
1 parent f861494 commit e360a2e
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
69 changes: 69 additions & 0 deletions .github/workflows/report_quiz/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
REPORT QUIZ BOT
===

[![telegram github quiz](https://github.com/osscameroon/global-github-actions/actions/workflows/report_a_quiz.yaml/badge.svg)](https://github.com/osscameroon/global-github-actions/actions/workflows/report_a_quiz.yaml)

This workflow is to automate the management of the [osscameroon](https://osscameroon.com/) quiz competition.

Requirements
---

- An API KEY from [QuizAPI](https://quizapi.io).
- A bot token from [Telegram BotFather](https://core.telegram.org/bots/tutorial#introduction).
- [Jq](https://github.com/jqlang/jq) (>=1.6)
- [Bash](https://www.gnu.org/software/bash/)
- [git](https://git-scm.com/)

How to run this locally
---

1. Clone the repository

```bash
git clone https://github.com/osscameroon/global-github-actions/
```

2. Move to the `report_quiz` folder

```bash
cd .github/workflows/report_quiz
```

3. Run the following command to make a copy of the `env.example.sh` file

```bash
cp env.example.sh env.sh
```

4. Edit the `env.sh` file with the necessary data

5. Setting up your bash terminal

```bash
source main.sh
```

6. Now to test this bot, you can use the following commands

```bash
# Starts a new quiz competition.
. start_quiz_competition
# Fetch user answers of the qizzes.
. fetch_quiz_users_answers
# Stop the current quiz competition and submit resutls.
. stop_quiz_competition
```

Contributing
---

Please, feel free to contribute to make this bot better.

Useful resources
---

- A jq cheetsheet: https://gist.github.com/olih/f7437fb6962fb3ee9fe95bda8d2c8fa4
- A jq playground: https://jqplay.org/
- The telegram API docs: https://core.telegram.org/bots/api


2 changes: 1 addition & 1 deletion .github/workflows/report_quiz/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ For further details, you can ask help in the OSS Cameroun telegram group.
timestamp=$(date +%s)
mkdir -p archive/${timestamp}
mv ${quiz_data_files} archive/${timestamp}
}
}

0 comments on commit e360a2e

Please sign in to comment.