Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-158
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-158
2022-158
Commits
7d09bcd9
Commit
7d09bcd9
authored
Nov 16, 2022
by
Jayasith H.B.C
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT19079264' into 'master'
It19079264 See merge request
!124
parents
6c8ea0b8
7e0ad93d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
59 deletions
+42
-59
backend/.idea/dataSources.xml
backend/.idea/dataSources.xml
+0
-17
backend/database.db
backend/database.db
+0
-0
backend/routes/submission_routes.py
backend/routes/submission_routes.py
+10
-11
backend/services/use_case_model_detection_service.py
backend/services/use_case_model_detection_service.py
+1
-1
backend/submissions/use_case/usecase.jpg
backend/submissions/use_case/usecase.jpg
+0
-0
frontend/src/pages/StudentDashboard.js
frontend/src/pages/StudentDashboard.js
+8
-3
frontend/src/pages/StudentSubjectAssingment.js
frontend/src/pages/StudentSubjectAssingment.js
+19
-21
frontend/src/pages/SubjectsStudent.js
frontend/src/pages/SubjectsStudent.js
+3
-5
frontend/src/routes/Routes.js
frontend/src/routes/Routes.js
+1
-1
No files found.
backend/.idea/dataSources.xml
deleted
100644 → 0
View file @
6c8ea0b8
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"DataSourceManagerImpl"
format=
"xml"
multifile-model=
"true"
>
<data-source
source=
"LOCAL"
name=
"database"
uuid=
"8d770d62-9fb6-4013-a5cd-9e7552c294c7"
>
<driver-ref>
sqlite.xerial
</driver-ref>
<synchronize>
true
</synchronize>
<jdbc-driver>
org.sqlite.JDBC
</jdbc-driver>
<jdbc-url>
jdbc:sqlite:D:\Nanduni.Bsc\research_code\2022-158\backend\database.db
</jdbc-url>
<working-dir>
$ProjectFileDir$
</working-dir>
<libraries>
<library>
<url>
file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.39.2/sqlite-jdbc-3.39.2.jar
</url>
</library>
</libraries>
</data-source>
</component>
</project>
\ No newline at end of file
backend/database.db
0 → 100644
View file @
7d09bcd9
File added
backend/routes/submission_routes.py
View file @
7d09bcd9
...
...
@@ -14,25 +14,24 @@ submission = Blueprint('submissions', __name__, url_prefix='/api/v1/submissions'
@
submission
.
post
(
'/upload'
)
@
jwt_required
()
def
upload_submission
():
user_id
=
get_jwt_identity
()
user_id
=
1
image
=
request
.
files
[
'file'
]
json_data
=
json
.
loads
(
request
.
form
[
'
data'
])
submission_type
=
json_data
[
'type'
]
assignment_id
=
json_data
[
'id'
]
comment
=
json_data
[
'comment'
]
# json_data = json.loads(request.form['json
data'])
#
submission_type = json_data['type']
#
assignment_id = json_data['id']
#
comment = json_data['comment']
if
submission_type
is
None
or
image
is
None
or
assignment_id
is
None
:
if
image
is
None
:
return
jsonify
({
'err'
:
'invalid request '
}),
HTTP_400_BAD_REQUEST
elif
submission_type
==
'use case
'
:
use_case_obj
=
save_submission
(
assignment_id
,
image
,
submission_type
,
comment
,
user_id
)
elif
image
.
filename
==
'usecase.jpg
'
:
use_case_obj
=
save_submission
(
1
,
image
,
"use case"
,
"comment"
,
user_id
)
model_object_detection
(
image
.
filename
,
use_case_obj
.
id
)
return
jsonify
({
'message'
:
'upload successful '
}),
HTTP_200_OK
elif
submission_type
==
'class
'
:
class_obj
=
save_submission
(
assignment_id
,
image
,
submission_type
,
comment
,
user_id
)
elif
image
.
filename
==
'class.jpg
'
:
class_obj
=
save_submission
(
1
,
image
,
"class"
,
"comment"
,
user_id
)
component_separation
(
image
.
filename
,
class_obj
.
id
)
return
jsonify
({
'id'
:
str
(
class_obj
.
id
)}),
HTTP_200_OK
else
:
...
...
backend/services/use_case_model_detection_service.py
View file @
7d09bcd9
...
...
@@ -14,7 +14,7 @@ import tensorflow as tf
from
config.database
import
db
from
models.actor_and_use_case
import
ActorANDUseCase
#
pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
pytesseract
.
pytesseract
.
tesseract_cmd
=
'C:
\\
Program Files
\\
Tesseract-OCR
\\
tesseract.exe'
from
services.extend_include_relationship_detection_service
import
detect_extend_include_relationship
from
services.generalization_relationship_detection_service
import
detect_generalization_relationship
...
...
backend/submissions/use_case/
test18
.jpg
→
backend/submissions/use_case/
usecase
.jpg
View file @
7d09bcd9
File moved
frontend/src/pages/StudentDashboard.js
View file @
7d09bcd9
...
...
@@ -40,14 +40,14 @@ const StudentDashboard = () => {
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{}
<
/td
>
<
td
>
{
item
.
id
}
<
/td
>
<
td
>
{
item
.
code
}
<
/td
>
<
td
>
{
item
.
name
}
<
/td
>
<
td
>
{
item
.
assignment_type
}
<
/td
>
<
td
>
{
item
.
title
}
<
/td
>
<
td
>
{
new
Date
(
item
.
start_at
).
toLocaleString
()}
<
/td
>
<
td
>
{
new
Date
(
item
.
en
d_at
).
toLocaleString
()}
<
/td
>
<
td
>
{
new
Date
(
item
.
update
d_at
).
toLocaleString
()}
<
/td
>
<
/tr
>
);
...
...
@@ -56,10 +56,14 @@ const StudentDashboard = () => {
const
res
=
await
axios
.
get
(
`assignments`
);
setStudentSubjects
(
res
.
data
.
assignments
);
setIsLoading
(
false
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
console
.
log
(
StudentSubjects
);
useEffect
(()
=>
getAllSubjects
(),
[]);
return
(
...
...
@@ -130,13 +134,14 @@ const StudentDashboard = () => {
{
/* {isLoading ? (
<Spinner />
) : orderDetails.length > 0 ? ( */
}
{
StudentSubjects
.
length
!==
0
?
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
StudentSubjects
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
/>
:''
}
{
/* ) : (
<>
{setError("No Assignments found")}
...
...
frontend/src/pages/StudentSubjectAssingment.js
View file @
7d09bcd9
...
...
@@ -29,6 +29,8 @@ const StudentSubjectAssingment = () => {
const
[
Id
,
setId
]
=
useState
(
""
);
const
[
ItemName
,
setItemName
]
=
useState
(
""
);
const
[
Description
,
setDescription
]
=
useState
(
""
);
const
[
data
,
setData
]
=
useState
({
id
:
"
1
"
,
comment
:
"
comment
"
,
type
:
"
use case
"
});
const
[
file
,
setFile
]
=
useState
(
null
);
const
[
Order
,
setOrder
]
=
useState
({
item
:
{},
...
...
@@ -51,28 +53,26 @@ const StudentSubjectAssingment = () => {
}
};
const
fileHandler
=
(
e
)
=>
{
const
selectedFile
=
e
.
target
.
files
[
0
];
setFile
(
selectedFile
);
}
useEffect
(()
=>
{
FetchData
();
},
[]);
const
deleteHandler
=
async
(
id
)
=>
{
console
.
log
(
id
);
try
{
const
res
=
await
axios
.
delete
(
`/orders/delete/
${
id
}
`
);
if
(
res
.
statusText
===
"
OK
"
)
{
window
.
location
.
reload
();
}
}
catch
(
Err
)
{
console
.
log
(
Err
.
response
);
}
};
const
orderHandler
=
async
()
=>
{
const
upload
=
async
(
e
)
=>
{
console
.
log
(
data
);
console
.
log
(
file
);
try
{
console
.
log
(
Order
);
const
res
=
await
axios
.
post
(
"
/orders
"
,
Order
);
const
formData
=
new
FormData
();
formData
.
append
(
"
jsondata
"
,
data
);
formData
.
append
(
"
file
"
,
file
);
console
.
log
(
formData
);
const
res
=
await
axios
.
post
(
"
/submissions/upload
"
,
formData
);
if
(
res
.
statusText
===
"
OK
"
)
{
window
.
location
.
reload
(
);
console
.
log
(
res
.
data
);
}
}
catch
(
Err
)
{
console
.
log
(
Err
.
response
);
...
...
@@ -131,7 +131,7 @@ const StudentSubjectAssingment = () => {
<
MdDelete
onClick
=
{()
=>
{
if
(
window
.
confirm
(
"
Are you sure to delete this request?
"
))
{
deleteHandler
(
item
.
_id
);
}
}}
/
>
...
...
@@ -251,15 +251,13 @@ const StudentSubjectAssingment = () => {
style
=
{{
float
:
"
right
"
}}
accept
=
"
.png, .jpg, .jpeg
"
type
=
"
file
"
onChange
=
{(
e
)
=>
setOrder
({
...
Order
,
quantity
:
e
.
target
.
value
})
}
onChange
=
{
fileHandler
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
row-user
"
>
<
button
type
=
"
submit
"
>
Submit
<
/button
>
<
button
type
=
"
submit
"
onClick
=
{
upload
}
>
Submit
<
/button
>
<
/div
>
<
/div
>
<
/div
>
...
...
frontend/src/pages/SubjectsStudent.js
View file @
7d09bcd9
...
...
@@ -16,15 +16,12 @@ const SubjectsStudent = () => {
const
[
isLoading
,
setIsLoading
]
=
useState
(
true
);
const
[
StudentSubjects
,
setStudentSubjects
]
=
useState
([]);
const
fields
=
[
""
,
"
ID
"
,
"
Module Code
"
,
"
Module Name
"
,
"
Assignment Type
"
,
"
Title
"
,
"
Start At
"
,
"
End At
"
,
"
Actions
"
,
""
,
];
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
...
...
@@ -68,13 +65,14 @@ const SubjectsStudent = () => {
{
/* {isLoading ? (
<Spinner />
) : orderDetails.length > 0 ? ( */
}
{
StudentSubjects
.
length
!==
0
?
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
StudentSubjects
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
/>
:''
}
{
/* ) : (
<>
{setError("No Assignments found")}
...
...
frontend/src/routes/Routes.js
View file @
7d09bcd9
...
...
@@ -47,7 +47,7 @@ const Routes = () => {
<
Route
exact
path
=
"
/auth/student/modules
"
component
=
{
SubjectsStudent
}
/
>
<
Route
exact
path
=
"
/auth/student/services
"
component
=
{
ManageServices
}
/
>
<
Route
exact
path
=
"
/auth/student/assignment
"
component
=
{
StudentSubjectAssingment
}
/
>
<
Route
exact
path
=
"
/auth/student/assignment
/:id
"
component
=
{
StudentSubjectAssingment
}
/
>
<
/Switch
>
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment