Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 70... Línea 70...
70
     * @param NodeElement $fieldnode
70
     * @param NodeElement $fieldnode
71
     * @param Session $session The behat browser session
71
     * @param Session $session The behat browser session
72
     * @return behat_form_field
72
     * @return behat_form_field
73
     */
73
     */
74
    public static function get_form_field(NodeElement $fieldnode, Session $session) {
74
    public static function get_form_field(NodeElement $fieldnode, Session $session) {
75
 
-
 
76
        // Get the field type if is part of a moodleform.
75
        // Get the field type if is part of a moodleform.
77
        if (self::is_moodleform_field($fieldnode)) {
76
        if (self::is_moodleform_field($fieldnode)) {
78
            $type = self::get_field_node_type($fieldnode, $session);
77
            $type = self::get_field_node_type($fieldnode, $session);
79
        }
78
        }
Línea 164... Línea 163...
164
                    return 'checkbox';
163
                    return 'checkbox';
165
                    break;
164
                    break;
166
                case 'radio':
165
                case 'radio':
167
                    return 'radio';
166
                    return 'radio';
168
                    break;
167
                    break;
-
 
168
                case 'datetime-local':
-
 
169
                    return 'datetime_local';
169
                default:
170
                default:
170
                    // Here we return false because all text-based
171
                    // Here we return false because all text-based
171
                    // fields should be included in the first switch case.
172
                    // fields should be included in the first switch case.
172
                    return false;
173
                    return false;
173
            }
174
            }
Línea 335... Línea 336...
335
     */
336
     */
336
    protected static function normalise_fieldtype(string $fieldtype): string {
337
    protected static function normalise_fieldtype(string $fieldtype): string {
337
        if ($fieldtype === 'tags') {
338
        if ($fieldtype === 'tags') {
338
            return 'autocomplete';
339
            return 'autocomplete';
339
        }
340
        }
-
 
341
        if ($fieldtype === 'date_time_selector') {
-
 
342
            return 'date_time';
-
 
343
        }
-
 
344
        if ($fieldtype === 'date_selector') {
-
 
345
            return 'date';
-
 
346
        }
Línea 340... Línea 347...
340
 
347
 
341
        return $fieldtype;
348
        return $fieldtype;
342
    }
349
    }