+
+
+
+
+
+
+ {{ 'addon.mod_survey.surveycompletednograph' | translate }}
+
+
+ {{ 'addon.mod_survey.results' | translate }}
+
+
+
+
+
+
+
+ {{ 'core.hasdatatosync' | translate: {$a: moduleName} }}
+
+
+
+
+
+
+
diff --git a/src/addons/mod/survey/components/index/index.scss b/src/addons/mod/survey/components/index/index.scss
new file mode 100644
index 000000000..261e20841
--- /dev/null
+++ b/src/addons/mod/survey/components/index/index.scss
@@ -0,0 +1,25 @@
+:host {
+ --grid-background: var(--white);
+ --even-background: var(--gray-light);
+
+ .option-name {
+ font-size: 14px;
+ }
+
+ .addon-mod_survey-question {
+ border-top: 1px solid var(--gray);
+ }
+
+ ion-row {
+ background-color: var(--grid-background);
+ }
+
+ .even {
+ background-color: var(--even-background);
+ }
+}
+
+:host-context(body.dark) {
+ --grid-background: var(--black);
+ --even-background: var(--gray-darker);
+}
diff --git a/src/addons/mod/survey/components/index/index.ts b/src/addons/mod/survey/components/index/index.ts
new file mode 100644
index 000000000..38db91dd8
--- /dev/null
+++ b/src/addons/mod/survey/components/index/index.ts
@@ -0,0 +1,250 @@
+// (C) Copyright 2015 Moodle Pty Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import { Component, OnInit, Optional } from '@angular/core';
+import { CoreIonLoadingElement } from '@classes/ion-loading';
+import { CoreCourseModuleMainActivityComponent } from '@features/course/classes/main-activity-component';
+import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
+import { CoreCourse } from '@features/course/services/course';
+import { IonContent } from '@ionic/angular';
+import { CoreSites } from '@services/sites';
+import { CoreDomUtils } from '@services/utils/dom';
+import { CoreTextUtils } from '@services/utils/text';
+import { Translate } from '@singletons';
+import { CoreEvents } from '@singletons/events';
+import { AddonModSurveyPrefetchHandler } from '../../services/handlers/prefetch';
+import {
+ AddonModSurveyProvider,
+ AddonModSurveySurvey,
+ AddonModSurvey,
+ AddonModSurveySubmitAnswerData,
+} from '../../services/survey';
+import { AddonModSurveyHelper, AddonModSurveyQuestionFormatted } from '../../services/survey-helper';
+import { AddonModSurveyOffline } from '../../services/survey-offline';
+import { AddonModSurveyAutoSyncData, AddonModSurveySync, AddonModSurveySyncResult } from '../../services/survey-sync';
+
+/**
+ * Component that displays a survey.
+ */
+@Component({
+ selector: 'addon-mod-survey-index',
+ templateUrl: 'addon-mod-survey-index.html',
+ styleUrls: ['index.scss'],
+})
+export class AddonModSurveyIndexComponent extends CoreCourseModuleMainActivityComponent implements OnInit {
+
+ component = AddonModSurveyProvider.COMPONENT;
+ moduleName = 'survey';
+
+ survey?: AddonModSurveySurvey;
+ questions: AddonModSurveyQuestionFormatted[] = [];
+ answers: Record