Changeset fb4a524 in iPeer


Ignore:
Timestamp:
2012-12-20T17:53:57-08:00 (5 years ago)
Author:
John Hsu <john.hsu@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
9525bb6
Parents:
f76260c
git-author:
John Hsu <john.hsu@…> (12/20/2012 04:46:28 PM)
git-committer:
John Hsu <john.hsu@…> (12/20/2012 05:53:57 PM)
Message:

Survey submission now work SurveyInput? change.

Another issue resulting from renaming survey_id to event_id in
SurveyInput?. The student survey submission page was still expecting
survey_id. Just needed to figure out which ones to rename and it's
working now.

Location:
app
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • app/controllers/components/evaluation.php

    rf76260c rfb4a524  
    16771677        $userId = $params['data']['Evaluation']['surveyee_id'];
    16781678        $eventId = $params['form']['event_id'];
    1679         $surveyId = $params['form']['survey_id'];
    16801679
    16811680        //get existing record if there is one
     
    16841683            //if there is no existing record, fill in all fields
    16851684            $evaluationSubmission['EvaluationSubmission']['submitter_id'] = $userId;
    1686             $evaluationSubmission['EvaluationSubmission']['survey_id'] = $surveyId;
    16871685            $evaluationSubmission['EvaluationSubmission']['submitted'] = 1;
    16881686            $evaluationSubmission['EvaluationSubmission']['date_submitted'] = date('Y-m-d H:i:s');
     
    16941692        $surveyInput=array();
    16951693        $surveyInput['SurveyInput']['user_id'] = $userId;
    1696         $surveyInput['SurveyInput']['survey_id'] = $surveyId;
     1694        $surveyInput['SurveyInput']['event_id'] = $eventId;
    16971695        $successfullySaved = true;
    16981696        $j = 0;
     
    17011699            //Set survey and user id
    17021700            $surveyInput[$i+$j]['SurveyInput']['user_id'] = $userId;
    1703             $surveyInput[$i+$j]['SurveyInput']['survey_id'] = $surveyId;
     1701            $surveyInput[$i+$j]['SurveyInput']['event_id'] = $eventId;
    17041702            //Set question Id
    17051703            $questionId = $params['form']['question_id'.$i];
     
    17171715                    $this->SurveyInput->recursive = 0;
    17181716                    $surveyInputId = $this->SurveyInput->find('first', array(
    1719                         'conditions' => array('SurveyInput.survey_id' => $surveyId,
     1717                        'conditions' => array('SurveyInput.event_id' => $eventId,
    17201718                            'SurveyInput.user_id' => $userId,
    17211719                            'SurveyInput.question_id' => $questionId,
     
    17371735                    //Set survey and user id
    17381736                    $surveyInput[$i+$j]['SurveyInput']['user_id'] = $userId;
    1739                     $surveyInput[$i+$j]['SurveyInput']['survey_id'] = $surveyId;
     1737                    $surveyInput[$i+$j]['SurveyInput']['event_id'] = $eventId;
    17401738                    //Set question Id
    17411739                    $questionId = $params['form']['question_id'.$i];
     
    17581756            $this->SurveyInput->recursive = 0;
    17591757            $surveyInputId = $this->SurveyInput->find('first', array(
    1760                     'conditions' => array('SurveyInput.survey_id' => $surveyId,
     1758                    'conditions' => array('SurveyInput.event_id' => $eventId,
    17611759                    'SurveyInput.user_id' => $userId,
    17621760                    'SurveyInput.question_id' => $questionId),
  • app/controllers/evaluations_controller.php

    rf76260c rfb4a524  
    16911691        }
    16921692
    1693         // TODO check that survey submissions are still going through
    1694         // TODO check that all SurveyInput calls don't have survey_id hardcoded
    1695         // somewhere
    16961693        $this->set('students', $course['Enrol']);
    16971694        $this->set('eventId', $eventId);
  • app/views/evaluations/survey_eval_form.ctp

    rf76260c rfb4a524  
    11<form name="frm" id="frm" method="POST" action="<?php echo $html->url('makeEvaluation/'.$eventId) ?>">
    22<input type="hidden" name="event_id" value="<?php echo $eventId?>"/>
    3 <input type="hidden" name="survey_id" id="survey_id" value="<?php if (!empty($survey_id)) echo $survey_id; ?>" />
     3<input type="hidden" name="event_id" id="event_id" value="<?php if (!empty($eventId)) echo $eventId; ?>" />
    44<input type="hidden" name="course_id" value="<?php echo $courseId ?>"/>
    55<input type="hidden" name="data[Evaluation][surveyee_id]" value="<?php echo User::get('id')?>"/>
Note: See TracChangeset for help on using the changeset viewer.