For the sake of completeness, though, if you absolutely *must* go down the other route, something along the lines of
<values>
/ rankstring = ""
/ validranking = false
</values>
<block myblock>
/ trials = [1=mypage]
</block>
<text debug>
/ items = ("<%values.rankstring%>")
/ position = (50%, 5%)
</text>
<surveypage mypage>
/ stimulusframes = [1=debug]
/ questions = [1=r01; 2=r02]
/ ontrialbegin = [values.rankstring=""]
/ ontrialend = [values.rankstring=concat(concat(values.rankstring,dropdown.r01.response),dropdown.r02.response)]
/ ontrialend = [if (
length(values.rankstring) == 2 &&
length(replaceall(values.rankstring, dropdown.r01.response, "")) == 1 &&
length(replaceall(values.rankstring, dropdown.r02.response, "")) == 1
) values.validranking = true else values.validranking = false]
/ branch = [if ( values.validranking == false) surveypage.mypage]
</surveypage>
<dropdown r01>
/ caption = "Rank 1"
/ options = ("Object A", "Object B", "Object C", "Object D")
/ optionvalues = ("A", "B", "C", "D")
/ required = true
</dropdown>
<dropdown r02>
/ caption = "Rank 2"
/ options = ("Object A", "Object B", "Object C", "Object D")
/ optionvalues = ("A", "B", "C", "D")
/ required = true
</dropdown>
should be workable.