Skip to content

Commit

Permalink
➖ removed /wiki from routes; ➕ added activity badges to README
Browse files Browse the repository at this point in the history
  • Loading branch information
gy-mate committed Aug 11, 2024
1 parent 65e2d5a commit 0bf398f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
[![Code quality](https://img.shields.io/scrutinizer/quality/g/gy-mate/moodle-to-vikwikiquiz/main)](https://scrutinizer-ci.com/g/gy-mate/moodle-to-vikwikiquiz/)
[![Type hinting used](https://img.shields.io/badge/type_hinting-used-brightgreen)](https://docs.python.org/3/library/typing.html)
[![Code style: Black](https://img.shields.io/badge/code_style-black-black.svg)](https://github.com/psf/black)

[![Recent activity](https://img.shields.io/github/commit-activity/m/gy-mate/moodle-to-vikwikiquiz)](https://github.com/gy-mate/moodle-to-vikwikiquiz/commits/main/)
![Commits since latest release](https://img.shields.io/github/commits-since/gy-mate/moodle-to-vikwikiquiz/latest)
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)


## 📖 About

A CLI for converting graded [Moodle quizzes](https://docs.moodle.org/404/en/Quiz_activity) saved as HTML files to a [vik.viki quiz](https://vik.wiki/wiki/Segítség:Kvíz) wikitext.
A CLI for converting graded [Moodle quizzes](https://docs.moodle.org/404/en/Quiz_activity) saved as HTML files to a [vik.viki quiz](https://vik.wiki/Segítség:Kvíz) wikitext.


## 📥 Installation
Expand Down
8 changes: 4 additions & 4 deletions src/moodle_to_vikwikiquiz/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def main() -> None:
)

quiz_wikitext = str(quiz)
wiki_domain = "https://test.vik.wiki"
wiki_domain = "https://vik.wiki"
webbrowser.open_new_tab(f"{wiki_domain}/index.php?title=Speciális:Belépés")
input("Please log in to the wiki then press Enter to continue...")
parameters_for_opening_edit = {
Expand Down Expand Up @@ -137,7 +137,7 @@ def get_grading() -> GradingType:
try:
grading_symbol = input(
"\nPlease enter `+` or `-` as the grading type of the quiz then press Enter!"
"\nSee https://vik.wiki/wiki/Segítség:Kvíz#Pontozás for further info.\n"
"\nSee https://vik.wiki/Segítség:Kvíz#Pontozás for further info.\n"
)
return GradingType(grading_symbol)
except ValueError:
Expand Down Expand Up @@ -166,14 +166,14 @@ def create_article(
"bővítése", "létrehozása"
)
)
url = f"{wiki_domain}/wiki/{quiz_title}?{urlencode(parameters_for_opening_edit_with_paste)}"
url = f"{wiki_domain}/{quiz_title}?{urlencode(parameters_for_opening_edit_with_paste)}"
if len(url) < 2048:
return open_article_paste_text(args, quiz_wikitext, url)
else:
open_article(args, parameters_for_opening_edit, url)
pyperclip.copy(quiz_wikitext)
print("\nThe wikitext of the quiz has been copied to the clipboard!")
url = f"{wiki_domain}/wiki/{quiz_title}?{urlencode(parameters_for_opening_edit)}"
url = f"{wiki_domain}/{quiz_title}?{urlencode(parameters_for_opening_edit)}"
webbrowser.open_new_tab(url)
print(
"\nThe edit page of the quiz article has been opened in your browser! "
Expand Down

0 comments on commit 0bf398f

Please sign in to comment.