Skip to content

Commit fa83acf

Browse files
committed
Unrated Solutions: выделять решения контрольных работ
1 parent bfb8da0 commit fa83acf

5 files changed

Lines changed: 13 additions & 3 deletions

File tree

HwProj.APIGateway/HwProj.APIGateway.API/Controllers/SolutionsController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ public async Task<UnratedSolutionPreviews> GetUnratedSolutions(long? taskId)
492492
GroupId = solution.GroupId,
493493
SentAfterDeadline = solution.IsFirstTry && task.DeadlineDate != null &&
494494
solution.PublicationDate > task.DeadlineDate,
495-
IsCourseCompleted = course.IsCompleted
495+
IsCourseCompleted = course.IsCompleted,
496+
IsTest = task.Tags.Contains(HomeworkTags.Test)
496497
};
497498
})
498499
.ToArray();

HwProj.APIGateway/HwProj.APIGateway.API/Models/Solutions/SolutionPreviewView.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class SolutionPreviewView
1717
public bool IsFirstTry { get; set; }
1818
public bool SentAfterDeadline { get; set; }
1919
public bool IsCourseCompleted { get; set; }
20+
public bool IsTest { get; set; }
2021
}
2122

2223
public class UnratedSolutionPreviews

hwproj.front/src/api/api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,6 +2076,12 @@ export interface SolutionPreviewView {
20762076
* @memberof SolutionPreviewView
20772077
*/
20782078
isCourseCompleted?: boolean;
2079+
/**
2080+
*
2081+
* @type {boolean}
2082+
* @memberof SolutionPreviewView
2083+
*/
2084+
isTest?: boolean;
20792085
}
20802086
/**
20812087
*

hwproj.front/src/components/Common/HomeworkTags.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const DefaultTags = [TestTag, BonusTag, GroupWorkTag]
99
export const isTestWork = (tagsOwner: { tags?: string[] }) => tagsOwner.tags?.includes(TestTag) ?? false
1010
export const isBonusWork = (tagsOwner: { tags?: string[] }) => tagsOwner.tags?.includes(BonusTag) ?? false
1111

12-
const TestTip: FC = () => <sup style={{color: "#2979ff"}}> тест</sup>
12+
export const TestTip: FC = () => <sup style={{color: "#2979ff"}}> тест</sup>
1313
const BonusTip: FC = () => <sup style={{color: "green"}}> бонус</sup>
1414

1515
export const getTip = (tagsOwner: { tags?: string[] }) => {

hwproj.front/src/components/Solutions/UnratedSolutionsAndOpenQuestions.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Utils from "../../services/Utils";
1414
import {RatingStorage} from "../Storages/RatingStorage";
1515
import TextField from "@mui/material/TextField";
1616
import ApiSingleton from "@/api/ApiSingleton";
17+
import {TestTip} from "@/components/Common/HomeworkTags";
1718

1819
interface IUnratedSolutionsProps {
1920
unratedSolutionsPreviews: UnratedSolutionPreviews
@@ -212,8 +213,9 @@ const UnratedSolutionsAndOpenQuestions: FC<IUnratedSolutionsProps> = (props) =>
212213
to={`/task/${solution.taskId}/${solution.student!.userId}`}
213214
style={{color: "#212529"}}
214215
>
215-
<Typography style={{fontSize: "20px"}}>
216+
<Typography style={{fontSize: "20px"}} color={solution.isTest ? "primary" : "default"}>
216217
{solution.student!.surname} {solution.student!.name} {" • "} {solution.taskTitle}
218+
{solution.isTest && <TestTip/>}
217219
</Typography>
218220
</NavLink>
219221
</Grid>

0 commit comments

Comments
 (0)