Skip to content

Commit

Permalink
fix: remove pct copy data
Browse files Browse the repository at this point in the history
switch this to use similarity flag.
  • Loading branch information
macite committed Jul 14, 2023
1 parent 3775cfb commit 6bb96b4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/app/api/models/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export class Task extends Entity {
grade?: number;
qualityPts: number;
includeInPortfolio: boolean = true;
pctSimilar: number = 0;
similarityFlag: boolean = false;
numNewComments: number = 0;
hasExtensions: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/services/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ProjectService extends CachedEntityService<Project> {
'submittedGrade',
'portfolioFiles',
'compilePortfolio',
'maxPctCopy',
'similarityFlag',
{
keys: 'hasPortfolio',
toEntityFn: (data: object, key: string, entity: Project, params?: any) => {
Expand Down
1 change: 0 additions & 1 deletion src/app/api/services/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export class TaskService extends CachedEntityService<Task> {
'grade',
'qualityPts',
'includeInPortfolio',
'pctSimilar',
'similarityFlag',
'numNewComments',
'trigger',
Expand Down
4 changes: 2 additions & 2 deletions src/app/common/filters/filters.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ angular.module("doubtfire.common.filters", [])
.filter('studentsWithPlagiarism', ->
(input) ->
if input
_.filter input, (student) -> (student?) && student.maxPctCopy > 0
_.filter input, (student) -> (student?) && student.similarityFlag
else
input
)
Expand All @@ -70,7 +70,7 @@ angular.module("doubtfire.common.filters", [])
.filter('taskWithPlagiarism', ->
(input) ->
if input
_.filter input, (task) -> (task?) && task.pctSimilar > 0
_.filter input, (task) -> (task?) && task.similarityFlag
else
input
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class TaskSimilarityViewComponent implements OnChanges {
this.taskSimilarityService
.update({ taskId: similarity.task.id, id: similarity.id }, { entity: similarity })
.subscribe((_) => {
this.alertsService.success('Updated', 120000);
this.alertsService.success('Similarity flag updated');
similarity.task.similarityFlag = similarity.task.similarityCache.currentValues
.map((s) => {
return s.flagged;
Expand Down
6 changes: 3 additions & 3 deletions src/app/units/states/students-list/students-list.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<button class="btn btn-default" ng-model="tableSort.order" ng-click="sortTableBy('targetGrade')" btn-radio="'targetGrade'">
<i class="fa fa-check"></i> Grade
</button>
<button class="btn btn-default" ng-model="tableSort.order" ng-click="sortTableBy('maxPctCopy')" btn-radio="'maxPctCopy'">
<button class="btn btn-default" ng-model="tableSort.order" ng-click="sortTableBy('similarityFlag')" btn-radio="'similarityFlag'">
<i class="fa fa-eye"></i> Plagiarism
</button>
<button class="btn btn-default" ng-model="tableSort.order" ng-click="sortTableBy('portfolioStatus')" btn-radio="'portfolioStatus'">
Expand Down Expand Up @@ -88,7 +88,7 @@ <h4>No students found</h4>
<a ng-click="sortTableBy('flags')">
Flags
<i ng-show="
tableSort.order == 'maxPctCopy' ||
tableSort.order == 'similarityFlag' ||
tableSort.order == 'targetGrade' ||
tableSort.order == 'portfolioStatus'"
class="ng-hide fa fa-caret-{{tableSort.reverse ? 'down' : 'up'}}"></i>
Expand Down Expand Up @@ -132,7 +132,7 @@ <h4>No students found</h4>
<span class="flag">
<grade-icon grade="project.targetGrade"></grade-icon>
</span>
<span ng-show="project.maxPctCopy > 0" class="flag">
<span ng-show="project.similarityFlag" class="flag">
<i class="fa fa-eye fa-2x" ></i>
</span>
<span ng-show="project.hasPortfolio" class="flag">
Expand Down

0 comments on commit 6bb96b4

Please sign in to comment.