I think this is asking too much of the people on this forum -- you'll
have to debug things yourself first.
But a good starting point would be to take your element, a mesh with one
or perhaps four cells, create a DoFHandler with it, create a solution
vector that corresponds to a function you know, and then output the
solution with DataOut::build_patches() using a high value for the
subdivisions. This way you get to see the solution on a subdivided mesh.
Compare that to what you expect and make sure the shape functions are
correct. Then repeat this by using a DataPostprocessor object that
outputs the gradient of your shape functions. Chances are that the
mistake is in one of these two steps.
Best
W.