djaodjin / djaopsp

Practices Survey Platform - Assess against best practices assessment and improvement planning
BSD 2-Clause "Simplified" License
3 stars 6 forks source link

Add model, API and views to attach surveys to sequences #423

Closed smirolo closed 5 months ago

smirolo commented 7 months ago

Add a model that looks and behave like pages.LiveEvent to add survey.Campaign to a pages.Sequence. For example:

class SurveyEvent(models.Model):
    element = models.ForeignKey(PageElement, on_delete=models.CASCADE,
        related_name='surveys')
    campaign = models.ForeignKey(Campaign, on_delete=models.CASCADE)

Then override pages.views.SequenceProgressView following the same pattern as done in djaopsp.api.content.PageElementAPIView to be able to add a survey in a sequence.

Add the fixtures required to test a sequence: text-to-read, live-event, survey, certificate.

smirolo commented 5 months ago

Merged PR #430