Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses-legacy
Commits
3c6a29b8
Commit
3c6a29b8
authored
4 years ago
by
Fernando Ribeiro
Browse files
Options
Download
Plain Diff
Merge branch 'develop' into 'master'
develop into master See merge request
!26
parents
ecf72321
43b939fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
courses_legacy/activities/views.py
courses_legacy/activities/views.py
+1
-1
courses_legacy/core/views.py
courses_legacy/core/views.py
+2
-2
No files found.
courses_legacy/activities/views.py
View file @
3c6a29b8
...
...
@@ -40,7 +40,7 @@ class AnswerViewSet(viewsets.ModelViewSet):
def
perform_create
(
self
,
serializer
):
activity
=
Activity
.
objects
.
get
(
id
=
self
.
request
.
data
[
'activity'
])
if
activity
.
type
==
'slidesreveal'
and
len
(
activity
.
answers
.
all
(
))
>
0
:
if
activity
.
type
==
'slidesreveal'
and
len
(
activity
.
answers
.
filter
(
user
=
self
.
request
.
user
))
>
0
:
return
Response
(
status
=
200
)
serializer
.
save
(
user
=
self
.
request
.
user
)
...
...
This diff is collapsed.
Click to expand it.
courses_legacy/core/views.py
View file @
3c6a29b8
...
...
@@ -662,10 +662,10 @@ class StudentProgressViewSet(viewsets.ModelViewSet):
# field must be updated, unless it was updated before
if
(
'is_complete'
in
self
.
request
.
data
.
keys
()
and
not
student_progress
.
complete
):
has_answer
=
True
for
act
in
unit
.
activities
.
all
():
answer_act
=
act
.
answers
.
all
(
)
answer_act
=
act
.
answers
.
filter
(
user
=
student_progress
.
user
)
if
len
(
answer_act
)
==
0
:
has_answer
=
False
...
...
This diff is collapsed.
Click to expand it.
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