Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ARFA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
ARFA
ARFA
Commits
4bab9768
Commit
4bab9768
authored
Nov 25, 2018
by
Rahul-chunduru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui for view test
parent
26fb4de6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
ARFA/ARFA_app/models.py
ARFA/ARFA_app/models.py
+3
-3
ARFA/ARFA_app/templates/ARFA_app/create_Test.html
ARFA/ARFA_app/templates/ARFA_app/create_Test.html
+1
-2
ARFA/ARFA_app/views.py
ARFA/ARFA_app/views.py
+13
-8
No files found.
ARFA/ARFA_app/models.py
View file @
4bab9768
...
...
@@ -29,9 +29,9 @@ class Test(models.Model):
test_name
=
models
.
CharField
(
max_length
=
200
,
unique
=
True
)
visibility_student
=
models
.
CharField
(
max_length
=
20
)
ownership
=
models
.
CharField
(
max_length
=
20
)
expected_time_for_completion
=
models
.
DurationField
(
blank
=
True
)
start_time
=
models
.
DateTimeField
(
auto_now
=
False
,
auto_now_add
=
False
)
max_marks
=
models
.
Float
Field
(
null
=
True
)
expected_time_for_completion
=
models
.
CharField
(
max_length
=
10
)
start_time
=
models
.
CharField
(
max_length
=
10
)
max_marks
=
models
.
Integer
Field
(
null
=
True
)
# class TestQuestions(models.Model):
# test_ID = models.ForeignKey(
...
...
ARFA/ARFA_app/templates/ARFA_app/create_Test.html
View file @
4bab9768
...
...
@@ -24,10 +24,9 @@ Create Test
{%for question in questions%}
<li
class=
"list-group-item"
>
<!-- <li> -->
<input
type=
"checkbox"
value=
"True"
name =
"{{question.q_id}}"
>
<div
class=
"row toggle"
>
<div
class=
"col-xs-10"
>
<input
type=
"checkbox"
value=
"True"
name =
"i{{question.q_id}}"
>
{{question.question_text}} {{question.q_id}}
</br>
</div>
</div>
...
...
ARFA/ARFA_app/views.py
View file @
4bab9768
...
...
@@ -323,8 +323,8 @@ def create_Test(request):
return
render
(
request
,
'ARFA_app/create_Test.html'
,
args
)
if
TestForm
.
is_valid
():
test
=
TestForm
.
save
()
test
=
TestForm
.
save
()
# for attr in dir(Test):
# print attr
# try:
...
...
@@ -337,26 +337,31 @@ def create_Test(request):
# test = Test()
containsObj
=
models
.
Contains
(
test_ID
=
test
)
for
q
in
data
.
keys
():
try
:
# try:
print
q
if
q
[
0
]
!=
'i'
:
continue
;
q
=
q
[
1
:]
int
(
q
)
containsObj
.
q_ID_id
=
q
print
q
#data[q] is an array ['True', 'pos_marks', 'neg_marks']
containsObj
.
marks_pos
=
data
[
q
+
"1"
]
containsObj
.
marks_neg
=
data
[
q
+
"2"
]
print
data
[
q
+
"1"
]
containsObj
.
pk
=
None
containsObj
.
save
()
except
ValueError
as
e
:
print
"success"
print
containsObj
# except ValueError as e:
data
.
pop
(
q
)
print
e
continue
# for q in data:
print
data
#
print data
return
render
(
request
,
'ARFA_app/view_personal_Test.html'
,
args
)
...
...
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