Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-049
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
0
Merge Requests
0
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
2021-049
2021-049
Commits
847a6825
Commit
847a6825
authored
Oct 13, 2021
by
Devinda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix errors automatic_question/ lessonandexampage/question_bank/lessonupload
parent
3491792d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
52 deletions
+46
-52
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/UploadPage.tsx
...rtcoach-frontend/src/Components/IT18050240/UploadPage.tsx
+43
-43
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
...-frontend/src/Components/IT18050240/automatic_question.js
+1
-1
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/lessonandexampage.js
...h-frontend/src/Components/IT18050240/lessonandexampage.js
+1
-5
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/question_bank.js
...coach-frontend/src/Components/IT18050240/question_bank.js
+1
-3
WebFrontEnd/smartcoach-frontend/src/Images/pdficon.png
WebFrontEnd/smartcoach-frontend/src/Images/pdficon.png
+0
-0
No files found.
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/UploadPage.tsx
View file @
847a6825
import
React
,
{
PureComponent
}
from
'
react
'
;
import
axios
from
'
axios
'
;
import
Upload
from
'
../../Images/upload.png
'
;
import
PDF
from
'
../../Images/pdficon.png
'
;
import
PW
from
'
../../Images/pptxicon.png
'
;
...
...
@@ -13,7 +13,8 @@ interface UploadState {
imagename
:
string
;
filetype
:
string
,
lessonname
:
string
,
lessonno
:
string
,
lessonno
:
any
,
filename
:
string
};
class
UploadPage
extends
PureComponent
<
{},
UploadState
>
{
...
...
@@ -29,6 +30,7 @@ class UploadPage extends PureComponent<{}, UploadState> {
filetype
:
''
,
lessonname
:
''
,
lessonno
:
''
,
filename
:
''
};
}
...
...
@@ -36,7 +38,23 @@ class UploadPage extends PureComponent<{}, UploadState> {
this
.
fetchRecent
();
}
componentDidUpdate
=
()
=>
{
// let str = this.state.recentImage.filename;
this
.
fetchRecent
();
}
fetchRecent
=
()
=>
{
axios
.
get
(
'
http://localhost:5000/recent
'
)
.
then
((
response
)
=>
{
this
.
setState
({
filename
:
response
.
data
.
filename
,
lessonname
:
response
.
data
.
lessonname
,
lessonno
:
response
.
data
.
lessonno
});
})
.
catch
(
err
=>
alert
(
'
Error:
'
+
err
));
//let str = this.state.filename;
//
// if (str.includes(".pdf")) {
// this.setState({
...
...
@@ -49,26 +67,6 @@ class UploadPage extends PureComponent<{}, UploadState> {
// filetype :".pptx"
// });
// }
// else {
//
// }
}
fetchRecent
=
()
=>
{
axios
.
get
(
'
http://localhost:5000/recent
'
)
.
then
((
response
)
=>
{
this
.
setState
({
recentImage
:
response
.
data
.
image
});
})
.
catch
(
err
=>
alert
(
'
Error:
'
+
err
));
if
(
this
.
state
.
filetype
==
""
){
this
.
setState
({
imagename
:
PW
,
filetype
:
""
,
lessonname
:
""
,
lessonno
:
""
,
});
}
}
uploadImage
=
()
=>
{
...
...
@@ -94,9 +92,12 @@ class UploadPage extends PureComponent<{}, UploadState> {
return
(
<
div
className=
"UploadPage"
>
<
div
className=
"Recent"
>
<
div
className=
"container text-left"
>
<
div
className=
"col-10"
>
<
hr
/>
<
div
className=
"row"
>
<
div
className=
"col-sm-
5
"
>
<
div
className=
"col-sm-
6
"
>
<
label
>
Lesson name:
</
label
>
<
div
style=
{
{
padding
:
'
0px
'
}
}
>
<
input
type=
"text"
required
className=
"form-control"
...
...
@@ -105,7 +106,7 @@ class UploadPage extends PureComponent<{}, UploadState> {
</
div
>
</
div
>
<
div
className=
"col-sm-
5
"
>
<
div
className=
"col-sm-
6
"
>
<
label
>
Lesson no:
</
label
>
<
div
style=
{
{
padding
:
'
0px
'
}
}
>
<
input
type=
"text"
required
className=
"form-control"
...
...
@@ -116,7 +117,7 @@ class UploadPage extends PureComponent<{}, UploadState> {
</
div
>
<
div
className=
"row"
>
<
div
className=
"col-sm-
5
"
>
<
div
className=
"col-sm-
6
"
>
<
label
>
Lesson caption:
</
label
>
<
div
style=
{
{
padding
:
'
0px
'
}
}
>
<
input
...
...
@@ -129,7 +130,7 @@ class UploadPage extends PureComponent<{}, UploadState> {
</
div
>
</
div
>
<
div
className=
"col-sm-
5
"
>
<
div
className=
"col-sm-
6
"
>
<
label
>
Upload file:
</
label
>
<
div
style=
{
{
padding
:
'
0px
'
}
}
>
<
input
...
...
@@ -152,35 +153,34 @@ class UploadPage extends PureComponent<{}, UploadState> {
<
div
className=
"row"
>
<
div
className=
"col-sm-5"
>
<
button
type
="
submit
"
value
="
Submit
"
className
=
"
btn
btn
-
block
btn
-
warning
mt
-3"
onClick=
{
this
.
uploadImage
}
>
ADD
</
button
>
</
div
>
<
div
className=
"col-sm-5"
>
<
div
className=
"col-sm-12"
>
<
button
type
="
submit
"
value
="
Submit
"
className
=
"
btn
btn
-
block
btn
-
success
mt
-3"
onClick=
{
this
.
uploadImage
}
>
ADD
</
button
>
</
div
>
</
div
>
</
div
>
<
br
/><
br
/>
<
br
/><
br
/>
<
div
className=
"border"
>
<
div
style=
{
{
margin
:
"
15px
"
}
}
>
<
h5
className=
"text-center"
>
Recent Upload File
</
h5
>
<
p
className=
"text-center"
>
File type : (.pdf)
<
img
src=
{
PDF
}
alt=
"upload-image"
style=
{
{
width
:
'
30px
'
}
}
/>
</
p
>
<
p
className=
"text-center"
>
Lesson No: 1
{
this
.
state
.
lessonno
}
</
p
>
<
p
className=
"text-center"
>
Lesson Name: Accounting
{
this
.
state
.
lessonname
}
</
p
>
<
div
className=
"border"
>
<
div
style=
{
{
margin
:
"
15px
"
}
}
>
<
h5
className=
"text-center"
>
Recent Upload File
</
h5
>
{
/*<p className="text-center"> File type : ({this.state.filetype} ) <img src={this.state.imagename} alt="upload-image" style={{width:'30px'}}/> </p>*/
}
{
/*<p className="text-center"> This quiz closed on Sunday,02 May 2021,7:10PM</p>*/
}
<
p
className=
"text-center"
>
time limit :1 hour 30 mins
</
p
>
<
p
className=
"text-center"
>
Grading method: highest grade
</
p
>
</
div
>
</
div
>
</
div
>
</
div
>
<
br
/><
br
/>
</
div
></
div
>
</
div
>
);
}
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/automatic_question.js
View file @
847a6825
...
...
@@ -56,7 +56,7 @@ export default class Automatic_question extends Component {
/>
<
br
/>
<
button
className
=
"
btn btn-block btn btn-secondary
"
type
=
"
submit
"
value
=
"
Submit
"
style
=
{{
color
:
"
white
"
}}
>
Create
new
Question
<
/button
>
<
button
className
=
"
btn btn-block btn btn-secondary
"
type
=
"
submit
"
value
=
"
Submit
"
style
=
{{
color
:
"
white
"
}}
>
Create
New
Quiz
<
/button
>
<
/div
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/lessonandexampage.js
View file @
847a6825
...
...
@@ -29,10 +29,6 @@ export default class LessonAndExam extends Component {
render
(){
return
(
<
div
className
=
"
container
"
>
<
div
className
=
"
p-3 mb-2 bg-light text-dark text-left
"
>
Accounting
Lecture
<
/div
>
<
div
className
=
"
text-left ml-3
"
>
<
p
>
First
lab
session
will
be
started
from
10
/
02
/
2021
at
4.00
pm
<
/p
>
<
/div
>
{
this
.
state
.
lessonList
.
map
((
file
)
=>
(
...
...
@@ -40,7 +36,7 @@ export default class LessonAndExam extends Component {
<
div
className
=
""
>
<
div
className
=
"
p-3 mb-2 bg-light text-dark text-left
"
>
Accounting
Lecture
{
file
.
lessonno
}
<
/div
>
<
div
className
=
"
text-left ml-3
"
>
<
p
>
First
lab
session
will
be
started
from
10
/
02
/
2021
at
4.00
pm
<
/p
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-1
"
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/IT18050240/question_bank.js
View file @
847a6825
...
...
@@ -91,10 +91,8 @@ export default class QuestionBankUI extends Component {
return
(
<
div
className
=
"
container text-left
"
>
<
div
className
=
"
col-sm-10
"
>
<
h4
>
Business
Studies
<
/h4
>
<
h6
>
Dashboard
/
My
courses
/
Business
Studies
/
Question
bank
/
Questions
<
/h6
>
<
hr
/>
<
/div
>
...
...
WebFrontEnd/smartcoach-frontend/src/Images/pdficon.png
0 → 100644
View file @
847a6825
14.2 KB
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