Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
arsnova-click-v2-frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
ARSnova
arsnova-click-v2-frontend
Commits
58a60148
Commit
58a60148
authored
Jul 19, 2018
by
Christopher Mark Fullarton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes bugs which prevented the start of quizzes if no server password is set
parent
8deb77cd
Pipeline
#17955
passed with stages
in 9 minutes and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
18 deletions
+14
-18
home.component.html
src/app/root/home/home.component.html
+6
-6
home.component.ts
src/app/root/home/home.component.ts
+6
-1
settings.service.ts
src/app/service/settings/settings.service.ts
+2
-11
No files found.
src/app/root/home/home.component.html
View file @
58a60148
...
...
@@ -84,9 +84,9 @@
<button
*ngIf=
"!canEditQuiz && !isAddingDemoQuiz && !isAddingABCDQuiz"
id=
"addSession"
class=
"btn btn-success btn-block pointer"
[class.disabled]=
"!serverPassword.length"
[class.disabled]=
"
passwordRequired &&
!serverPassword.length"
(click)=
"handleClick('addSession') && setAsCurrentQuiz(['/quiz', 'manager', 'overview'])"
[disabled]=
"!serverPassword.length"
>
[disabled]=
"
passwordRequired &&
!serverPassword.length"
>
<span
class=
"mr-1"
>
{{'component.hashtag_management.create_session' | translate}}
</span>
<i
class=
"fas fa-edit"
></i>
</button>
...
...
@@ -100,18 +100,18 @@
<button
*ngIf=
"isAddingDemoQuiz"
id=
"runDemoQuizSession"
class=
"btn btn-success btn-block pointer"
[class.disabled]=
"!serverPassword.length"
[class.disabled]=
"
passwordRequired &&
!serverPassword.length"
(click)=
"handleClick('add-demo-quiz') && setActiveQuestionGroup() && setAsCurrentQuiz(['/quiz', 'flow'])"
[disabled]=
"!serverPassword.length"
>
[disabled]=
"
passwordRequired &&
!serverPassword.length"
>
<span
class=
"mr-1"
>
{{'component.hashtag_management.create_demo_session' | translate}}
</span>
<i
class=
"fas fa-paper-plane"
></i>
</button>
<button
*ngIf=
"isAddingABCDQuiz"
id=
"runABCDQuizSession"
class=
"btn btn-success btn-block pointer"
[class.disabled]=
"!serverPassword.length"
[class.disabled]=
"
passwordRequired &&
!serverPassword.length"
(click)=
"handleClick('add-abcd-quiz') && setActiveQuestionGroup() && setAsCurrentQuiz(['/quiz', 'flow'])"
[disabled]=
"!serverPassword.length"
>
[disabled]=
"
passwordRequired &&
!serverPassword.length"
>
<span
class=
"mr-1"
>
{{'component.hashtag_management.create_abcd_session' | translate}}
</span>
<i
class=
"fas fa-paper-plane"
></i>
</button>
...
...
src/app/root/home/home.component.ts
View file @
58a60148
...
...
@@ -374,7 +374,7 @@ export class HomeComponent implements OnInit, OnDestroy {
const
questionGroupInstance
=
questionGroupReflection
[
currentQuiz
.
TYPE
](
currentQuiz
);
this
.
canAddQuiz
=
false
;
this
.
canEditQuiz
=
true
;
this
.
canStartQuiz
=
questionGroupInstance
.
isValid
();
this
.
canStartQuiz
=
!
this
.
settingsService
.
serverSettings
.
createQuizPasswordRequired
&&
questionGroupInstance
.
isValid
();
this
.
passwordRequired
=
this
.
canStartQuiz
&&
this
.
settingsService
.
serverSettings
.
createQuizPasswordRequired
;
}
...
...
@@ -382,6 +382,7 @@ export class HomeComponent implements OnInit, OnDestroy {
this
.
isAddingDemoQuiz
=
true
;
this
.
canAddQuiz
=
false
;
this
.
canEditQuiz
=
false
;
this
.
canStartQuiz
=
!
this
.
settingsService
.
serverSettings
.
createQuizPasswordRequired
;
this
.
passwordRequired
=
this
.
settingsService
.
serverSettings
.
createQuizPasswordRequired
;
}
...
...
@@ -389,6 +390,7 @@ export class HomeComponent implements OnInit, OnDestroy {
this
.
isAddingABCDQuiz
=
true
;
this
.
canAddQuiz
=
false
;
this
.
canEditQuiz
=
false
;
this
.
canStartQuiz
=
!
this
.
settingsService
.
serverSettings
.
createQuizPasswordRequired
;
this
.
passwordRequired
=
this
.
settingsService
.
serverSettings
.
createQuizPasswordRequired
;
}
...
...
@@ -400,11 +402,13 @@ export class HomeComponent implements OnInit, OnDestroy {
this
.
canAddQuiz
=
false
;
this
.
canJoinQuiz
=
false
;
this
.
passwordRequired
=
false
;
this
.
canStartQuiz
=
false
;
break
;
case
'
QUIZ:AVAILABLE
'
:
this
.
canAddQuiz
=
false
;
this
.
canJoinQuiz
=
true
;
this
.
passwordRequired
=
false
;
this
.
canStartQuiz
=
false
;
this
.
_provideNickSelection
=
value
.
payload
.
provideNickSelection
;
this
.
casService
.
casLoginRequired
=
value
.
payload
.
authorizeViaCas
;
if
(
this
.
casService
.
casLoginRequired
)
{
...
...
@@ -415,6 +419,7 @@ export class HomeComponent implements OnInit, OnDestroy {
this
.
canAddQuiz
=
true
;
this
.
canJoinQuiz
=
false
;
this
.
passwordRequired
=
this
.
settingsService
.
serverSettings
.
createQuizPasswordRequired
;
this
.
canStartQuiz
=
!
this
.
settingsService
.
serverSettings
.
createQuizPasswordRequired
;
break
;
default
:
console
.
log
(
value
);
...
...
src/app/service/settings/settings.service.ts
View file @
58a60148
...
...
@@ -13,18 +13,9 @@ export class SettingsService {
return
this
.
_serverSettings
;
}
constructor
(@
Inject
(
PLATFORM_ID
)
private
platformId
:
Object
,
private
connectionService
:
ConnectionService
,
private
storageService
:
StorageService
,
)
{
constructor
(@
Inject
(
PLATFORM_ID
)
private
platformId
:
Object
,
private
connectionService
:
ConnectionService
,
private
storageService
:
StorageService
)
{
if
(
isPlatformBrowser
(
this
.
platformId
))
{
this
.
storageService
.
read
(
DB_TABLE
.
CONFIG
,
STORAGE_KEY
.
SERVER_SETTINGS
).
subscribe
(
val
=>
{
if
(
val
)
{
this
.
_serverSettings
=
val
;
}
else
{
this
.
initServerSettings
();
}
});
this
.
initServerSettings
();
}
}
...
...
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