mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: remove testing leftovers
This commit is contained in:
parent
b564c8db64
commit
c7061a26fa
16 changed files with 30 additions and 71 deletions
|
|
@ -29,7 +29,7 @@ function ImageBlockComponent(props: any) {
|
|||
let modifiedQuestions = [...questions];
|
||||
modifiedQuestions.splice(index, 1);
|
||||
setQuestions(modifiedQuestions);
|
||||
console.log(questions);
|
||||
|
||||
|
||||
// remove the answers from the answers array
|
||||
let modifiedAnswers = [...answers];
|
||||
|
|
@ -79,17 +79,17 @@ function ImageBlockComponent(props: any) {
|
|||
option_id: option_id,
|
||||
};
|
||||
setAnswers([...answers, answer]);
|
||||
console.log(answers);
|
||||
|
||||
};
|
||||
|
||||
const saveQuiz = async () => {
|
||||
// save the questions and answers to the backend
|
||||
console.log("saving quiz");
|
||||
console.log(questions);
|
||||
console.log(answers);
|
||||
|
||||
|
||||
|
||||
try {
|
||||
let res = await submitQuizBlock(props.extension.options.activity.activity_id, {questions : questions , answers : answers})
|
||||
console.log(res.block_id);
|
||||
|
||||
props.updateAttributes({
|
||||
quizId: {
|
||||
value : res.block_id
|
||||
|
|
@ -98,7 +98,7 @@ function ImageBlockComponent(props: any) {
|
|||
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -112,9 +112,9 @@ function ImageBlockComponent(props: any) {
|
|||
|
||||
React.useEffect(() => {
|
||||
// fetch the questions and options from the backend
|
||||
console.log("fetching questions");
|
||||
console.log(questions);
|
||||
console.log(answers);
|
||||
|
||||
|
||||
|
||||
}, [questions, answers]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue