🚨 Fixed linter warnings
This commit is contained in:
@@ -117,7 +117,6 @@ def check_hashcash(data: str, input_data: str) -> bool:
|
|||||||
:type input_data: str
|
:type input_data: str
|
||||||
:return: A boolean value.
|
:return: A boolean value.
|
||||||
"""
|
"""
|
||||||
print(data, input_data, hc_check(data))
|
|
||||||
|
|
||||||
if not hc_check(data):
|
if not hc_check(data):
|
||||||
return False
|
return False
|
||||||
@@ -132,5 +131,4 @@ def check_hashcash(data: str, input_data: str) -> bool:
|
|||||||
assert ext == ""
|
assert ext == ""
|
||||||
return True
|
return True
|
||||||
except AssertionError as e:
|
except AssertionError as e:
|
||||||
print(e, "hilo")
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -1,37 +1,20 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getLocalization } from '$lib/i18n';
|
|
||||||
import { mint } from '$lib/hashcash';
|
import { mint } from '$lib/hashcash';
|
||||||
import { dataSchema } from '$lib/yupSchemas';
|
import { dataSchema } from '$lib/yupSchemas';
|
||||||
import type { EditorData, Question, Answer } from './quiz_types';
|
import type { EditorData, Question } from './quiz_types';
|
||||||
import Sidebar from '$lib/editor/sidebar.svelte';
|
import Sidebar from '$lib/editor/sidebar.svelte';
|
||||||
import SettingsCard from '$lib/editor/settings-card.svelte';
|
import SettingsCard from '$lib/editor/settings-card.svelte';
|
||||||
import QuizCard from '$lib/editor/card.svelte';
|
import QuizCard from '$lib/editor/card.svelte';
|
||||||
import Spinner from './Spinner.svelte';
|
import Spinner from './Spinner.svelte';
|
||||||
import { onMount } from 'svelte';
|
|
||||||
|
|
||||||
const { t } = getLocalization();
|
|
||||||
|
|
||||||
let schemaInvalid = false;
|
let schemaInvalid = false;
|
||||||
let yupErrorMessage = '';
|
let yupErrorMessage = '';
|
||||||
|
|
||||||
export let data: EditorData;
|
export let data: EditorData;
|
||||||
export let submit_button_text = 'Create';
|
|
||||||
export let quiz_id: string | null;
|
export let quiz_id: string | null;
|
||||||
let selected_question = -1;
|
let selected_question = -1;
|
||||||
let imgur_links_valid = false;
|
let imgur_links_valid = false;
|
||||||
|
|
||||||
const empty_question: Question = {
|
|
||||||
question: '',
|
|
||||||
time: '20',
|
|
||||||
image: '',
|
|
||||||
answers: [
|
|
||||||
{
|
|
||||||
right: false,
|
|
||||||
answer: ''
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
const validateInput = async (data: EditorData) => {
|
const validateInput = async (data: EditorData) => {
|
||||||
try {
|
try {
|
||||||
await dataSchema.validate(data, { abortEarly: false });
|
await dataSchema.validate(data, { abortEarly: false });
|
||||||
@@ -61,11 +44,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
$: imgur_links_valid = checkIfAllQuestionImagesComplyWithRegex(data.questions);
|
$: imgur_links_valid = checkIfAllQuestionImagesComplyWithRegex(data.questions);
|
||||||
|
|
||||||
const empty_answer: Answer = {
|
|
||||||
right: false,
|
|
||||||
answer: ''
|
|
||||||
};
|
|
||||||
let edit_id;
|
let edit_id;
|
||||||
let confirm_to_leave = true;
|
let confirm_to_leave = true;
|
||||||
let pow_data;
|
let pow_data;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
uppy.on('upload-success', (file, response) => {
|
uppy.on('upload-success', (file, response) => {
|
||||||
image_id = response.body.id;
|
image_id = response.body.id;
|
||||||
});
|
});
|
||||||
uppy.on('complete', (res) => {
|
uppy.on('complete', (_) => {
|
||||||
console.log(pow_data);
|
console.log(pow_data);
|
||||||
data.questions[
|
data.questions[
|
||||||
selected_question
|
selected_question
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export const mint = async (
|
|||||||
const zeros = '0'.repeat(hex_digits);
|
const zeros = '0'.repeat(hex_digits);
|
||||||
const salt = gen_salt(saltchars);
|
const salt = gen_salt(saltchars);
|
||||||
const challenge = `${ver}:${bits}:${ts}:${resource}:${ext}:${salt}`;
|
const challenge = `${ver}:${bits}:${ts}:${resource}:${ext}:${salt}`;
|
||||||
let digest: string;
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
let result: string;
|
let result: string;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { goto } from '$app/navigation';
|
|||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
|
|
||||||
const URLSearchParamsToObject = (params: URLSearchParams) => {
|
const URLSearchParamsToObject = (params: URLSearchParams) => {
|
||||||
let obj = {};
|
const obj = {};
|
||||||
params.forEach((v: string, k: string) => {
|
params.forEach((v: string, k: string) => {
|
||||||
obj[k] = v;
|
obj[k] = v;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
import Editor from '$lib/editor.svelte';
|
import Editor from '$lib/editor.svelte';
|
||||||
import { getLocalization } from '$lib/i18n';
|
import { getLocalization } from '$lib/i18n';
|
||||||
import { navbarVisible } from '$lib/stores';
|
import { navbarVisible } from '$lib/stores';
|
||||||
import { dataSchema } from '$lib/yupSchemas';
|
|
||||||
|
|
||||||
navbarVisible.set(false);
|
navbarVisible.set(false);
|
||||||
|
|
||||||
@@ -49,7 +48,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
let data: Data;
|
let data: Data;
|
||||||
let confirm_to_leave = true;
|
|
||||||
let quiz_id = null;
|
let quiz_id = null;
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
const from_localstorage = localStorage.getItem('create_game');
|
const from_localstorage = localStorage.getItem('create_game');
|
||||||
@@ -130,7 +128,6 @@
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
confirm_to_leave = false;
|
|
||||||
window.location.href = '/overview';
|
window.location.href = '/overview';
|
||||||
}}
|
}}
|
||||||
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
import Editor from '$lib/editor.svelte';
|
import Editor from '$lib/editor.svelte';
|
||||||
import { getLocalization } from '$lib/i18n';
|
import { getLocalization } from '$lib/i18n';
|
||||||
import { navbarVisible } from '$lib/stores';
|
import { navbarVisible } from '$lib/stores';
|
||||||
import { dataSchema } from '$lib/yupSchemas';
|
|
||||||
|
|
||||||
navbarVisible.set(false);
|
navbarVisible.set(false);
|
||||||
|
|
||||||
@@ -41,7 +40,6 @@
|
|||||||
open: false,
|
open: false,
|
||||||
data: ''
|
data: ''
|
||||||
};
|
};
|
||||||
let confirm_to_leave = true;
|
|
||||||
|
|
||||||
interface Data {
|
interface Data {
|
||||||
public: boolean;
|
public: boolean;
|
||||||
@@ -157,7 +155,6 @@
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
confirm_to_leave = false;
|
|
||||||
window.location.href = '/overview';
|
window.location.href = '/overview';
|
||||||
}}
|
}}
|
||||||
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getLocalization } from '$lib/i18n';
|
|
||||||
const { t } = getLocalization();
|
|
||||||
import SearchCard from '$lib/search-card.svelte';
|
import SearchCard from '$lib/search-card.svelte';
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const response = await fetch('/api/v1/search/', {
|
const response = await fetch('/api/v1/search/', {
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
import LandingPromo from '$lib/landing/landing-promo.svelte';
|
import LandingPromo from '$lib/landing/landing-promo.svelte';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { mint } from '$lib/hashcash';
|
|
||||||
|
|
||||||
const { t } = getLocalization();
|
const { t } = getLocalization();
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getLocalization } from '$lib/i18n';
|
import { getLocalization } from '$lib/i18n';
|
||||||
const { t } = getLocalization();
|
const { t } = getLocalization();
|
||||||
import { page } from '$app/stores';
|
|
||||||
import SearchCard from '$lib/search-card.svelte';
|
import SearchCard from '$lib/search-card.svelte';
|
||||||
import { createQueryParamsStore } from '$lib/stores';
|
import { createQueryParamsStore } from '$lib/stores';
|
||||||
const search_term = createQueryParamsStore('q');
|
const search_term = createQueryParamsStore('q');
|
||||||
|
|||||||
Reference in New Issue
Block a user