How long_ had tom learned/learnt (learn)chinese befor he came to china?
因为后面用的是一般过去时,而且连接词是before,表示之前
所以前面的是过去的过去,所以用过去完成时