new_feedback

This commit is contained in:
ahmed531998 2023-04-15 11:23:07 +02:00
parent 0abf2becfe
commit c2a27c2676
1 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,7 @@ const FeedbackForm = (props) => {
const [modQueryCorrectness, setModQueryCorrectness] = useState("no");
const [modQuery, setModQuery] = useState("");
const [response, setResponse] = useState("");
const [evidence, setEvidence] = useState("NA");
const backendUrl = '/api';//process.env.REACT_APP_BACKEND_URL+'/api';
const mod = "Was this modification to the query correct? " + messages[0].modQuery
function onSubmit(event) {
@ -35,6 +36,7 @@ const FeedbackForm = (props) => {
ratings["usefulness"] = responseUsefulness;
ratings["speed"] = responseTime;
ratings["intent"] = intent;
ratings["evidence"] = evidence;
fetch(backendUrl + '/feedback', {
method: 'POST',
@ -121,6 +123,20 @@ const FeedbackForm = (props) => {
<option value="acceptable">acceptable</option>
</select>
</div>
<div class="feedback-question">
<label for="evidence-usefulness">
If applicable, was the answer contained in the evidence?
</label>
<select
id="evidence-usefulness"
name="If applicable, was the answer contained in the evidence?"
onChange={(e) => setEvidence(e.target.value)}
>
<option value="yes">yes</option>
<option value="no">no</option>
<option value="NA">no</option>
</select>
</div>
<div class="feedback-question">
<label for="query-intent">What was your intent?</label>
<select