fix(exam-correct): send correct results
This commit is contained in:
parent
66317a41dc
commit
2ca56fb8b1
@ -226,7 +226,21 @@ export class ExamCorrect {
|
|||||||
user: userId || user,
|
user: userId || user,
|
||||||
};
|
};
|
||||||
if (results) body.results = results;
|
if (results) body.results = results;
|
||||||
if (result) body.grade = result === 'result' ? this._resultGradeSelect.value : (result === 'delete' ? null : result);
|
if (result) {
|
||||||
|
switch (result) {
|
||||||
|
case 'delete': {
|
||||||
|
body.grade = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'attended': {
|
||||||
|
body.grade = { status: result, result: this._resultGradeSelect.value };
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
body.grade = { status: result };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log('request body', body);
|
console.log('request body', body);
|
||||||
|
|
||||||
@ -444,7 +458,7 @@ export class ExamCorrect {
|
|||||||
const body = {
|
const body = {
|
||||||
user: listItem.getAttribute(EXAM_CORRECT_USER_ATTR),
|
user: listItem.getAttribute(EXAM_CORRECT_USER_ATTR),
|
||||||
results: results.partResults,
|
results: results.partResults,
|
||||||
grade: results.result,
|
grade: { status: results.result },
|
||||||
};
|
};
|
||||||
|
|
||||||
this._app.httpClient.post({
|
this._app.httpClient.post({
|
||||||
|
|||||||
@ -37,7 +37,7 @@ $newline never
|
|||||||
<option value="none">
|
<option value="none">
|
||||||
_{MsgExamResultNone}
|
_{MsgExamResultNone}
|
||||||
$if examShowGrades
|
$if examShowGrades
|
||||||
<option value="result">
|
<option value="attended">
|
||||||
_{MsgExamResult}
|
_{MsgExamResult}
|
||||||
$else
|
$else
|
||||||
<option value="passed">
|
<option value="passed">
|
||||||
|
|||||||
Reference in New Issue
Block a user