/** * MOVE the specified resource up or down in the list of items related to a plan. * * @param int $id * @param string $direction * @return \Illuminate\Http\Response */ public function move($id, $direction) { // call helper function to do the actual 'move' $item = moveItem($id, $direction); if ($item) { // notify event listener that an item was updated event(new CspotItemUpdated($item)); // back to full plan view return \Redirect::back(); } flashError('Error! Item with ID "' . $id . '" not found'); return \Redirect::back(); }
function moveQuestion($quizId, $sectionId, $questionId, $direction) { $questionRow = getQuestionRow($quizId, $sectionId, $questionId); if (!$questionRow) { displayerror('Could not find the specified question.'); return false; } return moveItem($questionId, $questionRow['quiz_questionrank'], 'quiz_questions', 'quiz_questionid', 'quiz_questionrank', "`page_modulecomponentid` = {$quizId} AND `quiz_sectionid` = {$sectionId}", $direction); }