Clean up code
This commit is contained in:
parent
c4cacac1c7
commit
d11d494fae
|
|
@ -22,8 +22,7 @@
|
||||||
parts.push({
|
parts.push({
|
||||||
correct: true,
|
correct: true,
|
||||||
text: this.text.substring(index, realOffset)
|
text: this.text.substring(index, realOffset)
|
||||||
});
|
}, {
|
||||||
parts.push({
|
|
||||||
correct: false,
|
correct: false,
|
||||||
text: this.text.substring(realOffset, realOffset + current.length)
|
text: this.text.substring(realOffset, realOffset + current.length)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,10 @@
|
||||||
@click="$emit('turnIn')"
|
@click="$emit('turnIn')"
|
||||||
>{{action}}
|
>{{action}}
|
||||||
</button>
|
</button>
|
||||||
<button class="submission-form-container__submit submission-form-container__spellcheck button button--primary button--white-bg"
|
<button
|
||||||
v-if="spellcheck"
|
class="submission-form-container__submit submission-form-container__spellcheck button button--primary button--white-bg"
|
||||||
@click="$emit('spellcheck')"
|
v-if="spellcheck"
|
||||||
|
@click="$emit('spellcheck')"
|
||||||
>Rechtschreibung prüfen
|
>Rechtschreibung prüfen
|
||||||
</button>
|
</button>
|
||||||
<div v-if="userInput.document">
|
<div v-if="userInput.document">
|
||||||
|
|
@ -53,13 +54,6 @@
|
||||||
import DocumentBlock from '@/components/content-blocks/DocumentBlock';
|
import DocumentBlock from '@/components/content-blocks/DocumentBlock';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
SubmissionInput,
|
|
||||||
FinalSubmission,
|
|
||||||
SimpleFileUpload,
|
|
||||||
DocumentBlock
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
userInput: Object,
|
userInput: Object,
|
||||||
saved: Boolean,
|
saved: Boolean,
|
||||||
|
|
@ -68,12 +62,19 @@
|
||||||
reopen: Function,
|
reopen: Function,
|
||||||
document: String,
|
document: String,
|
||||||
spellcheck: {
|
spellcheck: {
|
||||||
tyoe: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
sharedMsg: String
|
sharedMsg: String
|
||||||
},
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
SubmissionInput,
|
||||||
|
FinalSubmission,
|
||||||
|
SimpleFileUpload,
|
||||||
|
DocumentBlock
|
||||||
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
final() {
|
final() {
|
||||||
return !!this.userInput && this.userInput.final
|
return !!this.userInput && this.userInput.final
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@ import requests
|
||||||
# client = TaskbaseClient('info@iterativ.ch', 'myverysafepassword1234', 'https://dev-iterativ.taskbase.com')
|
# client = TaskbaseClient('info@iterativ.ch', 'myverysafepassword1234', 'https://dev-iterativ.taskbase.com')
|
||||||
# client.spellcheck('aOciP9H7tNu7pLsR4ohllk', 'Dies ist ein Sats mit filen Felern')
|
# client.spellcheck('aOciP9H7tNu7pLsR4ohllk', 'Dies ist ein Sats mit filen Felern')
|
||||||
|
|
||||||
|
class TaskbaseException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
class TaskbaseClient:
|
class TaskbaseClient:
|
||||||
# def __init__(self, resource_url):
|
# def __init__(self, resource_url):
|
||||||
# # resource url should be in the form https://username:password@baseurl
|
# # resource url should be in the form https://username:password@baseurl
|
||||||
|
|
@ -59,9 +62,9 @@ class TaskbaseClient:
|
||||||
headers=headers)
|
headers=headers)
|
||||||
|
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
raise Exception('Something went wrong')
|
raise TaskbaseException('Something went wrong')
|
||||||
else: # todo: define what to do here
|
else: # todo: define what to do here
|
||||||
raise Exception('Something went wrong')
|
raise TaskbaseException('Something went wrong')
|
||||||
|
|
||||||
def spellcheck(self, task, text):
|
def spellcheck(self, task, text):
|
||||||
if self.token is None:
|
if self.token is None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue