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
14bd4c6b
Commit
14bd4c6b
authored
Mar 16, 2024
by
Hussain Mohamed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed
parent
1296d54b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
31 deletions
+90
-31
ExamController.php
admin/application/controllers/ExamController.php
+6
-0
exam.php
admin/application/views/exam/exam.php
+82
-29
view_exam.php
admin/application/views/exam/view_exam.php
+2
-2
No files found.
admin/application/controllers/ExamController.php
View file @
14bd4c6b
...
...
@@ -58,6 +58,11 @@ class ExamController extends CI_Controller
$this
->
load
->
view
(
'base/base_template'
,
$data
);
}
public
function
storeExam
()
{
echo
"<pre>"
;
print_r
(
$_POST
);
}
}
?>
\ No newline at end of file
admin/application/views/exam/exam.php
View file @
14bd4c6b
...
...
@@ -17,6 +17,9 @@
</div>
<div
class=
"col-xl-12"
>
<div
class=
"card"
>
<div
class=
"card-header"
>
...
...
@@ -43,55 +46,78 @@
</a></li>
</ul> -->
<?php
if
(
isset
(
$questions
)){
$tot
=
0
;
?>
if
(
isset
(
$questions
))
{
$cont
=
0
;
foreach
(
$questions
as
$key
=>
$val
)
{
foreach
(
$val
as
$ky
=>
$row
)
{
$cont
+=
1
;
}
}
$tot
=
0
;
$j
=
1
;
?>
<form
method=
"POST"
action=
"
<?=
base_url
(
'ExamController/storeExam'
)
?>
"
>
<div
class=
"tab-content"
>
<?php
foreach
(
$questions
as
$key
=>
$val
){
?>
<div
id=
"wizard_Service"
class=
"tab-pane"
role=
"tabpanel"
>
<?php
foreach
(
$questions
as
$key
=>
$val
)
{
?>
<div
class=
"Questiontab
<?=
$j
?>
"
style=
"display:
<?=
(
$j
>
1
)
?
'none'
:
'block'
?>
"
>
<div
id=
"wizard_Service
<?=
$val
[
'categoryId'
]
?>
"
class=
"tab-pane "
role=
"tabpanel"
>
<h5
class=
"text-center"
>
<?=
$key
?>
</h5>
<?php
foreach
(
$val
as
$row
){
$tot
++
;
?>
<?php
foreach
(
$val
as
$ky
=>
$row
)
{
$tot
+=
1
;
?>
<div
class=
"row"
>
<div
class=
"col-lg-12 mb-2"
>
<h5>
<?=
$row
->
question
?>
</h5>
<h5>
<?=
$ky
+
1
;
?>
)
<?=
$row
->
question
?>
</h5>
<input
type=
"hidden"
name=
"question[]"
value=
"
<?=
$row
->
id
?>
"
/>
<input
type=
"hidden"
name=
"org_ques[]"
value=
"
<?=
$row
->
answer
?>
"
/>
</div>
<div
class=
"col-lg-6 mb-2"
>
<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
class=
"form-check custom-checkbox mb-3 checkbox-warning
"
>
<input
type=
"radio"
class=
"form-check-input"
id=
"customRadioBox"
name=
"questions[
<?=
$row
->
id
?>
]"
value=
"
<?=
$row
->
option_a
?>
"
>
<label
class=
"form-check-label"
for=
"customRadioBox
"
>
<?=
$row
->
option_a
?>
</label>
</div>
</div>
<div
class=
"col-lg-6 mb-2"
>
<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
class=
"form-check custom-checkbox mb-3 checkbox-warning
"
>
<input
type=
"radio"
class=
"form-check-input"
id=
"customRadioBox"
name=
"questions[
<?=
$row
->
id
?>
]"
value=
"
<?=
$row
->
option_b
?>
"
>
<label
class=
"form-check-label"
for=
"customRadioBox
"
>
<?=
$row
->
option_b
?>
</label>
</div>
</div>
<div
class=
"col-lg-6 mb-2"
>
<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
class=
"form-check custom-checkbox mb-3 checkbox-warning
"
>
<input
type=
"radio"
class=
"form-check-input"
id=
"customRadioBox"
name=
"questions[
<?=
$row
->
id
?>
]"
value=
"
<?=
$row
->
option_c
?>
"
>
<label
class=
"form-check-label"
for=
"customRadioBox
"
>
<?=
$row
->
option_c
?>
</label>
</div>
</div>
<div
class=
"col-lg-6 mb-2"
>
<div
class=
"mb-3"
>
<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
class=
"form-check custom-checkbox mb-3 checkbox-warning"
>
<input
type=
"radio"
class=
"form-check-input"
id=
"customRadioBox"
name=
"questions[
<?=
$row
->
id
?>
]"
value=
"
<?=
$row
->
option_d
?>
"
>
<label
class=
"form-check-label"
for=
"customRadioBox"
>
<?=
$row
->
option_d
?>
</label>
</div>
</div>
</div>
</div>
<?php
}
?>
<div
class=
"row"
>
<div
class=
"col-md-9
"
></div>
<div
class=
"col-md-7
"
></div>
<div
class=
"col-md-3"
>
<a
href=
"javascript:void()"
class=
"btn btn-primary pull-right"
>
Previous
</a>
<a
href=
"javascript:void()"
class=
"btn btn-primary pull-right"
>
Next
</a>
<?php
if
(
$j
!=
1
)
{
?>
<a
href=
"javascript:previousQuestion(
<?=
$j
?>
)"
class=
"btn btn-primary pull-right"
>
Previous
</a>
<?php
}
?>
<?php
if
(
$tot
==
$cont
){
?>
<input
type=
"submit"
name=
"submit"
value=
"Submit"
class=
"btn btn-info"
/>
<?php
}
else
{
?>
<a
href=
"javascript:nextQuestion(
<?=
$j
?>
)"
class=
"btn btn-primary pull-right"
>
Next
</a>
<?php
}
?>
</div>
</div>
</div>
<?php
}
}
?>
</div>
<?php
$j
++
;
}
?>
</div>
</form>
<?php
}
?>
</div>
</div>
...
...
@@ -104,8 +130,7 @@
Content body end
***********************************-->
<script>
function
updateTime
()
{
function
updateTime
()
{
var
date
=
"
<?php
echo
$date
?>
"
;
var
currentTime
=
new
Date
(
date
);
...
...
@@ -123,11 +148,39 @@ function updateTime() {
var
formattedTime
=
hours
+
":"
+
minutes
+
":"
+
seconds
;
$
(
'#time'
).
text
(
formattedTime
);
}
}
setInterval
(()
=>
{
setInterval
(()
=>
{
updateTime
();
},
1000
);
},
1000
);
function
previousQuestion
(
page
)
{
$pre
=
page
-
1
;
$next
=
page
+
1
;
$
(
'.Questiontab'
+
page
).
hide
();
if
(
page
==
1
)
{
$
(
'.Questiontab'
+
page
).
show
();
}
else
{
$
(
'.Questiontab'
+
$pre
).
show
();
}
}
function
nextQuestion
(
page
)
{
$pre
=
page
-
1
;
$next
=
page
+
1
;
$
(
'.Questiontab'
+
$next
).
show
();
if
(
page
==
1
)
{
$
(
'.Questiontab'
+
page
).
hide
();
}
else
{
$
(
'.Questiontab'
+
$next
).
hide
();
}
// $('.Questiontab'+$pre).hide();
}
</script>
admin/application/views/exam/view_exam.php
View file @
14bd4c6b
...
...
@@ -50,8 +50,8 @@
<td>
<?=
$i
?>
</td>
<td>
<?=
$row
->
year
?>
</td>
<td>
<?=
$row
->
name
?>
</td>
<td>
<?=
isset
(
$row
->
date
)
?
date
(
'd-m-Y'
,
strtotime
(
$row
->
date
))
:
''
?>
</td>
<td>
<?=
isset
(
$row
->
time
)
?
date
(
'H:i a'
,
strtotime
(
$row
->
time
))
:
''
?>
</td>
<td>
<?=
isset
(
$row
->
date
)
?
date
(
'd-m-Y'
,
strtotime
(
$row
->
objective_
date
))
:
''
?>
</td>
<td>
<?=
isset
(
$row
->
time
)
?
date
(
'H:i a'
,
strtotime
(
$row
->
objective_
time
))
:
''
?>
</td>
<td>
<a
href=
"javascript:takeExam('
<?=
$row
->
id
?>
')"
data-toggle=
"tooltip"
id=
"edit"
data-placement=
"top"
title=
"Edit"
data-original-title=
"Edit"
class=
"btn btn-sm btn-info"
>
View
</a>
</td>
...
...
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