Skip to content
Snippets Groups Projects
Select Git revision
  • 8fabce22b6342cd77cd0437761883c520a8f85b3
  • main default protected
  • studip-rector
  • ci-opt
  • course-members-export-as-word
  • data-vue-app
  • pipeline-improvements
  • webpack-optimizations
  • rector
  • icon-renewal
  • http-client-and-factories
  • jsonapi-atomic-operations
  • vueify-messages
  • tic-2341
  • 135-translatable-study-areas
  • extensible-sorm-action-parameters
  • sorm-configuration-trait
  • jsonapi-mvv-routes
  • docblocks-for-magic-methods
19 results

StructuralElementsDelete.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    LikertEdit.vue 2.34 KiB
    <template>
        <div class="likert_edit">
            <div class="formpart" tabindex="0" ref="autofocus">
                {{ $gettext('Einleitungstext' )}}
                <StudipWysiwyg v-model="val_clone.description" />
            </div>
    
            <InputArray v-model="val_clone.statements"
                         :label="$gettext('Aussage')"
                         :label-plural="$gettext('Aussagen')"
                         :additional-colspan="val_clone.options.length"
            >
                <template #header-cells>
                    <th v-for="(option, index) in val_clone.options" class="option-cell" :key="index">
                        {{ option }}
                    </th>
                </template>
    
                <template #body-cells>
                    <td v-for="(option, index) in val_clone.options" class="option-cell" :key="index">
                        <input type="radio" disabled :title="option">
                    </td>
                </template>
            </InputArray>
    
            <label>
                <input type="checkbox" v-model.number="val_clone.mandatory" true-value="1" false-value="0">
                {{ $gettext('Pflichtfrage') }}
            </label>
            <label>
                <input type="checkbox" v-model.number="val_clone.randomize" true-value="1" false-value="0">
                {{ $gettext('Antworten den Teilnehmenden zufällig präsentieren') }}
            </label>
    
            <div>
                <div>{{ $gettext('Antwortmöglichkeiten konfigurieren') }}</div>
                <InputArray v-model="val_clone.options" />
            </div>
        </div>
    </template>
    
    <script>
    import { $gettext } from '../../../assets/javascripts/lib/gettext';
    import InputArray from "./InputArray.vue";
    import { QuestionnaireComponent } from '../../mixins/QuestionnaireComponent';
    
    // This is necesssar since $gettext does not seem to work in data() or created()
    const default_values = () => ({
        description: '',
        statements: ['', '', '', ''],
        mandatory: 0,
        randomize: 0,
        options: [
            $gettext('trifft zu'),
            $gettext('trifft eher zu'),
            $gettext('teils-teils'),
            $gettext('trifft eher nicht zu'),
            $gettext('trifft nicht zu'),
        ],
    });
    
    export default {
        name: 'likert-edit',
        components: { InputArray },
        mixins: [ QuestionnaireComponent ],
        created() {
            this.setDefaultValues(default_values());
        },
        mounted() {
            this.$refs.autofocus.focus();
        }
    }
    </script>