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

Commit

Permalink
App & challenge views
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisramey committed Sep 18, 2011
1 parent df23c0e commit c67d900
Show file tree
Hide file tree
Showing 38 changed files with 193 additions and 3,321 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.idea
protected/runtime/application.log
44 changes: 42 additions & 2 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
body
html {height: 100%}
body {height: 100%; margin: 0; text-align: left; color: #000; font-family: calibri, helvetica, trebuchet, trebuchet ms, sans serif; background-color: #FFF}

#all_wrapper {position: relative; min-height: 100%; padding-bottom: 94px}

#header {position: relative; width: 100%; height: 245px; text-align: center; background: #FFF url(../images/header_bg.jpg) repeat-x top left}
#header_left {position: absolute; top: 0px; left: 0px; width: 255px; height: 230px; background: transparent url(../images/header_left.jpg) no-repeat top left}
#header_right {position: absolute; top: 0px; right: 0px; width: 500px; height: 230px; background: transparent url(../images/header_right.jpg) no-repeat top right}
#header_slogan {position: absolute; top: 125px; left: 280px; font-family: Bookman Old Style, Times New Roman, Garamond, serif; color: #FFF; font-style: italic; font-weight: 700; font-size: 20px}

#nav_wrapper {position: relative; top: 200px; margin: 0px auto; width: 960px; height: 45px }
#nav_bar_left {position: absolute; top: 0px; left: 0px; width: 25px; height: 45px; background: transparent url(../images/nav_bar_left.png) no-repeat top left}
#nav_bar_center { margin: 0; padding: 0; position: absolute; top: 0px; left: 25px; width: 910px; height: 45px; background: transparent url(../images/nav_bar_center.png) repeat-x top left}
#nav_bar_right {position: absolute; top: 0px; right: 0px; width: 25px; height: 45px; background: transparent url(../images/nav_bar_right.png) no-repeat top right}
.nav_button, .nav_active, .first_nav_button { display: block; position: relative; height: 35px; padding: 10px 20px 0; margin: 0 2px 0 0; color: #777; font-size: 20px; font-weight: 700; text-align: center; background: transparent url(../images/nav_button_active.png) no-repeat top left; cursor: pointer; float: left; display: block}
.nav_button:hover, .nav_active:hover, .first_nav_button:hover {color: #555; background: transparent url(../images/nav_button_hover.png) no-repeat top left}
.first_nav_button {margin-left: 20px}

#main_container {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}
#login_box {position: absolute; top: 0px; right: 0px; width: 318px; height: 158px; background-color: #FFE4B4; border: solid 1px #FFBF79}
#welcome_helper {position: absolute; top: 100px; left: 575px; width: 120px; height: 110px; background: transparent url(../images/friendly_helper.png)}

.featured_item {position: relative; margin-bottom: 12px; width: 100%; height: 200px}
.featured_image {position: absolute; top: 0px; left: 0px; width: 300px; height: 100%; background-color: #EEE; border: solid 1px #CCC}
.featured_copy {position: absolute; top: 0px; right: 0px; width: 620px; height: 130px; padding: 35px 20px; text-align: left; font-weight: 700; font-size: 16pt; color: #333; border: solid 1px #CCC; overflow: auto}

#footer {position: absolute; bottom: 0px; left: 0px; width: 100%; height: 47px; padding-top: 23px; color: #FFF; font-weight: 700; font-size: 18px; text-align: center; background-color: #F47504}

.nav_button a:link {text-decoration: none; color: #777; font-weight: 700}
.nav_button a:visited {text-decoration: none; color: #777; font-weight: 700}
.nav_button a:hover {text-decoration: none; color: #555; font-weight: 700}
.nav_button a:active {text-decoration: none; color: #777; font-weight: 700}

a:link {text-decoration: none; color: #FE8600; font-weight: 700}
a:visited {text-decoration: none; color: #FE8600; font-weight: 700}
a:hover {text-decoration: none; color: #F03900; font-weight: 700}
a:active {text-decoration: none; color: #FE8600; font-weight: 700}

/*body
{
margin: 0;
padding: 0;
Expand Down Expand Up @@ -226,4 +266,4 @@ div.search-form
.operations li a:hover
{
background: #80CFFF;
}
}*/
Binary file added images/challenge_flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/checkmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/coins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/friendly_helper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/header_bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/header_left.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/header_right.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nav_bar_center.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nav_bar_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nav_bar_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nav_button_active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/nav_button_hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/progress_bar_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/progress_bar_filler_center.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/progress_bar_filler_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/progress_bar_filler_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/welcome_msg.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions protected/DEV/swomaha.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 18, 2011 at 01:36 AM
-- Generation Time: Sep 18, 2011 at 03:02 AM
-- Server version: 5.1.53
-- PHP Version: 5.3.4

Expand Down Expand Up @@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS `app` (
--

INSERT INTO `app` (`id`, `name`, `image`) VALUES
(1, 'Solar System', NULL);
(1, 'Solar System', '/images/challenges/solarsystem.jpg');

-- --------------------------------------------------------

Expand Down Expand Up @@ -295,7 +295,7 @@ CREATE TABLE IF NOT EXISTS `student_answer` (
KEY `fk_student_answer_student1` (`student_id`),
KEY `fk_student_answer_assessment1` (`assessment_id`),
KEY `fk_student_answer_assessment_question1` (`assessment_question_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `student_answer`
Expand Down
2 changes: 1 addition & 1 deletion protected/controllers/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class AppController extends Controller
{
public $layout='teacher';
public $layout='main';
private $_model;

public function filters()
Expand Down
26 changes: 13 additions & 13 deletions protected/controllers/AssessmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class AssessmentController extends Controller
{
public $layout='teacher';
public $layout='main';
private $_model;

public function filters()
Expand Down Expand Up @@ -38,27 +38,27 @@ public function actionView() {
$models['Assessment'] = $this->loadModel();
$models['AssessmentQuestion'] = AssessmentQuestion::model()->findAllByAttributes(array('assessment_id'=>$_GET['id']));
$models['AssessmentFreeform'] = AssessmentFreeform::model()->findAllByAttributes(array('assessment_id'=>$_GET['id']));

$this->render('view',array(
'model'=>$models
));
}

public function actionFreeFormView() {
$this->render('freeFormView',array(
'model'=>$this->loadModel()
));
}

public function actionAddFreeform() {
$assessment = Assessment::model()->findbyPk($_GET['id']);
$freeform=new AssessmentFreeform;
$freeform->attributes = $_POST['AssessmentFreeform'];

if(isset($_POST['AssessmentFreeform']) && isset($_SESSION['assessment_id'])) {

$criteria = $_POST['Criteria'];

$freeform->assessment_id = $_SESSION['assessment_id'];

// Save questions
Expand All @@ -79,23 +79,23 @@ public function actionAddFreeform() {
}
}
}

$_SESSION['assessment_id'] = $assessment->id;

$this->render('addFreeForm',array(
'model'=>$freeform
));
}

public function actionAddMultipleChoice() {
$assessment = Assessment::model()->findbyPk($_GET['id']);
$question=new AssessmentQuestion;
$question->attributes = $_POST['AssessmentQuestion'];

if(isset($_POST['AssessmentQuestion']) && isset($_SESSION['assessment_id'])) {

$answers = $_POST['Answer'];

$question->assessment_id = $_SESSION['assessment_id'];

// Save questions
Expand All @@ -116,7 +116,7 @@ public function actionAddMultipleChoice() {
}
}
}

$_SESSION['assessment_id'] = $assessment->id;

$this->render('addMultipleChoice',array(
Expand Down
2 changes: 1 addition & 1 deletion protected/controllers/ChallengeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ChallengeController extends Controller
{
public $layout='teacher';
public $layout='main';
private $_model;

public function filters()
Expand Down
4 changes: 2 additions & 2 deletions protected/controllers/StudentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class StudentController extends Controller
{
public $layout='student';
public $layout='main';
private $_model;

public function filters()
Expand Down Expand Up @@ -39,7 +39,7 @@ public function accessRules()

public function init()
{
$this->layout = 'student';
//$this->layout = 'student';
}

public function actionView()
Expand Down
20 changes: 10 additions & 10 deletions protected/controllers/TeacherController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class TeacherController extends Controller
{
public $layout='teacher';
public $layout='main';
private $_model;

public function filters()
Expand Down Expand Up @@ -49,14 +49,6 @@ public function actionCreate()
$model=new Teacher;
$user=new User;

foreach($_POST as $key => $value) {
if(is_array($value))
$_SESSION[$key] = $value;
}

if(isset($_SESSION['Teacher']))
$model->attributes = $_SESSION['Teacher'];

$this->performAjaxValidation($model);

if(isset($_POST['Teacher']))
Expand All @@ -69,7 +61,6 @@ public function actionCreate()
$model->groups = $_POST['Teacher']['Group'];

if($model->save()) {
unset($_SESSION['Teacher']);

$this->redirect(array('view','id'=>$model->id));
}
Expand Down Expand Up @@ -190,4 +181,13 @@ public function actionLogin()
// display the login form
$this->render('login',array('model'=>$model));
}

public function actionGames()
{
$this->menu = array();
$dataProvider=new CActiveDataProvider('App');
$this->render('games',array(
'dataProvider'=>$dataProvider,
));
}
}
2 changes: 1 addition & 1 deletion protected/controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class UserController extends Controller
{
public $layout='teacher';
public $layout='main';
private $_model;

public function filters()
Expand Down
1 change: 1 addition & 0 deletions protected/runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[^.]*
Loading

0 comments on commit c67d900

Please sign in to comment.