Skip to content

Commit

Permalink
Showing 3 changed files with 13 additions and 12 deletions.
16 changes: 8 additions & 8 deletions client/src/app/class/_services/dashboard.service.ts
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ export class DashboardService {

if (item) {
itemCount = item.inputs.length;
customScore = item.customScore? item.customScore: null
customScore = !isNaN(item.customScore)? item.customScore: null
const metadata = item.metadata;
if (metadata) {
lastModified = metadata['lastModified'];
@@ -388,8 +388,8 @@ export class DashboardService {
maxValueAnswer = maxValueAnswer + max;
}
score = totalCorrect;
scorePercentageCorrect = customScore ? customScore : this.classUtils.round(totalCorrect / maxValueAnswer * 100, 2);
if (customScore) {
scorePercentageCorrect = !isNaN(customScore) ? customScore : this.classUtils.round(totalCorrect / maxValueAnswer * 100, 2);
if (!isNaN(customScore)) {
maxValueAnswer = 100
}
}
@@ -430,7 +430,7 @@ export class DashboardService {
totalIncorrect: totalIncorrect,
maxValueAnswer: maxValueAnswer,
totalCorrect: totalCorrect,
scorePercentageCorrect: scorePercentageCorrect,
scorePercentageCorrect: !isNaN(customScore) ? customScore : scorePercentageCorrect,
duration: duration,
customScore: customScore
};
@@ -503,15 +503,15 @@ export class DashboardService {
studentResults.score = score;
// console.log("student: " + studentResults["name"] + " form item: " + studentResults["response"]["formTitle"] + " score: " + score)
}
const max = studentResponse.customScore? 100: studentResponse.max;
const max = !isNaN(studentResponse.customScore)? 100: studentResponse.max;
if (max) {
studentResults.max = max;
classGroupReportMax = max;
}
const totalCorrect = studentResponse.customScore ? studentResponse.customScore : studentResponse.totalCorrect;
const scorePercentageCorrect = studentResponse.customScore ? studentResponse.customScore : studentResponse.scorePercentageCorrect;
const totalCorrect = !isNaN(studentResponse.customScore) ? studentResponse.customScore : studentResponse.totalCorrect;
const scorePercentageCorrect = !isNaN(studentResponse.customScore) ? studentResponse.customScore : studentResponse.scorePercentageCorrect;
studentResults.scorePercentageCorrect = scorePercentageCorrect;
const maxValueAnswer = studentResponse.customScore ? 100: studentResponse.maxValueAnswer;
const maxValueAnswer = !isNaN(studentResponse.customScore) ? 100: studentResponse.maxValueAnswer;
studentResults.maxValueAnswer = maxValueAnswer;
studentResults.customScore = studentResponse.customScore
duration = studentResponse.duration;
Original file line number Diff line number Diff line change
@@ -74,11 +74,11 @@ <h2>{{subtestReport.label}}</h2>
<td>
<span *ngFor="let res of generateArray(item.value)">
<ng-container *ngIf="res.value">
<ng-container *ngIf="res.value.percentage">
<ng-container *ngIf="res.value.percentage && !res.value.customScore">
({{tNumber(res.value.rawScore)}}/{{tNumber(res.value.totalGridAnswers)}}) {{tNumber(res.value.percentage)}}
</ng-container>
<ng-container *ngIf="!res.value.percentage">
({{tNumber(res.value.rawScore)}}/{{tNumber(res.value.totalGridAnswers)}})
<ng-container *ngIf="res.value.customScore||res.value.customScore===0">
{{(tNumber(res.value.customScore))|number : '1.2-2'}}%
</ng-container>
<!--<span *ngIf="res.value.totalCorrect">{{res.value.totalCorrect}}</span>-->
</ng-container>
Original file line number Diff line number Diff line change
@@ -217,7 +217,8 @@ export class StudentSubtestReportComponent implements OnInit, AfterViewChecked {
rawScore: result.score,
totalGridAnswers: result.maxValueAnswer,
percentage: percentage,
totalCorrect: totalCorrect
totalCorrect: totalCorrect,
customScore: result.customScore
};
resultObject[category] = scores;
const currentTotal = this.totals[category];

0 comments on commit 3e731aa

Please sign in to comment.