Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoExerciseChecker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
Pipelines
DojoExerciseChecker
Commits
d2da386d
Commit
d2da386d
authored
1 year ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
App => Code improvement
parent
a6c2d19c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ExerciseChecker/src/app.ts
+8
-7
8 additions, 7 deletions
ExerciseChecker/src/app.ts
with
8 additions
and
7 deletions
ExerciseChecker/src/app.ts
+
8
−
7
View file @
d2da386d
...
...
@@ -15,7 +15,6 @@ require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST
import
ClientsSharedConfig
from
'
./sharedByClients/config/ClientsSharedConfig
'
;
import
Styles
from
'
./types/Style
'
;
import
Icon
from
'
./sharedByClients/types/Icon
'
;
import
RecursiveFilesStats
from
'
./shared/helpers/recursiveFilesStats/RecursiveFilesStats
'
;
import
Toolbox
from
'
./shared/helpers/Toolbox
'
;
import
ExerciseCheckerError
from
'
./shared/types/Dojo/ExerciseCheckerError
'
;
...
...
@@ -28,12 +27,14 @@ import ExerciseDockerCompose from './sharedByClients/helpers/Dojo
import
ExerciseResultsSanitizerAndValidator
from
'
./sharedByClients/helpers/Dojo/ExerciseResultsSanitizerAndValidator
'
;
import
ExerciseAssignment
from
'
./sharedByClients/models/ExerciseAssignment
'
;
import
ClientsSharedExerciseHelper
from
'
./sharedByClients/helpers/Dojo/ClientsSharedExerciseHelper
'
;
import
Icon
from
'
./shared/types/Icon
'
;
import
{
version
}
from
'
./config/Version
'
;
(
async
()
=>
{
HttpManager
.
registerAxiosInterceptor
();
console
.
log
(
Styles
.
APP_NAME
(
`
${
Config
.
appName
}
(version
{{VERSION}
})`
));
console
.
log
(
Styles
.
APP_NAME
(
`
${
Config
.
appName
}
(version
${
version
}
)`
));
let
exerciseAssignment
:
ExerciseAssignment
|
undefined
;
let
exerciseDockerCompose
:
ExerciseDockerCompose
;
...
...
@@ -48,7 +49,7 @@ import ClientsSharedExerciseHelper from './sharedByClients/helpers/Dojo
- Download immutables files (maybe throw or show an error if the files have been modified ?)
*/
{
console
.
log
(
Styles
.
INFO
(
`
${
Icon
.
INFO
}
️
Checking the exercise's assignment and his immutable files`
));
console
.
log
(
Styles
.
INFO
(
`
${
Icon
.
INFO
}
️Checking the exercise's assignment and his immutable files`
));
exerciseAssignment
=
await
DojoBackendManager
.
getExerciseAssignment
();
if
(
!
exerciseAssignment
)
{
console
.
error
(
Styles
.
ERROR
(
`
${
Icon
.
ERROR
}
Error while getting the exercise's assignment`
));
...
...
@@ -85,11 +86,11 @@ import ClientsSharedExerciseHelper from './sharedByClients/helpers/Dojo
try
{
await
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
exerciseDockerCompose
.
events
.
on
(
'
step
'
,
(
name
:
string
,
message
:
string
)
=>
{
exerciseDockerCompose
.
events
.
on
(
'
step
'
,
(
_
name
:
string
,
message
:
string
)
=>
{
console
.
log
(
Styles
.
INFO
(
`
${
Icon
.
INFO
}
${
message
}
`
));
});
exerciseDockerCompose
.
events
.
on
(
'
endStep
'
,
(
stepName
:
string
,
message
:
string
,
error
:
boolean
)
=>
{
exerciseDockerCompose
.
events
.
on
(
'
endStep
'
,
(
_
stepName
:
string
,
message
:
string
,
error
:
boolean
)
=>
{
if
(
error
)
{
console
.
error
(
Styles
.
ERROR
(
`
${
Icon
.
ERROR
}
${
message
}
`
));
}
...
...
@@ -119,11 +120,11 @@ import ClientsSharedExerciseHelper from './sharedByClients/helpers/Dojo
try
{
await
new
Promise
<
void
>
((
resolve
)
=>
{
exerciseResultsValidation
.
events
.
on
(
'
step
'
,
(
name
:
string
,
message
:
string
)
=>
{
exerciseResultsValidation
.
events
.
on
(
'
step
'
,
(
_
name
:
string
,
message
:
string
)
=>
{
console
.
log
(
Styles
.
INFO
(
`
${
Icon
.
INFO
}
${
message
}
`
));
});
exerciseResultsValidation
.
events
.
on
(
'
endStep
'
,
(
stepName
:
string
,
message
:
string
,
error
:
boolean
)
=>
{
exerciseResultsValidation
.
events
.
on
(
'
endStep
'
,
(
_
stepName
:
string
,
message
:
string
,
error
:
boolean
)
=>
{
if
(
error
)
{
console
.
error
(
Styles
.
ERROR
(
`
${
Icon
.
ERROR
}
${
message
}
`
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment