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
a4a1775e
Commit
a4a1775e
authored
Jul 08, 2015
by
Afzal Wali
Committed by
Muhammad Shoaib
Jul 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic structure for the Add New Allowance Modal.
parent
91ac771f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
152 additions
and
0 deletions
+152
-0
edx_proctoring/static/proctoring/close-modal-hover.png
+0
-0
edx_proctoring/static/proctoring/close-modal.png
+0
-0
edx_proctoring/static/proctoring/js/views/Backbone.ModalDialog.js
+0
-0
edx_proctoring/static/proctoring/js/views/proctored_exam_add_allowance_view.js
+96
-0
edx_proctoring/static/proctoring/js/views/proctored_exam_allowance_view.js
+3
-0
edx_proctoring/static/proctoring/templates/add-new-allowance.underscore
+53
-0
No files found.
edx_proctoring/static/proctoring/close-modal-hover.png
0 → 100644
View file @
a4a1775e
4.41 KB
edx_proctoring/static/proctoring/close-modal.png
0 → 100644
View file @
a4a1775e
1.91 KB
edx_proctoring/static/proctoring/js/views/Backbone.ModalDialog.js
0 → 100644
View file @
a4a1775e
This diff is collapsed.
Click to expand it.
edx_proctoring/static/proctoring/js/views/proctored_exam_add_allowance_view.js
0 → 100644
View file @
a4a1775e
var
edx
=
edx
||
{};
(
function
(
Backbone
,
$
,
_
)
{
'use strict'
;
edx
.
instructor_dashboard
=
edx
.
instructor_dashboard
||
{};
edx
.
instructor_dashboard
.
proctoring
=
edx
.
instructor_dashboard
.
proctoring
||
{};
edx
.
instructor_dashboard
.
proctoring
.
AddAllowanceView
=
Backbone
.
ModalView
.
extend
(
{
name
:
"AddAllowanceView"
,
template
:
null
,
model
:
edx
.
instructor_dashboard
.
proctoring
.
ProctoredExamAllowanceModel
,
tempate_url
:
'/static/proctoring/templates/add-new-allowance.underscore'
,
initialize
:
function
()
{
_
.
bindAll
(
this
,
"render"
);
this
.
loadTemplateData
();
// Backbone.Validation.bind( this, {valid:this.hideError, invalid:this.showError});
},
events
:
{
"submit form"
:
"addAllowance"
},
loadTemplateData
:
function
(){
var
self
=
this
;
$
.
ajax
({
url
:
self
.
tempate_url
,
dataType
:
"html"
})
.
error
(
function
(
jqXHR
,
textStatus
,
errorThrown
){
})
.
done
(
function
(
template_data
)
{
self
.
template
=
_
.
template
(
template_data
);
self
.
render
();
self
.
showModal
();
});
},
getCurrentFormValues
:
function
()
{
return
{
name
:
$
(
"#name"
).
val
(),
email
:
$
(
"#email"
).
val
(),
phone
:
$
(
"#phone"
).
val
()
};
},
hideError
:
function
(
view
,
attr
,
selector
)
{
var
$element
=
view
.
$form
[
attr
];
$element
.
removeClass
(
"error"
);
$element
.
parent
().
find
(
".error-message"
).
empty
();
},
showError
:
function
(
view
,
attr
,
errorMessage
,
selector
)
{
var
$element
=
view
.
$form
[
attr
];
$element
.
addClass
(
"error"
);
var
$errorMessage
=
$element
.
parent
().
find
(
".error-message"
);
if
(
$errorMessage
.
length
==
0
)
{
$errorMessage
=
$
(
"<div class='error-message'></div>"
);
$element
.
parent
().
append
(
$errorMessage
);
}
$errorMessage
.
empty
().
append
(
errorMessage
);
},
addAllowance
:
function
(
event
)
{
event
.
preventDefault
();
// if( this.model.set( this.getCurrentFormValues()))
// {
this
.
hideModal
();
// }
},
render
:
function
()
{
var
exams_data
=
[{
'exam_name'
:
'exam12'
},{
'exam_name'
:
'exam22'
},{
'exam_name'
:
'exam32'
}];
var
allowance_types
=
[
'Additional time (minutes)'
];
$
(
this
.
el
).
html
(
this
.
template
({
proctored_exams
:
exams_data
,
allowance_types
:
allowance_types
}));
this
.
$form
=
{
name
:
this
.
$
(
"#name"
),
email
:
this
.
$
(
"#email"
),
phone
:
this
.
$
(
"#phone"
)}
return
this
;
}
});
}).
call
(
this
,
Backbone
,
$
,
_
);
edx_proctoring/static/proctoring/js/views/proctored_exam_allowance_view.js
View file @
a4a1775e
...
@@ -123,6 +123,9 @@ var edx = edx || {};
...
@@ -123,6 +123,9 @@ var edx = edx || {};
this
.
$el
.
html
(
html
);
this
.
$el
.
html
(
html
);
this
.
$el
.
show
();
this
.
$el
.
show
();
}
}
},
showAddModal
:
function
()
{
var
add_allowance_view
=
new
edx
.
instructor_dashboard
.
proctoring
.
AddAllowanceView
();
}
}
});
});
}).
call
(
this
,
Backbone
,
$
,
_
);
}).
call
(
this
,
Backbone
,
$
,
_
);
edx_proctoring/static/proctoring/templates/add-new-allowance.underscore
0 → 100644
View file @
a4a1775e
<div class='modal-header'>Add a new Allowance</div>
<form>
<table class='compact'>
<tr>
<td>
<label>Proctored Exam</label>
</td>
<td>
<select name='exams'>
<% _.each(proctored_exams, function(proctored_exam){ %>
<option value="<%= proctored_exam.exam_name %>"><%= proctored_exam.exam_name %></option>
<% }); %>
</select>
</td>
</tr>
<tr>
<td>
<label>Allowance Type</label>
</td>
<td>
<select>
<% _.each(allowance_types, function(allowance_type){ %>
<option value="<%= allowance_type %>"><%= allowance_type %></option>
<% }); %>
</select>
</td>
</tr>
<tr>
<td>
<label>Value</label>
</td>
<td>
<input>
</input>
</td>
</tr>
<tr>
<td>
<label>Username or Email</label>
</td>
<td>
<input>
</input>
</td>
</tr>
<tr>
<td>
<input id='addNewAllowance' type='submit' value='Save' />
</td>
</tr>
</table>
</form>
\ No newline at end of file
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