Skip to content
Snippets Groups Projects
Select Git revision
  • 5ebdfdc4bb3e8c02c9ba98e2d30367a0c48dbac7
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

StandardFile.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>