protected function map_user_data_with_value($mappingidentifier, $value, $header, $map, $key, $courseid, $feedbackgradeid,
            $verbosescales) {

        // Fields that the user can be mapped from.
        $userfields = array(
            'userid' => array(
                'field' => 'id',
                'label' => 'id',
            ),
            'useridnumber' => array(
                'field' => 'idnumber',
                'label' => 'idnumber',
            ),
            'useremail' => array(
                'field' => 'email',
                'label' => 'email address',
            ),
            'username' => array(
                'field' => 'username',
                'label' => 'username',
            ),
        );

        switch ($mappingidentifier) {
            case 'userid':
            case 'useridnumber':
            case 'useremail':
            case 'username':
                // Skip invalid row with blank user field.
                if (!empty($value)) {
                    $this->studentid = $this->check_user_exists($value, $userfields[$mappingidentifier]);
                }
            break;
            case 'new':
                $this->import_new_grade_item($header, $key, $value);
            break;
            case 'feedback':
                if ($feedbackgradeid) {
                    $feedback = $this->create_feedback($courseid, $feedbackgradeid, $value);
                    if (isset($feedback)) {
                        $this->newfeedbacks[] = $feedback;
                    }
                }
            break;
            default:
                // Existing grade items.
                if (!empty($map[$key])) {
                    $this->newgrades = $this->update_grade_item($courseid, $map, $key, $verbosescales, $value,
                            $mappingidentifier);
                }
                // Otherwise, we ignore this column altogether because user has chosen
                // to ignore them (e.g. institution, address etc).
            break;
        }
    }