Sunday, September 14, 2025¶
User cannot set predicate or smiley directly from the as_paragraph view of ElementResponsesBySection. in the detail of an SectionResponse.
rating_buttons
Both methods call Ratable.get_rating_buttons on an ElementResponse to generate this HTML.
set_score_action_directly is available on 4 models: ChallengeRating FinalRating ElementResponse SectionResponse
The URL in the href of the link (generated by row_action_button) is almost the same in both cases, only difference is the “onMain” keyword, which is false in the first case and true in the other case.
(a) javascript:window.App.runAction({ “action_full_name”: “ratings.ChallengeRatings.set_score_action_directly”, “actorId”: “cert.ElementResponsesBySection”, “onMain”: true, “rp”: “weak-key-0”, “sr”: 1453, “status”: { “fv”: [ null, “2” ] } })
(b) javascript:window.App.runAction({ “action_full_name”: “ratings.ChallengeRatings.set_score_action_directly”, “actorId”: “cert.ElementResponsesBySection”, “onMain”: false, “rp”: “weak-key-0”, “sr”: 1453, “status”: { “fv”: [ null, “2” ] } })
But the Ajax call that gets sent by App.runAction then differs, more precisely the values mk=462 and mt=29 are missing (and that’s probably our problem):
(a) GET /api/cert/ElementResponsesBySection/1453?an=set_score_action_directly &fmt=json&fv&fv=2&sr=1453
(b) GET /api/cert/ElementResponsesBySection/1453?an=set_score_action_directly &dm=detail&fmt=json&fv&fv=2&mk=462&mt=29&sr=1453&wt=d