<commit_before>/** PrettyView for an assignment. */
Ext.define('devilry.administrator.assignment.PrettyView', {
    extend: 'devilry.administrator.PrettyView',
    alias: 'widget.administrator_assignmentprettyview',
    requires: [
        'devilry.administrator.studentsmanager.StudentsManager',
        'devilry.extjshelpers.RestfulSimplifiedEditPanel',
        'devilry.extjshelpers.SingleRecordContainer',
        'devilry.extjshelpers.MaximizableWindow',
        'devilry.gradeeditors.GradeEditorModel',
        'devilry.gradeeditors.RestfulRegistryItem',
        'devilry.gradeeditors.ConfigEditorWindow',
        'devilry.gradeeditors.GradeEditorSelectForm',
        'devilry.extjshelpers.NotificationManager'
    ],

    config: {
        assignmentgroupstore: undefined,
        assignmentgroupPrevApprovedStore: undefined
    },

    bodyTpl: Ext.create('Ext.XTemplate',
        '<div class="section">',
        '    <tpl if="totalAssignmentGroups == 0">',
        '        <div class="section error">',
        '            <h1>No assignment groups</h1>',
        '            <p>',
        '               Students have to be organized in <em>assignment groups</em> before they can add any deliveries. A students belongs to a group even when they deliver individual deliveries. Students that is not in any assignment group do not even see the assignment. Please choose <span class="menuref">Manage assignment groups</span> to bring up the assignment group manager, and select <span class="menuref">Create groups</span>.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="missingGradeEditorConfig">',
        '        <div class="section error">',
        '            <h1>Missing grade editor config</h1>',
        '            <p>',
        '                The selected grade editor, <em>{graderegistryitem.data.title}</em>, requires',
        '                configuration. Examiners will not be able to give feedback ',
        '                without a configuration, however students will be able to add deliveries.',
        '                Choose <span class="menuref">Grade editor &rarr; Configure current grade editor</span> in the toolbar to create a configuration.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="graderegistryitem">',
        '        <div class="section info">',
        '            <h1>Grade editor: {graderegistryitem.data.title}</h1>',
        '            <strong>About the grade editor:</strong>',
        '            <p>',
        '                {graderegistryitem.data.description}',
        '            </p>',
        '            <strong>Why grade editors?</strong>',
        '            <p>',
        '                To make it easy for examiners to create all the information related ',
        '                to a grade, Devilry use <em>grade editors</em>. Grade editors give examiners ',
        '                a unified user-interface tailored for different kinds of grading systems.',
        '                Select <span class="menuref">Grade editor</span> in the toolbar to ',
        '                change or configure the grade editor.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="published">',
        '        <div class="section info">',
        '            <h1>Published</h1>',
        '            <p>',
        '               The assignment is currently visible to students and examiners. ',
        '               Its publishing time was <strong>{publishing_time:date}</strong>.',
        '               You may change the publishing time by selecting the <span class="menuref">Edit</span> button ',
        '               in the toolbar, however since it is already published, this may lead ',
        '               to confusion among students and examiners.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="!published">',
        '        <div class="section warning">',
        '             <h1>Not published</h1>',
        '             <p>',
        '                This assignment is currently <em>not visible</em> to students or examiners. ',
        '                The assignment will become visible to students and examiners ',
        '                <strong>{publishing_time:date}</strong>.',
        '                You may change the publishing time by selecting the <span class="menuref">Edit</span> button in the toolbar.',
        '             </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="anonymous">',
        '        <div class="section info">',
        '            <h1>Anonymous</h1>',
        '            <p>',
        '                The assignment <em>is anonymous</em>. This means that examiners ',
        '                see the <em>candidate ID</em> instead of user name and ',
        '                email. Furthermore, students do not see who their examiner(s)',
        '                are. ',
        '                Select <span class="menuref">Advanced options</span> ',
        '                in the toolbar to change this setting.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="!anonymous">',
        '        <div class="section info">',
        '            <h1>Not anonymous</h1>',
        '            <p>',
        '                The assignment is <em>not</em> anonymous. This means that examiners ',
        '                can see information about who their students are. ',
        '                Furthermore, students can see who their examiner(s)',
        '                are. This is usually OK, however on exams this is usually ',
        '                not the recommended setting. ',
        '                Select <span class="menuref">Advanced options</span> ',
        '                in the toolbar to change this setting.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="delivery_types == 1">',
        '        <div class="section info">',
        '            <h1>Non-electronic deliveries</h1>',
        '            <p>',
        '               This assignment does not use Devilry for deliveries, only for feedback.',
        '               You may choose to use Devilry for electronic deliveries on this assignment using the <span class="menuref">Edit</span> button in the toolbar.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '</div>'
    ),

    constructor: function(config) {
        this.callParent([config]);
        this.initConfig(config);
    },

    getExtraBodyData: function(record) {
        return {
            published: record.data.publishing_time < Ext.Date.now(),
            missingGradeEditorConfig: this.missingGradeEditorConfig,
            graderegistryitem: this.gradeeditor_registryitem_recordcontainer.record,
            totalAssignmentGroups: this.assignmentgroupstore.totalCount
        };
    },

    initComponent: function() {<commit_msg>apps.administrator...assignment.PrettyView: Changed advanced options references to "edit".<commit_after>/** PrettyView for an assignment. */
Ext.define('devilry.administrator.assignment.PrettyView', {
    extend: 'devilry.administrator.PrettyView',
    alias: 'widget.administrator_assignmentprettyview',
    requires: [
        'devilry.administrator.studentsmanager.StudentsManager',
        'devilry.extjshelpers.RestfulSimplifiedEditPanel',
        'devilry.extjshelpers.SingleRecordContainer',
        'devilry.extjshelpers.MaximizableWindow',
        'devilry.gradeeditors.GradeEditorModel',
        'devilry.gradeeditors.RestfulRegistryItem',
        'devilry.gradeeditors.ConfigEditorWindow',
        'devilry.gradeeditors.GradeEditorSelectForm',
        'devilry.extjshelpers.NotificationManager'
    ],

    config: {
        assignmentgroupstore: undefined,
        assignmentgroupPrevApprovedStore: undefined
    },

    bodyTpl: Ext.create('Ext.XTemplate',
        '<div class="section">',
        '    <tpl if="totalAssignmentGroups == 0">',
        '        <div class="section error">',
        '            <h1>No assignment groups</h1>',
        '            <p>',
        '               Students have to be organized in <em>assignment groups</em> before they can add any deliveries. A students belongs to a group even when they deliver individual deliveries. Students that is not in any assignment group do not even see the assignment. Please choose <span class="menuref">Manage assignment groups</span> to bring up the assignment group manager, and select <span class="menuref">Create groups</span>.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="missingGradeEditorConfig">',
        '        <div class="section error">',
        '            <h1>Missing grade editor config</h1>',
        '            <p>',
        '                The selected grade editor, <em>{graderegistryitem.data.title}</em>, requires',
        '                configuration. Examiners will not be able to give feedback ',
        '                without a configuration, however students will be able to add deliveries.',
        '                Choose <span class="menuref">Grade editor &rarr; Configure current grade editor</span> in the toolbar to create a configuration.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="graderegistryitem">',
        '        <div class="section info">',
        '            <h1>Grade editor: {graderegistryitem.data.title}</h1>',
        '            <strong>About the grade editor:</strong>',
        '            <p>',
        '                {graderegistryitem.data.description}',
        '            </p>',
        '            <strong>Why grade editors?</strong>',
        '            <p>',
        '                To make it easy for examiners to create all the information related ',
        '                to a grade, Devilry use <em>grade editors</em>. Grade editors give examiners ',
        '                a unified user-interface tailored for different kinds of grading systems.',
        '                Select <span class="menuref">Grade editor</span> in the toolbar to ',
        '                change or configure the grade editor.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="published">',
        '        <div class="section info">',
        '            <h1>Published</h1>',
        '            <p>',
        '               The assignment is currently visible to students and examiners. ',
        '               Its publishing time was <strong>{publishing_time:date}</strong>.',
        '               You may change the publishing time by selecting the <span class="menuref">Edit</span> button ',
        '               in the toolbar, however since it is already published, this may lead ',
        '               to confusion among students and examiners.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="!published">',
        '        <div class="section warning">',
        '             <h1>Not published</h1>',
        '             <p>',
        '                This assignment is currently <em>not visible</em> to students or examiners. ',
        '                The assignment will become visible to students and examiners ',
        '                <strong>{publishing_time:date}</strong>.',
        '                You may change the publishing time by selecting the <span class="menuref">Edit</span> button in the toolbar.',
        '             </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="anonymous">',
        '        <div class="section info">',
        '            <h1>Anonymous</h1>',
        '            <p>',
        '                The assignment <em>is anonymous</em>. This means that examiners ',
        '                see the <em>candidate ID</em> instead of user name and ',
        '                email. Furthermore, students do not see who their examiner(s)',
        '                are. ',
        '                Select <span class="menuref">Edit</span> ',
        '                in the toolbar to change this setting.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="!anonymous">',
        '        <div class="section info">',
        '            <h1>Not anonymous</h1>',
        '            <p>',
        '                The assignment is <em>not</em> anonymous. This means that examiners ',
        '                can see information about who their students are. ',
        '                Furthermore, students can see who their examiner(s)',
        '                are. This is usually OK, however on exams this is usually ',
        '                not the recommended setting. ',
        '                Select <span class="menuref">Edit</span> ',
        '                in the toolbar to change this setting.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '    <tpl if="delivery_types == 1">',
        '        <div class="section info">',
        '            <h1>Non-electronic deliveries</h1>',
        '            <p>',
        '               This assignment does not use Devilry for deliveries, only for feedback.',
        '               You may choose to use Devilry for electronic deliveries on this assignment using the <span class="menuref">Edit</span> button in the toolbar.',
        '            </p>',
        '        </div>',
        '    </tpl>',
        '</div>'
    ),

    constructor: function(config) {
        this.callParent([config]);
        this.initConfig(config);
    },

    getExtraBodyData: function(record) {
        return {
            published: record.data.publishing_time < Ext.Date.now(),
            missingGradeEditorConfig: this.missingGradeEditorConfig,
            graderegistryitem: this.gradeeditor_registryitem_recordcontainer.record,
            totalAssignmentGroups: this.assignmentgroupstore.totalCount
        };
    },

    initComponent: function() {
{'fraction_non_alphanumeric': 0.11968734733756717, 'fraction_numerical': 0.0025123874659780865, 'mean_word_length': 1.6059283506092017, 'pattern_counts': {'":': 0, '<': 221, '<?xml version=': 0, '>': 219, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7395817', 'n_tokens_mistral': 3653, 'n_tokens_neox': 3597, 'n_words': 994}