Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
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
OpenEdx
edx-proctoring
Commits
20d65815
Commit
20d65815
authored
Jul 09, 2015
by
Muhammad Shoaib
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load the proctored exams in the drop down
parent
eae99e71
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
23 deletions
+49
-23
edx_proctoring/static/proctoring/js/collections/proctored_exam_allowance_collection.js
+2
-1
edx_proctoring/static/proctoring/js/collections/proctored_exam_collection.js
+14
-0
edx_proctoring/static/proctoring/js/views/Backbone.ModalDialog.js
+3
-2
edx_proctoring/static/proctoring/js/views/proctored_exam_add_allowance_view.js
+11
-8
edx_proctoring/static/proctoring/js/views/proctored_exam_allowance_view.js
+13
-4
edx_proctoring/static/proctoring/templates/add-new-allowance.underscore
+5
-7
edx_proctoring/urls.py
+1
-1
No files found.
edx_proctoring/static/proctoring/js/collections/proctored_exam_allowance_collection.js
View file @
20d65815
...
...
@@ -7,7 +7,7 @@ var edx = edx || {};
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamAllowanceCollection
=
Backbone
.
Collection
.
extend
({
/* model for a collection of ProctoredExamAllowance */
model
:
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamAllowanceModel
,
url
:
'/api/edx_proctoring/v1/proctored_exam/
allowance
'
url
:
'/api/edx_proctoring/v1/proctored_exam/'
});
this
.
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamAllowanceCollection
=
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamAllowanceCollection
;
}).
call
(
this
,
Backbone
);
\ No newline at end of file
edx_proctoring/static/proctoring/js/collections/proctored_exam_collection.js
0 → 100644
View file @
20d65815
var
edx
=
edx
||
{};
(
function
(
Backbone
)
{
edx
.
instructor_dashboard
=
edx
.
instructor_dashboard
||
{};
edx
.
instructor_dashboard
.
proctoring
=
edx
.
instructor_dashboard
.
proctoring
||
{};
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamCollection
=
Backbone
.
Collection
.
extend
({
/* model for a collection of ProctoredExamAllowance */
model
:
ProctoredExamModel
,
url
:
'/api/edx_proctoring/v1/proctored_exam/exam/course_id/'
});
this
.
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamCollection
=
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamCollection
;
}).
call
(
this
,
Backbone
);
\ No newline at end of file
edx_proctoring/static/proctoring/js/views/Backbone.ModalDialog.js
View file @
20d65815
...
...
@@ -342,10 +342,11 @@ Backbone.ModalView =
$
(
"<a href='#' id='modalCloseButton'> </a>"
)
.
css
({
"position"
:
"absolute"
,
"top"
:
"-
10
px"
,
"right"
:
"-
10
px"
,
"top"
:
"-
8
px"
,
"right"
:
"-
513
px"
,
"width"
:
"32px"
,
"height"
:
"32px"
,
"z-index"
:
"999999"
,
"background"
:
"transparent url("
+
view
.
options
.
closeImageUrl
+
") top left no-repeat"
,
"text-decoration"
:
"none"
})
.
appendTo
(
this
.
modalContainer
)
...
...
edx_proctoring/static/proctoring/js/views/proctored_exam_add_allowance_view.js
View file @
20d65815
...
...
@@ -12,10 +12,11 @@ var edx = edx || {};
template
:
null
,
model
:
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamAllowanceModel
,
tempate_url
:
'/static/proctoring/templates/add-new-allowance.underscore'
,
initialize
:
function
()
{
initialize
:
function
(
options
)
{
this
.
proctored_exams
=
options
.
proctored_exams
;
_
.
bindAll
(
this
,
"render"
);
this
.
loadTemplateData
();
//
Backbone.Validation.bind( this, {valid:this.hideError, invalid:this.showError});
//Backbone.Validation.bind( this, {valid:this.hideError, invalid:this.showError});
},
events
:
{
"submit form"
:
"addAllowance"
...
...
@@ -35,9 +36,10 @@ var edx = edx || {};
getCurrentFormValues
:
function
()
{
return
{
name
:
$
(
"#name"
).
val
(),
email
:
$
(
"#email"
).
val
(),
phone
:
$
(
"#phone"
).
val
()
proctored_exam
:
$
(
"select#proctored_exam"
).
val
(),
allowance_type
:
$
(
"select#allowance_type"
).
val
(),
value
:
$
(
"#allowance_value"
).
val
(),
user_info
:
$
(
"#user_info"
).
val
()
};
},
hideError
:
...
...
@@ -67,6 +69,7 @@ var edx = edx || {};
function
(
event
)
{
event
.
preventDefault
();
var
values
=
this
.
getCurrentFormValues
();
// if( this.model.set( this.getCurrentFormValues()))
// {
...
...
@@ -81,15 +84,15 @@ var edx = edx || {};
var
allowance_types
=
[
'Additional time (minutes)'
];
$
(
this
.
el
).
html
(
this
.
template
({
proctored_exams
:
exams_data
,
proctored_exams
:
this
.
proctored_exams
,
allowance_types
:
allowance_types
}));
this
.
$form
=
{
name
:
this
.
$
(
"#name"
),
email
:
this
.
$
(
"#email"
),
phone
:
this
.
$
(
"#phone"
)
}
phone
:
this
.
$
(
"#phone"
)
};
return
this
;
}
});
...
...
edx_proctoring/static/proctoring/js/views/proctored_exam_allowance_view.js
View file @
20d65815
...
...
@@ -9,7 +9,7 @@ var edx = edx || {};
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamAllowanceView
=
Backbone
.
View
.
extend
({
initialize
:
function
(
options
)
{
this
.
collection
=
new
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamAllowanceCollection
();
this
.
proctoredExamCollection
=
new
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamCollection
();
/* unfortunately we have to make some assumptions about what is being set up in HTML */
this
.
setElement
(
$
(
'.special-allowance-container'
));
this
.
course_id
=
this
.
$el
.
data
(
'course-id'
);
...
...
@@ -24,7 +24,8 @@ var edx = edx || {};
/* Load the static template for rendering. */
this
.
loadTemplateData
();
this
.
collection
.
url
=
this
.
allowance_url
+
'/'
+
this
.
course_id
;
this
.
proctoredExamCollection
.
url
=
this
.
proctoredExamCollection
.
url
+
this
.
course_id
;
this
.
collection
.
url
=
this
.
allowance_url
+
this
.
course_id
+
'/allowance'
;
},
events
:
{
...
...
@@ -67,7 +68,7 @@ var edx = edx || {};
},
success
:
function
()
{
// fetch the allowances again.
self
.
collection
.
url
=
self
.
allowance_url
+
'/'
+
self
.
course_id
;
self
.
collection
.
url
=
self
.
allowance_url
+
self
.
course_id
+
'/allowance'
;
self
.
hydrate
();
}
}
...
...
@@ -125,7 +126,15 @@ var edx = edx || {};
}
},
showAddModal
:
function
()
{
var
add_allowance_view
=
new
edx
.
instructor_dashboard
.
proctoring
.
AddAllowanceView
();
var
self
=
this
;
self
.
proctoredExamCollection
.
fetch
({
success
:
function
()
{
var
add_allowance_view
=
new
edx
.
instructor_dashboard
.
proctoring
.
AddAllowanceView
({
course_id
:
self
.
course_id
,
proctored_exams
:
self
.
proctoredExamCollection
.
toJSON
()
});
}
});
}
});
}).
call
(
this
,
Backbone
,
$
,
_
);
edx_proctoring/static/proctoring/templates/add-new-allowance.underscore
View file @
20d65815
...
...
@@ -6,9 +6,9 @@
<label>Proctored Exam</label>
</td>
<td>
<select
name='exams
'>
<select
id='proctored_exam
'>
<% _.each(proctored_exams, function(proctored_exam){ %>
<option value="<%= proctored_exam.
exam_name
%>"><%= proctored_exam.exam_name %></option>
<option value="<%= proctored_exam.
id
%>"><%= proctored_exam.exam_name %></option>
<% }); %>
</select>
</td>
...
...
@@ -18,7 +18,7 @@
<label>Allowance Type</label>
</td>
<td>
<select>
<select
id="allowance_type"
>
<% _.each(allowance_types, function(allowance_type){ %>
<option value="<%= allowance_type %>"><%= allowance_type %></option>
<% }); %>
...
...
@@ -30,8 +30,7 @@
<label>Value</label>
</td>
<td>
<input>
</input>
<input type="text" id="allowance_value" />
</td>
</tr>
<tr>
...
...
@@ -39,8 +38,7 @@
<label>Username or Email</label>
</td>
<td>
<input>
</input>
<input type="text" id="user_info" />
</td>
</tr>
<tr>
...
...
edx_proctoring/urls.py
View file @
20d65815
...
...
@@ -36,7 +36,7 @@ urlpatterns = patterns( # pylint: disable=invalid-name
name
=
'edx_proctoring.proctored_exam.attempt'
),
url
(
r'edx_proctoring/v1/proctored_exam/
allowance/{}
$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
r'edx_proctoring/v1/proctored_exam/
{}/allowance
$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
views
.
ExamAllowanceView
.
as_view
(),
name
=
'edx_proctoring.proctored_exam.allowance'
),
...
...
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