How to access block fields programmatically? I display a block of type Assignment on the top of a page when I'm creating a node of type Submission.  I need to access the fields of the Assignment block programmatically with my custom module.

Are there any built in Drupal functions that will allow me to do so?

I'm currently using hook_form_alter() but that does not give me access to the block elements.
I found the value by first grabbing the assignment value from the URL, then looking up the path to find the node id, then loading that node and using a wrapper to find the value of that specific field.


        $url = $_SERVER['REQUEST_URI'];
        $pos = strpos($url, '?') + 1;
        $assignment = substr($url, $pos, strlen($url)); //get the assignment from the URL

        $nodeID = drupal_lookup_path('source', "student-assignments-new/" . $assignment);//get the path from the assignment - e.g. node/145
        $pos = strpos($nodeID, '/') + 1;
        $nid = substr($nodeID, $pos, strlen($nodeID));//get the node id

        $node = node_load($nid);

        $wrapper = entity_metadata_wrapper('node', $node); 
        $fieldValue = $wrapper->field_file_type_text->value();

        $output = $node->field_file_type_text[LANGUAGE_NONE][0]['value']; //field_file_type_text is my own field name
        return $output;