Skip to content
Snippets Groups Projects
Commit aabe228f authored by Quentin Bramas's avatar Quentin Bramas
Browse files

simplify the interface

parent ca27d7ee
Branches
Tags
No related merge requests found
Pipeline #346961 passed with stages
in 1 minute
......@@ -49,13 +49,15 @@ export default ({ slide, slideId, confirmed, confirming }) => (state, actions) =
actions.confirmAnswer({ slideId, answer: state.answer });
}}>
<Answer slideId={slideId} type={slide.type} value={slide.value} />
<div class="form-group">
<button disabled={(state.kind != 'OFFLINE' && (state.finished || state.free)) || confirming ? 'disabled' : ''}
type="submit"
class={btnClass}>
{confirming ? 'Confirmation...' : (confirmed ? 'Confirmé' : 'Confirmer')}
</button>
</div>
{
state.kind != 'OFFLINE' && <div class="form-group">
<button disabled={(state.kind != 'OFFLINE' && (state.finished || state.free)) || confirming ? 'disabled' : ''}
type="submit"
class={btnClass}>
{confirming ? 'Confirmation...' : (confirmed ? 'Confirmé' : 'Confirmer')}
</button>
</div>
}
</form>
</div>
}
......@@ -389,8 +389,9 @@ const actions = {
...state.offlineAnswers,
[shuffledId]: value
};
return { answer: value, offlineConfirmedState, offlineAnswers };
actions.confirmAnswer({ slideId: shuffledId, answer: value });
return {};
//return { answer: value, offlineConfirmedState, offlineAnswers };
}
return { answer: value, confirmed: state.confirmed && value === state.answer }
},
......@@ -512,9 +513,9 @@ Chatgpt peut-il être utilisé pour générer des réponses à des questions d'e
...state.offlineConfirmedState,
[slideId]: { confirmed: true, confirming: false }
};
if (slideId == state.shuffledSlidesIndex[state.currentFreeSlideId]) {
actions.setFreeSlide(state.currentFreeSlideId + 1);
}
//if (slideId == state.shuffledSlidesIndex[state.currentFreeSlideId]) {
// actions.setFreeSlide(state.currentFreeSlideId + 1);
//}
return { offlineConfirmedState };
}
if (slideId == state.currentSlideId) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment