[O] Move name parsing to course
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
import {Assignment} from '@/components/app/app';
|
import {Assignment} from '@/components/app/app';
|
||||||
import JsonUtils from '@/utils/json-utils';
|
import JsonUtils from '@/utils/json-utils';
|
||||||
import Constants from '@/constants';
|
import Constants from '@/constants';
|
||||||
|
import {FormatUtils} from '@/utils/format-utils';
|
||||||
|
|
||||||
export default class Course
|
export default class Course
|
||||||
{
|
{
|
||||||
@@ -38,7 +39,7 @@ export default class Course
|
|||||||
{
|
{
|
||||||
this.id = courseJson.id;
|
this.id = courseJson.id;
|
||||||
this.assignmentsId = courseJson.assignmentsId;
|
this.assignmentsId = courseJson.assignmentsId;
|
||||||
this.name = courseJson.name;
|
this.name = FormatUtils.parseText(courseJson.name).trim();
|
||||||
this.teacherName = courseJson.teacherName;
|
this.teacherName = courseJson.teacherName;
|
||||||
this.status = courseJson.status;
|
this.status = courseJson.status;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Course} from '@/components/app/app';
|
|
||||||
import {FormatUtils} from '@/utils/format-utils';
|
import {FormatUtils} from '@/utils/format-utils';
|
||||||
|
import Course from '@/logic/course';
|
||||||
|
|
||||||
const LEVEL_AP = {level: 'AP', scaleUp: 1};
|
const LEVEL_AP = {level: 'AP', scaleUp: 1};
|
||||||
const LEVEL_H = {level: 'H', scaleUp: 0.75};
|
const LEVEL_H = {level: 'H', scaleUp: 0.75};
|
||||||
@@ -72,9 +72,6 @@ export class CourseUtils
|
|||||||
{
|
{
|
||||||
for (let course of courses)
|
for (let course of courses)
|
||||||
{
|
{
|
||||||
// Parse name
|
|
||||||
course.name = FormatUtils.parseText(course.name).trim();
|
|
||||||
|
|
||||||
// Detect level
|
// Detect level
|
||||||
let level = this.detectLevel(course.name);
|
let level = this.detectLevel(course.name);
|
||||||
if (level != undefined)
|
if (level != undefined)
|
||||||
|
|||||||
Reference in New Issue
Block a user