diff --git a/css/main.css b/css/main.css index a2a3c51..ea2a758 100644 --- a/css/main.css +++ b/css/main.css @@ -17,7 +17,7 @@ body {height: 100%; margin: 0; text-align: left; color: #000; font-family: calib .nav_button a { display:block; overflow: hidden; padding: 0 20px ; line-height: 45px; background: transparent url(../images/nav_button_active.png) no-repeat top left; } .nav_button a:hover {background: transparent url(../images/nav_button_hover.png) no-repeat top left} -#main_container {position: relative; top: 20px; width: 974px; margin: 0px auto} +#main_container {overflow:auto;position: relative; top: 20px; width: 974px; margin: 0px auto} #welcome_wrapper {position: relative; width: 100%; height: 220px} #welcome_message {position: absolute; top: 0px; left: 0px; width: 645px; height: 210px; background: transparent url(../images/welcome_msg.gif) no-repeat top left} #badge_box {position: absolute; top: 0px; right: 0px; width: 318px; height: 158px; background: #FFF url(../images/badge_box.jpg) no-repeat top left; border: solid 1px #4AC50F} diff --git a/protected/controllers/AppController.php b/protected/controllers/AppController.php index 9f9d558..440f334 100644 --- a/protected/controllers/AppController.php +++ b/protected/controllers/AppController.php @@ -60,6 +60,7 @@ public function actionCreate() if(isset($_POST['App'])) { $model->attributes = $_POST['App']; + if($model->save()) { diff --git a/protected/controllers/ChallengeController.php b/protected/controllers/ChallengeController.php index 0bd0a11..97e1426 100644 --- a/protected/controllers/ChallengeController.php +++ b/protected/controllers/ChallengeController.php @@ -64,6 +64,7 @@ public function actionCreate() if(isset($_POST['Challenge'])) { $model->attributes = $_POST['Challenge']; + $model->app_id = $_GET['id']; if($model->save()) { diff --git a/protected/views/assessment/_view.php b/protected/views/assessment/_view.php index 59d7878..560c7a7 100644 --- a/protected/views/assessment/_view.php +++ b/protected/views/assessment/_view.php @@ -15,8 +15,26 @@ $actions = ''; $style = 'margin:20px 0px;padding:10px;border:1px solid #555;-moz-border-radius:4px;border-radius:4px;background:#efefef url(/images/brain-icon.png) 98% 6px no-repeat;'; $h2Style = ''; -}?> +} +// Get total points for assessment +$total = 0; + +// Get all MC questions +$mcQuestions = AssessmentQuestion::model()->findAllByAttributes(array('assessment_id'=>$data->id)); +foreach($mcQuestions as $q) { + $total = $total + $q->points; +} + +// Get all free form questions +$ffQuestions = AssessmentFreeform::model()->findAllByAttributes(array('assessment_id'=>$_GET['id'])); +foreach($ffQuestions as $q) { + $criteria = Criteria::model()->findAllByAttributes(array('assessment_freeform_id'=>$q->id)); + foreach($criteria as $c) { + $total = $total + $c->points; + } +} +?>
-

+

diff --git a/protected/views/challenge/view.php b/protected/views/challenge/view.php index 042becb..ea0908a 100644 --- a/protected/views/challenge/view.php +++ b/protected/views/challenge/view.php @@ -22,11 +22,14 @@ if($model['Assessment'] != null) {?>

Assessment

- renderPartial('/assessment/_view', array( + renderPartial('/assessment/_view', array( 'data'=>$model['Assessment'], 'form' =>$form, 'link' => true )); + } else { + echo '

No assessment was found for this challenge.

'; } ?> - \ No newline at end of file + +
Add Assessment
\ No newline at end of file