From 0bf398fcaec60853e2065555d2ddba217ee00890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Gy=C3=B6ngy=C3=B6si?= Date: Sun, 11 Aug 2024 21:16:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9E=96=20removed=20`/wiki`=20from=20routes;?= =?UTF-8?q?=20=E2=9E=95=20added=20activity=20badges=20to=20`README`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- src/moodle_to_vikwikiquiz/main.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7d15c1c..a994579 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/moodle_to_vikwikiquiz/main.py b/src/moodle_to_vikwikiquiz/main.py index f4d3fa1..4a8e1aa 100644 --- a/src/moodle_to_vikwikiquiz/main.py +++ b/src/moodle_to_vikwikiquiz/main.py @@ -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 = { @@ -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: @@ -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! "