Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fit4ilr #62

Merged
merged 86 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
4860fd0
chg: [report] Added flags and custom texts in config file, customizin…
jfrocha Dec 1, 2021
b81d687
chg: [report] use strreplace filter (wip)
cedricbonhomme Dec 1, 2021
fbffe83
chg [report] improved strreplace filter
jfrocha Dec 1, 2021
b5a0037
chg: [report] ensure the variable of replacement will be a instance o…
cedricbonhomme Dec 1, 2021
7f1ad5b
chg: [report] now manages list of values to replace
cedricbonhomme Dec 1, 2021
7204907
chf: !minor removed unused import
cedricbonhomme Dec 1, 2021
d952da7
chg: [templates] provide an example for appatags str_replace
cedricbonhomme Dec 1, 2021
3cdf332
chg: updated gitchangelog configuration. !minor
cedricbonhomme Dec 2, 2021
e485c18
chg: [security] URL redirection based on unvalidated user input
cedricbonhomme Dec 2, 2021
65c7258
chg: [security] interpret target as a CSS selector not as HTML.
cedricbonhomme Dec 2, 2021
e6cf172
fix: [report] Fixed cast of SCORE and minimal_acceptable_score intege…
jfrocha Dec 2, 2021
7df38d5
fix: [commands] added missing maxPoints of the question
cedricbonhomme Dec 2, 2021
01b7159
Merge branch 'fit4ilr' of github.com:CASES-LU/Fit4Cybersecurity into …
cedricbonhomme Dec 2, 2021
cc0c93b
chg: [dependencies] prevent the installation of 3.0.6 yanked
cedricbonhomme Dec 2, 2021
4971bdd
chg: [questions] Fixed css for free text questions
jfrocha Dec 2, 2021
4583c45
Merge branch 'fit4ilr' of https://github.com/CASES-LU/Fit4Cybersecuri…
jfrocha Dec 2, 2021
6d73024
chg: [data] Fixed 25th fit4ilr question
jfrocha Dec 2, 2021
ce98a15
fix: [chart] Avoid division by zero
jfrocha Dec 2, 2021
6433118
chg: [data] Updated survey4operators data
jfrocha Dec 2, 2021
f1b406c
added initial file
cedricbonhomme Dec 7, 2021
28d3f2d
chg: skip the context questions
cedricbonhomme Dec 7, 2021
41b5856
chg: exclude context questions from the calculation
cedricbonhomme Dec 7, 2021
76b4740
chg: [style] reformat with black. !minor
cedricbonhomme Dec 7, 2021
62407b2
Merge master branch
jfrocha Dec 8, 2021
b0df0e5
chg: [core] context questions from the first question page are now st…
cedricbonhomme Dec 8, 2021
0295416
chg: [style] reformat with black. !minor
cedricbonhomme Dec 8, 2021
07e23f8
chg: [translations] Change DB translations to po files
jfrocha Dec 9, 2021
fefb4b0
new: [core] added get_context method on SurveyUser objects.
cedricbonhomme Dec 9, 2021
40c84ba
chg: [user context] test appending user question at the end of the js…
cedricbonhomme Dec 9, 2021
36b241a
Translated using Weblate (French)
Dec 9, 2021
5981af0
chg: [context questions] fixed an issue in the current question index
cedricbonhomme Dec 9, 2021
ba3d19f
Fixed question answer translation rendering
jfrocha Dec 9, 2021
a75c5b1
Translated using Weblate (French)
Dec 9, 2021
89bfb3c
Translated using Weblate (German)
Dec 9, 2021
c34b5ba
chg: [context questions] removed useless form
cedricbonhomme Dec 9, 2021
129285f
merge fit4ilr into feature/context-questions
cedricbonhomme Dec 9, 2021
5890db0
chg: [context questions] sepecify a service_category
cedricbonhomme Dec 9, 2021
e238ed2
removed unused import. !minor
cedricbonhomme Dec 9, 2021
34a29d2
chg: [context questions] separate context questions from normal ones
cedricbonhomme Dec 9, 2021
b2c9217
Updated source translations
jfrocha Dec 9, 2021
db078a0
Merge branch 'fit4ilr' of https://github.com/CASES-LU/Fit4Cybersecuri…
jfrocha Dec 9, 2021
1bc655a
Updated pot file
jfrocha Dec 9, 2021
5174fdb
chg: [core] removed useless code related to the Translation manageent…
cedricbonhomme Dec 9, 2021
fa36bf2
Merge branch 'feature/context-questions' into fit4ilr
cedricbonhomme Dec 9, 2021
e9283d6
new: [context questions] Handles the case when no context questions a…
cedricbonhomme Dec 9, 2021
45eeb6b
Merge branch 'feature/context-questions' into fit4ilr
cedricbonhomme Dec 9, 2021
1cbd33e
chg: [style] reformat with black. !minor
cedricbonhomme Dec 9, 2021
4f00a87
chg: [flake] added more complexity to make flake happy about the
cedricbonhomme Dec 9, 2021
ce77f48
chg: deleted questions file. !minor
cedricbonhomme Dec 9, 2021
33dfe66
chg: [translations] removed now useless TranslationSerializer
cedricbonhomme Dec 9, 2021
f379834
chg: [context questions] the question is now accessed with get_item f…
cedricbonhomme Dec 9, 2021
9ea5e9c
Translated using Weblate (German)
Dec 9, 2021
ae472da
Translated using Weblate (French)
Dec 9, 2021
2a9fb8c
Removed the current_question_index calculation as the context questio…
Dec 9, 2021
61a4602
Updated pot file
jfrocha Dec 9, 2021
e036a6d
Moved from variable as it may be not needed if a user object is retur…
Dec 9, 2021
a425990
Update translations
jfrocha Dec 9, 2021
db718dd
Translated using Weblate (German)
Dec 9, 2021
a105615
Translated using Weblate (French)
Dec 9, 2021
165942c
Translated using Weblate (French)
Dec 9, 2021
3ac6364
Added safe tag in question form
jfrocha Dec 9, 2021
24f478d
Translated using Weblate (German)
Dec 9, 2021
ac3aa86
chg: [contest questions] use a negative qindex for context questions.
cedricbonhomme Dec 9, 2021
3b3be9c
Merge branch 'feature/context-questions' into fit4ilr
cedricbonhomme Dec 9, 2021
d2c96da
chg: updated packer configuration file
cedricbonhomme Dec 9, 2021
f810b5c
chg: [packer] added new LOG_DIRECTORY configuration variable.
cedricbonhomme Dec 9, 2021
25ddcb2
fix: [context questions] fixed SuerveyUser.get_context() method.
cedricbonhomme Dec 10, 2021
4d6476f
fix conflicts in shasums after merge
cedricbonhomme Dec 10, 2021
f61b2bc
Removed useless data, duplicated with survey4operators data
jfrocha Dec 10, 2021
2649c1a
Added default context questions
jfrocha Dec 10, 2021
5c8ceb8
Removed extra double quote
jfrocha Dec 10, 2021
79bbabc
chg: [conetxt questions] Add new question type (Single Select Choice)
jfrocha Dec 10, 2021
c1280a0
Removed CSS of is-valid class
jfrocha Dec 10, 2021
65058da
Added [survey4operators] context questions
jfrocha Dec 10, 2021
c900c89
Merge branch 'master' into fit4ilr
jfrocha Dec 10, 2021
07f4dc1
Changed question type in context file
jfrocha Dec 10, 2021
5cb704e
Reformated with black
jfrocha Dec 10, 2021
575bc68
Merge branch 'master' into fit4ilr
jfrocha Dec 13, 2021
b5b5778
Updated strings
jfrocha Dec 13, 2021
d9c24e5
Updated translations
jfrocha Dec 13, 2021
d6cba70
Added check when Chart data is not defined
jfrocha Dec 14, 2021
dd19216
Improved check of chart data
jfrocha Dec 14, 2021
a1d14e1
Merge branch 'master' into fit4ilr
jfrocha Dec 14, 2021
e53f4b4
Fixed context question label translate
jfrocha Dec 14, 2021
b9f2550
Added new question type, Single Select Ordered Choice (SO)
jfrocha Dec 14, 2021
5d856a7
Fixed lint error
jfrocha Dec 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/fit4cybersecurity/context-questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"label": "What is your sector?",
"service_category": "Context",
"section": "__context",
"qtype": "SS",
"qtype": "SO",
"maxPoints": 0,
"answers": [
{
Expand Down
2 changes: 1 addition & 1 deletion data/survey4operators/context-questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"label": "What is your sector?",
"service_category": "Context",
"section": "__context",
"qtype": "SS",
"qtype": "SO",
"maxPoints": 0,
"answers": [
{
Expand Down
2 changes: 1 addition & 1 deletion static/survey/js/chart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(document).ready(function () {
if (chartData && chartLabels) {
if (typeof chartData !== 'undefined' && typeof chartLabels !== 'undefined') {
let ctx = document.getElementById('result-chart');
let resultChart = new Chart(ctx, {
type: 'radar',
Expand Down
10 changes: 9 additions & 1 deletion survey/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ def __init__(self, tanswers=None, *args, **kwargs):
elif answers_field_type == "SS":
self.fields["answers"] = forms.ChoiceField(
required=False,
choices=question_answers,
choices=[],
widget=forms.Select(),
label="",
)
elif answers_field_type == "SO":
self.fields["answers"] = forms.ChoiceField(
required=False,
choices=[],
widget=forms.Select(),
label="",
)
tanswers = sort_tuple_alphabetically(tanswers, 1)
elif answers_field_type[0] == "S":
self.fields["answers"] = forms.ChoiceField(
required=True,
Expand Down
1 change: 1 addition & 0 deletions survey/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
("M", "Multiple Choice"),
("S", "Single Choice"),
("SS", "Single Select Choice"),
("SO", "Single Select Ordered Choice "),
("T", "Free text"),
("MT", "Multiple Choice + Free Text"),
("ST", "Single Choice + Free Text"),
Expand Down
7 changes: 3 additions & 4 deletions survey/viewLogic.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def handle_start_survey(request: HttpRequest, lang: str) -> Union[Dict, SurveyUs
question_answers = SurveyQuestionAnswer.objects.order_by("aindex").filter(
question=question
)
tuple_answers = get_answer_choices(question_answers, lang)
tuple_answers = [(qa["id"], _(qa["label"])) for qa in question_answers.values()]
except Exception as e:
raise e
forms[question.id] = AnswerMChoice(
Expand All @@ -95,7 +95,7 @@ def handle_start_survey(request: HttpRequest, lang: str) -> Union[Dict, SurveyUs
question_answers = SurveyQuestionAnswer.objects.order_by(
"aindex"
).filter(question=question)
tuple_answers = get_answer_choices(question_answers, lang)
tuple_answers = [(qa["id"], _(qa["label"])) for qa in question_answers.values()]
except Exception as e:
raise e

Expand Down Expand Up @@ -124,7 +124,6 @@ def handle_start_survey(request: HttpRequest, lang: str) -> Union[Dict, SurveyUs
question_answers = SurveyQuestionAnswer.objects.order_by(
"aindex"
).filter(question=question)
tuple_answers = get_answer_choices(question_answers, lang)
except Exception as e:
raise e

Expand All @@ -136,7 +135,7 @@ def handle_start_survey(request: HttpRequest, lang: str) -> Union[Dict, SurveyUs
return {
"title": title,
"forms": forms,
"questions_per_id": {question.id: question for question in questions},
"questions_per_id": {question.id: _(question.label) for question in questions},
"action": action,
"choosen_lang": lang,
}
Expand Down