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,
|
||||
};
|
||||
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);
|
||||
|
||||
@ -444,7 +458,7 @@ export class ExamCorrect {
|
||||
const body = {
|
||||
user: listItem.getAttribute(EXAM_CORRECT_USER_ATTR),
|
||||
results: results.partResults,
|
||||
grade: results.result,
|
||||
grade: { status: results.result },
|
||||
};
|
||||
|
||||
this._app.httpClient.post({
|
||||
|
||||
@ -37,7 +37,7 @@ $newline never
|
||||
<option value="none">
|
||||
_{MsgExamResultNone}
|
||||
$if examShowGrades
|
||||
<option value="result">
|
||||
<option value="attended">
|
||||
_{MsgExamResult}
|
||||
$else
|
||||
<option value="passed">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user