I am surprised that such questions are given in tests for non-native speakers, because a slight modification of your original phrase can easily change the correct choice between рассы́паться and рассыпа́ться, and I think that only native speakers can confidently handle this. Let me demonstrate that.
Let's first define the context: Person X was helped a bit by Person Y and then excessively expressed his gratitude. The expression of gratitude is over.
Person Y says your original phrase, ''Ни к чему рассыпа́ться из-за таких пустяков в благодарностях.'' Here, рассы́паться would sound very weird, while рассыпа́ться sounds perfect.
Person Y adds, ''K чему ты рассы́пался из-за таких пустяков в благодарностях?'' Here the situation is opposite: рассы́пался sounds perfect, while рассыпа́лся - rather weird, in the circumstances, although not entirely unacceptable.
A day later, Person Y tells Person Z about what happened, and adds, ''Я знал, что он немного странный, но чтоб ни к чему из-за таких пустяков рассы́паться в благодарностях...'' Here both рассы́паться and рассыпа́ться sound perfect.
I guess the above examples are very confusing to non-native speakers, but native speakers easily make the right choices - they just know how to say right.
If you cannot easily make choices in such phrases, considering the exact meanings of the verbs may help make the right choice. Рассы́паться is about a completed action considered as a whole. It is a result-oriented verb. Рассыпа́ться is about a process, a habit, or general concept.
Accordingly, here are the exact meanings of the above phrases (in the context given above):
Ни к чему рассыпа́ться из-за таких пустяков в благодарностях = There is no reason to express your gratitude for such minor things, in general.
K чему ты рассы́пался из-за таких пустяков в благодарностях? = Why did you express your gratitude so strongly for such minor things? The question is about the completed action as a whole.
Я знал, что он немного странный, но чтоб так ни к чему рассыпа́ться/рассы́паться в благодарностях по таким пустякам... = I knew he is somewhat weird, but (I did not expect him) to express gratitude so strongly for such minor things for no real reason... Here, the choice between рассыпа́ться and рассы́паться slightly affects the flavour. With рассы́паться, the focus is rather on the very fact of expressing the gratitude so excessively. With the рассыпа́ться, the focus is rather on the process, e.g., on the exact way how the gratitude was expressed or on what Person X could think during the process.
I think the only really reliable way to get able to make the right choices in such phrases is to simply get a lot of experience with colloquial and idiomatic Russian phrases. Then your subconscious associative thinking will tell you the right choice - just how it works for native speakers.