Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
testcenter-frontend
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
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
IQB
discontinued
testcenter-frontend
Commits
4381dd5a
Commit
4381dd5a
authored
5 years ago
by
paflov
Browse files
Options
Downloads
Patches
Plain Diff
implement [PUT] /test endpoint
parent
6c9a5720
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/app.interfaces.ts
+4
-4
4 additions, 4 deletions
src/app/app.interfaces.ts
src/app/backend.service.ts
+11
-13
11 additions, 13 deletions
src/app/backend.service.ts
src/app/start/start.component.ts
+3
-3
3 additions, 3 deletions
src/app/start/start.component.ts
with
18 additions
and
20 deletions
src/app/app.interfaces.ts
+
4
−
4
View file @
4381dd5a
...
@@ -28,7 +28,7 @@ export interface LoginData {
...
@@ -28,7 +28,7 @@ export interface LoginData {
costumTexts
:
KeyValuePair
;
// TODO when backend fixed then change here
costumTexts
:
KeyValuePair
;
// TODO when backend fixed then change here
admintoken
:
string
;
admintoken
:
string
;
workspaces
:
WorkspaceData
[];
workspaces
:
WorkspaceData
[];
is_superadmin
:
boolean
is_superadmin
:
boolean
;
}
}
export
interface
BookletStatus
{
export
interface
BookletStatus
{
...
@@ -39,9 +39,9 @@ export interface BookletStatus {
...
@@ -39,9 +39,9 @@ export interface BookletStatus {
label
:
string
;
label
:
string
;
}
}
export
interface
PersonTokenAnd
BookletDb
Id
{
export
interface
PersonTokenAnd
Test
Id
{
person
t
oken
:
string
;
person
T
oken
:
string
;
bookletDb
Id
:
number
;
test
Id
:
number
;
}
}
export
interface
KeyValuePair
{
export
interface
KeyValuePair
{
...
...
This diff is collapsed.
Click to expand it.
src/app/backend.service.ts
+
11
−
13
View file @
4381dd5a
...
@@ -3,7 +3,7 @@ import { Injectable, Inject } from '@angular/core';
...
@@ -3,7 +3,7 @@ import { Injectable, Inject } from '@angular/core';
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
import
{
Observable
,
of
}
from
'
rxjs
'
;
import
{
Observable
,
of
}
from
'
rxjs
'
;
import
{
catchError
,
switchMap
}
from
'
rxjs/operators
'
;
import
{
catchError
,
switchMap
}
from
'
rxjs/operators
'
;
import
{
LoginData
,
BookletStatus
,
PersonTokenAnd
BookletDb
Id
,
KeyValuePair
}
from
'
./app.interfaces
'
;
import
{
LoginData
,
BookletStatus
,
PersonTokenAnd
Test
Id
,
KeyValuePair
}
from
'
./app.interfaces
'
;
import
{
ErrorHandler
,
ServerError
}
from
'
iqb-components
'
;
import
{
ErrorHandler
,
ServerError
}
from
'
iqb-components
'
;
// ============================================================================
// ============================================================================
...
@@ -87,22 +87,20 @@ export class BackendService {
...
@@ -87,22 +87,20 @@ export class BackendService {
);
);
}
}
// BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
startBooklet
(
code
:
string
,
bookletid
:
string
,
bookletLabel
:
string
):
Observable
<
PersonTokenAndBookletDbId
|
ServerError
>
{
startBooklet
(
code
:
string
,
bookletName
:
string
,
bookletLabel
:
string
):
Observable
<
PersonTokenAndTestId
|
ServerError
>
{
return
this
.
http
return
this
.
http
.
post
<
PersonTokenAndBookletDbId
>
(
this
.
serverSlimUrl
+
'
startbooklet
'
,
{
c
:
code
,
b
:
bookletid
,
bl
:
bookletLabel
})
.
put
<
PersonTokenAndTestId
>
(
this
.
serverUrl2
+
`test_tmp`
,
{
code
,
bookletName
,
bookletLabel
})
.
pipe
(
.
pipe
(
catchError
(
ErrorHandler
.
handle
));
catchError
(
ErrorHandler
.
handle
)
);
}
}
// BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
addBookletLogClose
(
bookletDbId
:
number
):
Observable
<
boolean
|
ServerError
>
{
addBookletLogClose
(
testId
:
number
):
Observable
<
boolean
|
ServerError
>
{
return
this
.
http
return
this
.
http
.
post
<
boolean
>
(
this
.
serverSlimUrl_Close
+
'
log
'
,
{
b
:
bookletDbId
,
t
:
Date
.
now
(),
e
:
'
BOOKLETLOCKEDbyTESTEE
'
})
.
put
<
boolean
>
(
this
.
serverUrl2
+
`test/
${
testId
}
/log`
,
{
timestamp
:
Date
.
now
(),
entry
:
'
BOOKLETLOCKEDbyTESTEE
'
})
.
pipe
(
.
pipe
(
catchError
(
ErrorHandler
.
handle
));
catchError
(
ErrorHandler
.
handle
)
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/app/start/start.component.ts
+
3
−
3
View file @
4381dd5a
...
@@ -3,7 +3,7 @@ import { Subscription, forkJoin } from 'rxjs';
...
@@ -3,7 +3,7 @@ import { Subscription, forkJoin } from 'rxjs';
import
{
CustomtextService
,
MessageDialogComponent
,
MessageDialogData
,
MessageType
,
ServerError
}
from
'
iqb-components
'
;
import
{
CustomtextService
,
MessageDialogComponent
,
MessageDialogData
,
MessageType
,
ServerError
}
from
'
iqb-components
'
;
import
{
MatDialog
}
from
'
@angular/material
'
;
import
{
MatDialog
}
from
'
@angular/material
'
;
import
{
BackendService
}
from
'
../backend.service
'
;
import
{
BackendService
}
from
'
../backend.service
'
;
import
{
PersonTokenAnd
BookletDb
Id
,
LoginData
,
WorkspaceData
}
from
'
../app.interfaces
'
;
import
{
PersonTokenAnd
Test
Id
,
LoginData
,
WorkspaceData
}
from
'
../app.interfaces
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
Component
,
OnInit
,
OnDestroy
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
,
OnDestroy
}
from
'
@angular/core
'
;
import
{
FormGroup
,
FormBuilder
,
Validators
}
from
'
@angular/forms
'
;
import
{
FormGroup
,
FormBuilder
,
Validators
}
from
'
@angular/forms
'
;
...
@@ -265,13 +265,13 @@ export class StartComponent implements OnInit, OnDestroy {
...
@@ -265,13 +265,13 @@ export class StartComponent implements OnInit, OnDestroy {
const
e
=
startReturnUntyped
as
ServerError
;
const
e
=
startReturnUntyped
as
ServerError
;
this
.
mds
.
globalErrorMsg$
.
next
(
e
);
this
.
mds
.
globalErrorMsg$
.
next
(
e
);
}
else
{
}
else
{
const
startReturn
=
startReturnUntyped
as
PersonTokenAnd
BookletDb
Id
;
const
startReturn
=
startReturnUntyped
as
PersonTokenAnd
Test
Id
;
this
.
mds
.
globalErrorMsg$
.
next
(
null
);
this
.
mds
.
globalErrorMsg$
.
next
(
null
);
// ************************************************
// ************************************************
// by setting bookletDbId$ the test-controller will load the booklet
// by setting bookletDbId$ the test-controller will load the booklet
this
.
dataLoading
=
true
;
this
.
dataLoading
=
true
;
this
.
mds
.
setBookletDbId
(
startReturn
.
person
t
oken
,
startReturn
.
bookletDb
Id
,
b
.
label
);
this
.
mds
.
setBookletDbId
(
startReturn
.
person
T
oken
,
startReturn
.
test
Id
,
b
.
label
);
this
.
router
.
navigateByUrl
(
'
/t
'
);
this
.
router
.
navigateByUrl
(
'
/t
'
);
// ************************************************
// ************************************************
...
...
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