Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisramey committed Sep 18, 2011
1 parent 8d9ea83 commit 7e8eb16
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions protected/controllers/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function actionCreate()
if(isset($_POST['App']))
{
$model->attributes = $_POST['App'];



if($model->save()) {
Expand Down
1 change: 1 addition & 0 deletions protected/controllers/ChallengeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public function actionCreate()
if(isset($_POST['Challenge']))
{
$model->attributes = $_POST['Challenge'];
$model->app_id = $_GET['id'];

if($model->save()) {

Expand Down
22 changes: 20 additions & 2 deletions protected/views/assessment/_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
?>
<div class="question" style="<?php echo $style;?>">
<?php echo $actions;?>
<h2 style="margin:0px;<?php echo $h2Style;?>"><?php echo $title;?></h2>
<h2 style="margin:0px;<?php echo $h2Style;?>"><?php echo "$title ($total)";?></h2>
</div>
7 changes: 5 additions & 2 deletions protected/views/challenge/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@

if($model['Assessment'] != null) {?>
<h2>Assessment</h2>
<?php echo $this->renderPartial('/assessment/_view', array(
<?php echo $this->renderPartial('/assessment/_view', array(
'data'=>$model['Assessment'],
'form' =>$form,
'link' => true
));
} else {
echo '<p style="margin:14px;">No assessment was found for this challenge.</p>';
}
?>
</div>
</div>
<div class="actions" style="margin-bottom:20px;float:right;clear:right;"><a href="/assessment/create/id/<?php echo $model['Challenge']->id; ?>" style="-moz-border-radius:8px;border-radius:8px;border:1px solid #888;display:inline-block;padding:6px 6px 6px 34px;background:#eee url(/images/add.png) no-repeat 4px 50%;">Add Assessment</a></div>

0 comments on commit 7e8eb16

Please sign in to comment.