diff --git a/CodeChallenge/api/questions.py b/CodeChallenge/api/questions.py index 4b8d733..9ea2480 100644 --- a/CodeChallenge/api/questions.py +++ b/CodeChallenge/api/questions.py @@ -22,7 +22,7 @@ def json_error(reason, status=400): def end_code_challenge(): if core.challenge_ended(): r = jsonify(status="error", - message="code challenge has ended") + reason="code challenge has ended") r.status_code = 403 abort(r) @@ -84,7 +84,7 @@ def next_question(): def answer_limit_attempts(): - return current_app.config.get("ANSWER_ATTEMPT_LIMIT", "3 per 30 minutes") + return current_app.config.get("ANSWER_ATTEMPT_LIMIT", "1 per 1 minutes") @bp.route("/answer", methods=["POST"]) @@ -163,10 +163,10 @@ def reset_all(): db.session.commit() - return jsonify(status="success", message="all answers and rank reset") + return jsonify(status="success", reason="all answers and rank reset") return jsonify(status="error", - message="resetting not allowed at this time"), 403 + reason="resetting not allowed at this time"), 403 @bp.route("/final", methods=["POST"]) diff --git a/CodeChallenge/cli/questions.py b/CodeChallenge/cli/questions.py index fd3e3f7..e49ead2 100644 --- a/CodeChallenge/cli/questions.py +++ b/CodeChallenge/cli/questions.py @@ -18,17 +18,21 @@ @click.argument("answer") @click.argument("rank") @click.argument("asset") -def q_add(title, answer, rank, asset): +@click.argument("hint1") +@click.argument("hint2") +def q_add(title, answer, rank, asset, hint1, hint2): """Add a new question to the database TITLE is the text for the title of the question ANSWER is the answer stored only in the database RANK is the day rank the queestion should be revealed on ASSET is a path to a file to upload for a question + HINT1 is a hint string + HINT2 is a hint string """ asset = os.path.abspath(asset) - qid = add_question(title, answer, rank, asset) + qid = add_question(title, answer, rank, asset, hint1, hint2) click.echo(f"added question id {qid}") @@ -66,7 +70,9 @@ def q_del(qid): @click.argument("answer") @click.argument("rank") @click.argument("asset") -def q_replace(title, answer, rank, asset): +@click.argument("hint1") +@click.argument("hint2") +def q_replace(title, answer, rank, asset, hint1, hint2): """Replace an existing rank's question. This basically deletes the previous rank then adds the new rank diff --git a/CodeChallenge/manage.py b/CodeChallenge/manage.py index c6523d4..23f3154 100644 --- a/CodeChallenge/manage.py +++ b/CodeChallenge/manage.py @@ -3,7 +3,7 @@ from .models import Question, db -def add_question(title, answer, rank, asset) -> Question: +def add_question(title, answer, rank, asset, hint1=None, hint2=None) -> Question: q = Question.query.filter_by(rank=rank).first() @@ -19,6 +19,8 @@ def add_question(title, answer, rank, asset) -> Question: q.asset_ext = os.path.splitext(asset)[1] q.rank = rank + q.hint1 = hint1 + q.hint2 = hint2 db.session.add(q) db.session.commit() diff --git a/Pipfile.lock b/Pipfile.lock index 12f5ead..8f14295 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -310,6 +310,14 @@ ], "version": "==19.3.0" }, + "colorama": { + "hashes": [ + "sha256:7d73d2a99753107a36ac6b455ee49046802e59d9d076ef8e47b61499fa29afff", + "sha256:e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1" + ], + "markers": "sys_platform == 'win32'", + "version": "==0.4.3" + }, "entrypoints": { "hashes": [ "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", diff --git a/package.json b/package.json index 43f4e42..e24211d 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "moment": "^2.24.0", "serialize-javascript": "^2.1.2", "vue": "^2.6.10", + "vue-codemirror": "^4.0.6", "vue-moment": "^4.1.0", "vue-router": "^3.1.3", "vue-the-mask": "^0.11.1", @@ -33,6 +34,7 @@ "prettier": "^1.18.2", "sass": "^1.19.0", "sass-loader": "^8.0.0", + "vue-cli-plugin-codemirror": "^0.0.6", "vue-cli-plugin-vuetify": "^2.0.2", "vue-template-compiler": "^2.6.10", "vuetify-loader": "^1.3.0" diff --git a/public/index.html b/public/index.html index 7f068dc..bb32131 100644 --- a/public/index.html +++ b/public/index.html @@ -6,7 +6,23 @@ - + + + + + + + + + + + + + + + + +
-
- + Students accessing the Defeat the Dragon Code Challenge websites or + CodeWizardsHQ Platform to view, upload, or edit content should refrain + from the following conduct: +
++ 1. Using any provided website for any commercial use or purpose unless + expressly permitted by CWHQ and the specific provider in writing, it is + understood that the website and related services are intended for + educational, personal, and non-commercial use only; +
++ 2. Posting, uploading, or distributing any defamatory, libelous, or + inaccurate student material or content or other content; +
++ 3. Posting, uploading, or distributing any student material or content + or other content that is unlawful or that a reasonable person could deem + to be objectionable, offensive, indecent, pornographic, harassing, + threatening, embarrassing, distressing, vulgar, hateful, racially or + ethnically offensive, or otherwise inappropriate; +
++ 4. Impersonating any person or entity, falsely claiming an affiliation + with any person or entity, or accessing the website accounts of others + without permission, or performing any other fraudulent activity; +
++ 5. Deleting the copyright or other proprietary rights notices on the + website or on any student material or content or other content; +
++ 6. Asserting, or authorizing, assisting, or encouraging any third party + to assert, against CWHQ, the website provider, or any of their + affiliates or licensors any patent infringement or other intellectual + property infringement claim regarding any student material or content or + other content, submitted, or otherwise made available on or through the + website; +
++ 7. Making unsolicited offers, advertisements, proposals, or sending + junk mail or spam to other users of the website or participants in any + Competition (including, but not limited to, unsolicited advertising, + promotional materials, or other solicitation material, bulk mailing of + commercial advertising, chain mail, informational announcements, charity + requests, and petitions for signatures); +
++ 8. Using the website for any illegal purpose, or in violation of any + local, state, national, or international law, including, without + limitation, laws governing intellectual property and other proprietary + rights, and data protection and privacy; +
++ 9. Defaming, harassing, abusing, threatening or defrauding users of the + website or participants in the Defeat the Dragon Code Challenge, or + collecting, or attempting to collect, personal information about users, + participants, or third parties without their consent; +
++ 10. Removing, circumventing, disabling, damaging or otherwise + interfering with security-related features of the website, student + material or content or other content, features that prevent or restrict + use or copying of any content accessible through the website, or + features that enforce limitations on the use of the website, student + material or content or other content; +
++ 11. Intentionally interfering with or damaging the operation of the + website or any user’s enjoyment of it, by any means, including + without limitation by participation in any denial-of-service type + attacks or by uploading or otherwise disseminating viruses, adware, + spyware, worms, or other malicious code. +
++ Privacy Policy +
++ +
++ By visiting and using the http://challenge.codewizardshq.com website + (“CodeWizardsHQ”) you acknowledge you have read and agree to + be bound by this Privacy Policy. If you do not wish to agree to the + Privacy Policy, please close this browser session and refrain from using + CodeWizardsHQ. +
++ +
++ CodeWizardsHQ is committed to protecting your privacy online. Please + read the following to learn what information we collect from you and how + we use that information. +
++ +
++ 1. Changes to Privacy Policy +
++ CodeWizardsHQ may change this Privacy Policy at any time by posting the + revised Policy in the “Privacy Policy” section of the + website, located at https://codewizardshq.com/privacy-policy/. The + revised Privacy Policy is effective immediately when posted on the + CodeWizardsHQ website. It is your responsibility to review the website + and the Privacy Policy periodically for changes. Your continued use of + CodeWizardsHQ after posting any changes will constitute your + acknowledgment and acceptance of the terms of the revised Privacy + Policy. +
++ +
++ 2. Protecting Your Privacy +
++ CodeWizardsHQ is committed to protecting your privacy: +
++ +
++ 3. What Information We Collect and Store and Why +
++ Postings +
++ Cookies +
++ +
++ 4. Security of Information +
++ CodeWizardsHQ takes security seriously and takes numerous precautions + to protect the security of your account information. You can access your + account on our coding platform with your username and password. This + password is encrypted. We recommend that you do not share your password + with anyone. In addition, your account information resides on a secure + server that only selected personnel and contractors have access + to. +
++ Unfortunately, no data transmission over the Internet or any wireless + network can be guaranteed to be 100% secure. As a result, while we + employ commercially reasonable security measures to protect data and + seek to partner with companies that do the same, CodeWizardsHQ cannot + guarantee the security of any information transmitted to or from the + website, and is not responsible for the actions of any third parties + that may receive any such information. +
++ +
++ 5. Third Party Sites +
++ This Privacy Policy only addresses the use and disclosure of + information CodeWizardsHQ collects from you. Other Sites that may be + accessible through CodeWizardsHQ have their own privacy policies and + data collection, use and disclosure practices. We are not responsible + for the policies or practices of third parties and you are solely + responsible for reviewing the privacy policies of any third party + sites. +
++ +
++ 6. Release of Information +
++ CodeWizardsHQ may release any user information as required by law or in + the good faith belief that disclosure of information is reasonably + necessary to comply with a subpoena, discovery request, court order or + other legal process issued by a court of competent jurisdiction. +
++ CodeWizardsHQ may also release any user information in the good faith + belief that such disclosure of information is reasonably necessary to + enforce the Terms and Conditions of Use for the website, to defend or + respond to any legal actions initiated by third-parties related to the + user account or content posted by the user; or to protect the personal + safety of CodeWizardsHQ staff, users, or the general public. +
++ +
++ 7. International Users +
++ By visiting and using the CodeWizardsHQ website, you acknowledge that + your information may be used and stored on servers located in the United + States of America and therefore transferred out of your resident + jurisdiction. By using the site, you are consenting to any international + exchange of the information provided and you are consenting to the + policies contained in this document and posted on the CodeWizardsHQ + website. You hereby acknowledge that you are providing all information + voluntarily, with the understanding that any use of the CodeWizardsHQ + website is governed by the laws of the United States of America, and you + hereby consent to the jurisdiction of the Federal District Court of the + Western District of Texas regarding any disputes which may arise under + this Agreement or use of the website. +
++ +
++ 8. Comments and Feedback +
++ CodeWizardsHQ welcomes and encourages your comments and feedback on + this Privacy Policy and any of our other website policies. Please + + visit our website + + or email us at feedback@codewizardshq.com with any comments or + questions. +
++ +
++ +
++ +
++ +
+
+ The challenge has not yet begun!
+Challenge begins: {{ Quiz.quizStartedMoment.fromNow() }}
+ +