Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apps.acj
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Franklin
apps.acj
Commits
d919f886
Commit
d919f886
authored
Mar 16, 2024
by
Hussain Mohamed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
38e9d7d1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
125 additions
and
51 deletions
+125
-51
ApplicationController.php
admin/application/controllers/ApplicationController.php
+13
-0
ExamController.php
admin/application/controllers/ExamController.php
+2
-2
Common_model.php
admin/application/models/Common_model.php
+24
-0
alert.php
admin/application/views/base/alert.php
+27
-0
menu.php
admin/application/views/base/menu.php
+6
-0
exam.php
admin/application/views/exam/exam.php
+23
-26
view_exam.php
admin/application/views/exam/view_exam.php
+2
-2
view.php
admin/application/views/questions/view.php
+28
-21
No files found.
admin/application/controllers/ApplicationController.php
View file @
d919f886
...
...
@@ -2363,6 +2363,19 @@ class ApplicationController extends CI_Controller
$option_d
=
$this
->
input
->
post
(
'option_d'
);
$answer
=
$this
->
input
->
post
(
'answer'
);
$record
=
$this
->
mcommon
->
specific_row
(
'exam_type'
,
array
(
'id'
=>
$exam_type
));
$totalQuestions
=
isset
(
$record
[
'total_questions'
])
?
$record
[
'total_questions'
]
:
0
;
$count
=
$this
->
mcommon
->
getQuestionCount
(
$exam_type
,
$category
);
if
(
$totalQuestions
==
$count
)
{
$this
->
session
->
set_flashdata
(
'alert_danger'
,
'Question Limit Exceeded !'
);
redirect
(
'ApplicationController/viewQuestion'
);
//return exit();
}
$insert_array
=
array
(
'academic'
=>
$academic
,
'exam_type'
=>
$exam_type
,
...
...
admin/application/controllers/ExamController.php
View file @
d919f886
...
...
@@ -28,7 +28,7 @@ class ExamController extends CI_Controller
public
function
getExamQuestions
()
{
$this
->
db
->
select
(
'y.year, es.academic, es.exam_schedule, es.
date, es.
time, es.id,et.exam_type_name as name'
);
$this
->
db
->
select
(
'y.year, es.academic, es.exam_schedule, es.
objective_date, es.objective_
time, es.id,et.exam_type_name as name'
);
$this
->
db
->
from
(
'question as q'
);
$this
->
db
->
join
(
'exam_schedule as es'
,
'es.id = q.schedule_id'
,
'left'
);
$this
->
db
->
join
(
'accadamic_year as y'
,
'y.id = q.academic'
,
'left'
);
...
...
@@ -41,7 +41,7 @@ class ExamController extends CI_Controller
public
function
takeExam
(
$id
)
{
$view_data
[
'questions'
]
=
$this
->
mcommon
->
records_all
(
'question'
,
array
(
'schedule_id'
=>
$id
));
$view_data
[
'questions'
]
=
$this
->
mcommon
->
getExamQuestions
();
$authId
=
1
;
date_default_timezone_set
(
'Asia/Calcutta'
);
$date
=
date
(
'Y-m-d h:i:s'
,
strtotime
(
"+40 minutes"
));
...
...
admin/application/models/Common_model.php
View file @
d919f886
...
...
@@ -424,6 +424,30 @@ class Common_model extends CI_Model
return
$result
;
}
public
function
getExamQuestions
()
{
$this
->
db
->
select
(
'c.category, c.id as categoryId, q.id, q.question, q.option_a, q.option_b, q.option_c, q.option_d, q.answer'
);
$this
->
db
->
from
(
'question as q'
);
$this
->
db
->
join
(
'section_category as c'
,
'c.id = q.category'
,
'left'
);
$query
=
$this
->
db
->
get
()
->
result
();
$groupByArr
=
[];
foreach
(
$query
as
$key
=>
$val
)
{
$groupByArr
[
$val
->
category
][]
=
$val
;
}
return
$groupByArr
;
}
public
function
getQuestionCount
(
$type
,
$category
)
{
$this
->
db
->
select
(
'COUNT(question) as cont'
);
$this
->
db
->
from
(
'question'
);
$this
->
db
->
where
(
'exam_type'
,
$type
);
$this
->
db
->
where
(
'category'
,
$category
);
$result
=
$this
->
db
->
get
()
->
row_array
();
return
(
isset
(
$result
[
'cont'
])
&&
$result
[
'cont'
]
>
0
)
?
$result
[
'cont'
]
:
0
;
}
...
...
admin/application/views/base/alert.php
0 → 100644
View file @
d919f886
4545454545454
<?php
if
(
$this
->
session
->
flashdata
(
'alert_success'
))
{
?>
<div
class=
"alert alert-success alert-dismissible fade show"
role=
"alert"
>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"alert"
aria-label=
"Close"
></button>
<strong>
Success!
</strong>
<?php
echo
$this
->
session
->
flashdata
(
'alert_success'
);
?>
</div>
<?php
}
if
(
$this
->
session
->
flashdata
(
'alert_danger'
))
{
?>
<div
class=
"alert alert-danger alert-dismissible fade show"
role=
"alert"
>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"alert"
aria-label=
"Close"
></button>
<strong>
Success!
</strong>
<?php
echo
$this
->
session
->
flashdata
(
'alert_danger'
);
?>
</div>
<?php
}
if
(
$this
->
session
->
flashdata
(
'alert_warning'
))
{
?>
<div
class=
"alert alert-warning alert-dismissible fade show"
role=
"alert"
>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"alert"
aria-label=
"Close"
></button>
<strong>
Success!
</strong>
<?php
echo
$this
->
session
->
flashdata
(
'alert_warning'
);
?>
</div>
<?php
}
?>
\ No newline at end of file
admin/application/views/base/menu.php
View file @
d919f886
...
...
@@ -84,6 +84,12 @@
</a>
</li>
<li><a
href=
"
<?php
echo
base_url
();
?>
ExamController/viewExam/"
aria-expanded=
"false"
>
<i
class=
"material-symbols-outlined"
>
filter
</i>
<span
class=
"nav-text"
>
Exam
</span>
</a>
</li>
<!-- <li><a href="
<?php
echo
base_url
();
?>
ApplicationController/scoreList/" aria-expanded="false">
<i class="material-symbols-outlined"></i>
<span class="nav-text">Score</span>
...
...
admin/application/views/exam/exam.php
View file @
d919f886
...
...
@@ -42,49 +42,45 @@
<p class="mt-2 mb-0">Step 4</p>
</a></li>
</ul> -->
<?php
if
(
isset
(
$questions
)){
$tot
=
0
;
?>
<div
class=
"tab-content"
>
<?php
foreach
(
$questions
as
$key
=>
$val
){
?>
<div
id=
"wizard_Service"
class=
"tab-pane"
role=
"tabpanel"
>
<h5
class=
"text-center"
>
<?=
$key
?>
</h5>
<?php
foreach
(
$val
as
$row
){
$tot
++
;
?>
<div
class=
"row"
>
<div
class=
"col-lg-6 mb-2"
>
<div
class=
"mb-3"
>
<label
class=
"text-label form-label"
>
First Name
<span
class=
"required"
>
*
</span></label>
<input
type=
"text"
name=
"firstName"
class=
"form-control"
placeholder=
"Parsley"
required
>
</div>
<div
class=
"col-lg-12 mb-2"
>
<h5>
<?=
$row
->
question
?>
</h5>
</div>
<div
class=
"col-lg-6 mb-2"
>
<div
class=
"
mb-3
"
>
<
label
class=
"text-label form-label"
>
Last Name
<span
class=
"required"
>
*
</span></label
>
<
input
type=
"text"
name=
"lastName"
class=
"form-control"
placeholder=
"Montana"
required
>
<div
class=
"
form-check custom-checkbox mb-3 checkbox-success
"
>
<
input
type=
"radio"
class=
"form-check-input"
id=
"customRadioBox4"
name=
"questions[
<?=
$row
->
id
?>
]"
>
<
label
class=
"form-check-label"
for=
"customRadioBox4"
>
<?=
$row
->
option_a
?>
</label
>
</div>
</div>
<div
class=
"col-lg-6 mb-2"
>
<div
class=
"
mb-3
"
>
<
label
class=
"text-label form-label"
>
Email Address
<span
class=
"required"
>
*
</span></label
>
<
input
type=
"email"
class=
"form-control"
id=
"inputGroupPrepend2"
aria-describedby=
"inputGroupPrepend2"
placeholder=
"example@example.com.com"
required
>
<div
class=
"
form-check custom-checkbox mb-3 checkbox-success
"
>
<
input
type=
"radio"
class=
"form-check-input"
id=
"customRadioBox4"
name=
"questions[
<?=
$row
->
id
?>
]"
>
<
label
class=
"form-check-label"
for=
"customRadioBox4"
>
<?=
$row
->
option_b
?>
</label
>
</div>
</div>
<div
class=
"col-lg-6 mb-2"
>
<div
class=
"
mb-3
"
>
<
label
class=
"text-label form-label"
>
Phone Number
<span
class=
"required"
>
*
</span></label
>
<
input
type=
"number"
name=
"phoneNumber"
class=
"form-control"
placeholder=
"(+1)408-657-9007"
required
>
<div
class=
"
form-check custom-checkbox mb-3 checkbox-success
"
>
<
input
type=
"radio"
class=
"form-check-input"
id=
"customRadioBox4"
name=
"questions[
<?=
$row
->
id
?>
]"
>
<
label
class=
"form-check-label"
for=
"customRadioBox4"
>
<?=
$row
->
option_c
?>
</label
>
</div>
</div>
<div
class=
"col-lg-6 mb-2"
>
<div
class=
"mb-3"
>
<label
class=
"text-label form-label"
>
Passward
<span
class=
"required"
>
*
</span></label>
<input
type=
"passward"
class=
"form-control"
id=
"inputGroupPrepend45"
aria-describedby=
"inputGroupPrepend45"
placeholder=
"Enter your Passward"
required
>
<div
class=
"form-check custom-checkbox mb-3 checkbox-success"
>
<input
type=
"radio"
class=
"form-check-input"
id=
"customRadioBox4"
name=
"questions[
<?=
$row
->
id
?>
]"
>
<label
class=
"form-check-label"
for=
"customRadioBox4"
>
<?=
$row
->
option_d
?>
</label>
</div>
</div>
<div
class=
"col-lg-6 mb-2"
>
<label
class=
"text-label form-label"
>
Select Options
<span
class=
"required"
>
*
</span></label>
<select
class=
" default-select form-control wide"
aria-label=
"Default select example"
>
<option
selected
>
Company Name
</option>
<option
value=
"1"
>
Account Number
</option>
<option
value=
"2"
>
State
</option>
<option
value=
"3"
>
City
</option>
</select>
</div>
</div>
</div>
<div
class=
"row"
>
...
...
@@ -93,9 +89,10 @@
<a
href=
"javascript:void()"
class=
"btn btn-primary pull-right"
>
Previous
</a>
<a
href=
"javascript:void()"
class=
"btn btn-primary pull-right"
>
Next
</a>
</div>
</div>
<?php
}
}
?>
</div>
<?php
}
?>
</div>
</div>
</div>
...
...
admin/application/views/exam/view_exam.php
View file @
d919f886
...
...
@@ -78,7 +78,7 @@
<div
class=
"modal-dialog modal-lg"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
>
Take
Exam
</h5>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
>
Start
Exam
</h5>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"modal"
aria-label=
"Close"
></button>
</div>
<div
class=
"modal-body"
>
...
...
@@ -123,7 +123,7 @@ original sentence. (5 marks)</h5>
</div>
<div
class=
"modal-footer"
>
<a
href=
"javascript:startExam('
<?=
$row
->
id
?>
')"
class=
"btn btn-primary"
>
Take
Exam
</a>
<a
href=
"javascript:startExam('
<?=
$row
->
id
?>
')"
class=
"btn btn-primary"
>
Start
Exam
</a>
</div>
</div>
</div>
...
...
admin/application/views/questions/view.php
View file @
d919f886
<!DOCTYPE html>
<html
lang=
"en"
>
<!-- Mirrored from akademi.dexignlab.com/codeigniter/demo/student by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Mar 2024 10:51:33 GMT -->
<!-- Added by HTTrack -->
<meta
http-equiv=
"content-type"
content=
"text/html;charset=UTF-8"
/>
<!-- /Added by HTTrack -->
<head>
<!-- Title -->
<title>
List
</title>
<!-- Meta -->
</head>
<body>
<?php
$segment
=
$this
->
uri
->
segment
(
2
)
?>
<div
class=
"content-body"
>
<!-- row -->
<div
class=
"container-fluid"
>
<?php
if
(
$this
->
session
->
flashdata
(
'alert_success'
))
{
?>
<div
class=
"alert alert-success alert-dismissible fade show"
role=
"alert"
>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"alert"
aria-label=
"Close"
></button>
<strong>
Success!
</strong>
<?php
echo
$this
->
session
->
flashdata
(
'alert_success'
);
?>
</div>
<?php
}
if
(
$this
->
session
->
flashdata
(
'alert_danger'
))
{
?>
<div
class=
"alert alert-danger alert-dismissible fade show"
role=
"alert"
>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"alert"
aria-label=
"Close"
></button>
<strong>
Error!
</strong>
<?php
echo
$this
->
session
->
flashdata
(
'alert_danger'
);
?>
</div>
<?php
}
if
(
$this
->
session
->
flashdata
(
'alert_warning'
))
{
?>
<div
class=
"alert alert-warning alert-dismissible fade show"
role=
"alert"
>
<button
type=
"button"
class=
"btn-close"
data-bs-dismiss=
"alert"
aria-label=
"Close"
></button>
<strong>
Warning!
</strong>
<?php
echo
$this
->
session
->
flashdata
(
'alert_warning'
);
?>
</div>
<?php
}
?>
<!-- Row -->
<div
class=
"row"
>
<div
class=
"col-xl-12"
>
<div
class=
"row"
>
<div
class=
"col-xl-12"
>
<div
class=
"page-title flex-wrap"
>
<div
class=
"input-group search-area mb-md-0 mb-3"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"Search here..."
>
...
...
@@ -101,9 +111,6 @@
</div>
</body>
</html>
<script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment