[O] Move name parsing to course

This commit is contained in:
Hykilpikonna
2019-11-06 18:15:54 -05:00
parent 6f5c4f3a09
commit fbb9352546
2 changed files with 3 additions and 5 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import {Assignment} from '@/components/app/app';
import JsonUtils from '@/utils/json-utils';
import Constants from '@/constants';
import {FormatUtils} from '@/utils/format-utils';
export default class Course
{
@@ -38,7 +39,7 @@ export default class Course
{
this.id = courseJson.id;
this.assignmentsId = courseJson.assignmentsId;
this.name = courseJson.name;
this.name = FormatUtils.parseText(courseJson.name).trim();
this.teacherName = courseJson.teacherName;
this.status = courseJson.status;
+1 -4
View File
@@ -1,5 +1,5 @@
import {Course} from '@/components/app/app';
import {FormatUtils} from '@/utils/format-utils';
import Course from '@/logic/course';
const LEVEL_AP = {level: 'AP', scaleUp: 1};
const LEVEL_H = {level: 'H', scaleUp: 0.75};
@@ -72,9 +72,6 @@ export class CourseUtils
{
for (let course of courses)
{
// Parse name
course.name = FormatUtils.parseText(course.name).trim();
// Detect level
let level = this.detectLevel(course.name);
if (level != undefined)