1 | <%@ Page Language="vb" ValidateRequest="false" AutoEventWireup="false" CodeBehind="LessonMarks.aspx.vb" |
---|
2 | Inherits="vla.LessonMarks" %> |
---|
3 | |
---|
4 | <%@ Register TagPrefix="uc1" TagName="Banner1" Src="../UserControls/Banner.ascx" %> |
---|
5 | <%@ Register TagPrefix="uc1" TagName="LessonMenu" Src="../UserControls/LessonMenu.ascx" %> |
---|
6 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
---|
7 | <html> |
---|
8 | <head> |
---|
9 | <title>Questions</title> |
---|
10 | <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR" /> |
---|
11 | <meta content="Visual Basic 7.0" name="CODE_LANGUAGE" /> |
---|
12 | <meta content="JavaScript" name="vs_defaultClientScript" /> |
---|
13 | <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" /> |
---|
14 | <link title="ICRA labels" href="https://virtuallearningacademy.net/labels.rdf" type="application/rdf+xml" |
---|
15 | rel="meta" /> |
---|
16 | <meta http-equiv="pics-Label" content='(pics-1.1 "http://www.icra.org/pics/vocabularyv03/" l gen true for "https://virtuallearningacademy.net" r (n 0 s 0 v 0 l 0 oa 0 ob 0 oc 0 od 0 oe 0 of 0 og 0 oh 0 c 0) gen true for "https://www.virtuallearningacademy.net" r (n 0 s 0 v 0 l 0 oa 0 ob 0 oc 0 od 0 oe 0 of 0 og 0 oh 0 c 0))' /> |
---|
17 | <link href="../includes/Style.css" type="text/css" rel="stylesheet" /> |
---|
18 | |
---|
19 | <!-- CKEditor --> |
---|
20 | <script type="text/javascript" src="../ckeditor/ckeditor.js"></script> |
---|
21 | <script type="text/javascript" src="../ckeditor/adapters/jquery.js"></script> |
---|
22 | <script type="text/javascript" src="../includes/functions.js" ></script> |
---|
23 | |
---|
24 | <style type="text/css"> |
---|
25 | #header_gradient img { display:block; } |
---|
26 | |
---|
27 | .anchor_right |
---|
28 | { |
---|
29 | float:right; |
---|
30 | margin-right: 60px; |
---|
31 | cursor:pointer; |
---|
32 | } |
---|
33 | .anchor_right a |
---|
34 | { |
---|
35 | margin-left:3px; |
---|
36 | } |
---|
37 | |
---|
38 | .answer_scroll_block |
---|
39 | { |
---|
40 | overflow:auto; |
---|
41 | height:100px; |
---|
42 | background:#FFFFFF; |
---|
43 | border: solid 1px #000000; |
---|
44 | width:95%; |
---|
45 | position:relative; |
---|
46 | } |
---|
47 | |
---|
48 | .answer_block |
---|
49 | { |
---|
50 | margin:3px; |
---|
51 | position:relative; |
---|
52 | } |
---|
53 | |
---|
54 | .comment_text_block { clear:both; position:relative; } |
---|
55 | .comment_text_block textarea { width:95%; } |
---|
56 | |
---|
57 | </style> |
---|
58 | </head> |
---|
59 | <body onclick="PutPositions()" onload="ScrollWindow();timeIt(<%=Application("SessionTimeout")%>);"> |
---|
60 | <form id="Form1" method="post" runat="server"> |
---|
61 | <a name="hltop"></a> |
---|
62 | <input id="WindowXPos" type="hidden" name="WindowXPos" runat="server" /> |
---|
63 | <input id="WindowYPos" type="hidden" name="WindowYPos" runat="server" /> |
---|
64 | <table cellspacing="0" cellpadding="0" width="100%" border="0" valign="top"> |
---|
65 | <tr> |
---|
66 | <td colspan="2"> |
---|
67 | <uc1:Banner1 ID="Banner1" runat="server"></uc1:Banner1> |
---|
68 | </td> |
---|
69 | </tr> |
---|
70 | <tr> |
---|
71 | <td valign="middle" align="center" bgcolor="darkslateblue" colspan="2"> |
---|
72 | <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="10pt" Font-Names="Verdana" |
---|
73 | ForeColor="White">Course:</asp:Label> |
---|
74 | <asp:DropDownList ID="ddlClasses" runat="server" AutoPostBack="True" /> |
---|
75 | <asp:Label ID="Label6" runat="server" Width="10px" /> |
---|
76 | <asp:Label ID="Label5" runat="server" Font-Bold="True" Font-Size="10pt" Font-Names="Verdana" |
---|
77 | ForeColor="White" Width="65px" Height="13px"> Student:</asp:Label> |
---|
78 | <asp:DropDownList ID="ddlStudents" AutoPostBack="True" runat="server"> |
---|
79 | </asp:DropDownList> |
---|
80 | <asp:Label ID="Label3" runat="server" Width="10px"></asp:Label> |
---|
81 | <asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="10pt" Font-Names="Verdana" |
---|
82 | ForeColor="White" Width="62px" Height="13px"> Unit:</asp:Label> |
---|
83 | <asp:DropDownList ID="ddlStudentLessons" AutoPostBack="True" runat="server"> |
---|
84 | </asp:DropDownList> |
---|
85 | </td> |
---|
86 | </tr> |
---|
87 | </table> |
---|
88 | <div id="header_gradient"> |
---|
89 | <img src="../Images/BottomBar.gif" width="100%" height="10" /> |
---|
90 | </div> |
---|
91 | <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0" valign="top"> |
---|
92 | <tr> |
---|
93 | <td valign="top" align="center" width="7%"> |
---|
94 | |
---|
95 | </td> |
---|
96 | <td valign="top" align="center" width="86%" bgcolor="#ffffff"> |
---|
97 | <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0"> |
---|
98 | <tr> |
---|
99 | <td height="8"> |
---|
100 | <img height="8" src="../Images/Nothing.gif" /> |
---|
101 | </td> |
---|
102 | </tr> |
---|
103 | <tr> |
---|
104 | <td valign="bottom" align="left" width="100%" bgcolor="#ccccff"> |
---|
105 | |
---|
106 | <asp:Label ID="Label7" runat="server">Status: </asp:Label> |
---|
107 | <asp:Label ID="lblStatus" runat="server" Font-Bold="True" Font-Names="Verdana" ForeColor="Blue"></asp:Label> |
---|
108 | <asp:Label ID="Label14" runat="server" Width="8px"></asp:Label><asp:Label ID="Label4" |
---|
109 | runat="server" Font-Size="10pt" Font-Names="Verdana" ForeColor="Black">Mark:</asp:Label> |
---|
110 | <asp:Label ID="lblAverage" runat="server" Font-Bold="True" Font-Size="10pt" Font-Names="Verdana" |
---|
111 | ForeColor="Blue"></asp:Label> |
---|
112 | <asp:Label ID="lblMark" runat="server" Font-Bold="True" Font-Size="10pt" Font-Names="Verdana" |
---|
113 | ForeColor="Blue"></asp:Label> |
---|
114 | <asp:Label ID="Label15" runat="server" Width="8px" Height="5px"></asp:Label><asp:Label |
---|
115 | ID="lblComment" runat="server" Font-Names="Verdana"></asp:Label> |
---|
116 | </td> |
---|
117 | </tr> |
---|
118 | </table> |
---|
119 | |
---|
120 | <div id="grade_block" runat="server"> |
---|
121 | |
---|
122 | <div id="toggle_block"> |
---|
123 | <img id="imageToggle" src="../images/toggle-button-plus.png" alt="toggle" onclick="javascript:toggle();" runat="server" /> |
---|
124 | |
---|
125 | <a id="showHide" href="javascript:toggle();" runat="server">Show Calculated Grade</a> |
---|
126 | </div> |
---|
127 | |
---|
128 | <asp:Panel ID="pnlFinal" runat="server" CssClass="center hidden"> |
---|
129 | <br /> |
---|
130 | <asp:Label ID="Label12" Style="text-align: center" runat="server" Font-Names="Verdana" |
---|
131 | Font-Bold="True" Width="134px" Font-Underline="false">Calculated Grade:</asp:Label> |
---|
132 | <asp:Label ID="lblGrade" Style="text-align: center" runat="server" ForeColor="Blue" |
---|
133 | Font-Bold="True" Font-Underline="False"></asp:Label> |
---|
134 | <table style="border-right: blue 1px solid; border-top: blue 1px solid; border-left: blue 1px solid; |
---|
135 | border-bottom: blue 1px solid" width="60%" align="center" bgcolor="bisque" border="0"> |
---|
136 | <tr> |
---|
137 | <td height="5"> |
---|
138 | <img height="5" src="../Images/Nothing.gif" /> |
---|
139 | </td> |
---|
140 | </tr> |
---|
141 | <tr> |
---|
142 | <td align="center"> |
---|
143 | <asp:Label ID="Label9" runat="server" ForeColor="Blue">% Correct:</asp:Label> |
---|
144 | <asp:TextBox ID="txtPct" runat="server" Width="52px"></asp:TextBox> |
---|
145 | <asp:Label ID="Label10" runat="server" Width="25px"></asp:Label> |
---|
146 | <asp:Label ID="Label11" runat="server" ForeColor="Blue">Grade: </asp:Label> |
---|
147 | <asp:TextBox ID="txtGrade" runat="server" Width="52px" designtimedragdrop="85"></asp:TextBox> |
---|
148 | </td> |
---|
149 | </tr> |
---|
150 | <tr> |
---|
151 | <td height="5"> |
---|
152 | <img height="5" src="../Images/Nothing.gif" /> |
---|
153 | </td> |
---|
154 | </tr> |
---|
155 | <tr> |
---|
156 | <td align="center"> |
---|
157 | <asp:Label ID="Label8" runat="server" ForeColor="Blue">Select the unit status:</asp:Label><br> |
---|
158 | <asp:RadioButtonList ID="rblLessonStatusCd" runat="server" CellSpacing="0" CellPadding="0"> |
---|
159 | <asp:ListItem Value="G" Selected="True">This unit is complete</asp:ListItem> |
---|
160 | <asp:ListItem Value="R">This unit must be re-done</asp:ListItem> |
---|
161 | </asp:RadioButtonList> |
---|
162 | <asp:Label ID="lblLessonStatusErrMessage" runat="server" ForeColor="Red" EnableViewState="False"></asp:Label> |
---|
163 | </td> |
---|
164 | </tr> |
---|
165 | <tr> |
---|
166 | <td height="5"> |
---|
167 | <img height="5" src="../Images/Nothing.gif" /> |
---|
168 | </td> |
---|
169 | </tr> |
---|
170 | <tr> |
---|
171 | <td align="center"> |
---|
172 | <asp:Label ID="lblTeacherComment" runat="server" ForeColor="Blue">Enter any comments that you would like to send to the student:</asp:Label><br> |
---|
173 | <asp:TextBox ID="txtTeacherComment" onkeydown="textCounter(this.form.txtTeacherComment,this.form.MsgCharCounter,1000);" |
---|
174 | onkeyup="textCounter(this.form.txtTeacherComment,this.form.MsgCharCounter,1000);" |
---|
175 | runat="server" Width="408px" Rows="3" TextMode="MultiLine" MaxLength="1000"></asp:TextBox> |
---|
176 | <div id="divTeacherComment" runat="server"> |
---|
177 | </div> |
---|
178 | </td> |
---|
179 | </tr> |
---|
180 | <tr> |
---|
181 | <td align="center"> |
---|
182 | <span class="size" id="lblMsgMaxChar">You may enter up to 1000 characters. </span> |
---|
183 | <input id="MsgCharCounter" style="border-right: slateblue 1pt solid; border-top: slateblue 1pt solid; |
---|
184 | border-left: slateblue 1pt solid; width: 25pt; border-bottom: slateblue 1pt solid; |
---|
185 | background-color: lightgrey" readonly value="<%=1000-cint(me.txtTeacherComment.text.length) %>" |
---|
186 | name="MsgCharCounter" /> |
---|
187 | <span class="size" id="lblMsgMaxChar2">characters left.</span> |
---|
188 | </td> |
---|
189 | </tr> |
---|
190 | <tr> |
---|
191 | <div style="color: Red; text-align: center; padding: 5px 0px;"> |
---|
192 | <asp:Label ID="LabelRedoMessage" runat="server" Visible="false" Text="At least one question must be marked as Re-Do in order to mark this unit to be re-done." /> |
---|
193 | </div> |
---|
194 | </tr> |
---|
195 | <tr> |
---|
196 | <td height="5"> |
---|
197 | <img height="5" src="../Images/Nothing.gif"> |
---|
198 | </td> |
---|
199 | </tr> |
---|
200 | <tr> |
---|
201 | <td align="center"> |
---|
202 | <button id="btnSubmit" runat="server" onclick="return CheckCKEditorLengths('CKEDITORLengthErrorSubmit', true);"> |
---|
203 | Save & Post the Grade</button> |
---|
204 | </td> |
---|
205 | </tr> |
---|
206 | <tr> |
---|
207 | <td height="5"> |
---|
208 | <img height="5" src="../Images/Nothing.gif" /> |
---|
209 | </td> |
---|
210 | </tr> |
---|
211 | </table> |
---|
212 | </asp:Panel> |
---|
213 | </div> |
---|
214 | |
---|
215 | <table width="100%" align="center" border="0"> |
---|
216 | |
---|
217 | <tr> |
---|
218 | <td style="height: 57px" width="100%"> |
---|
219 | <asp:Label ID="test" runat="server" /> |
---|
220 | <asp:Label ID="myTest" runat="server" /> |
---|
221 | <asp:Table ID="tblGrid" runat="server" Font-Size="8pt" Font-Names="Arial" ForeColor="Black" |
---|
222 | Width="100%" EnableViewState="False" CellPadding="3" CellSpacing="0" HorizontalAlign="Center" |
---|
223 | GridLines="None" /> |
---|
224 | </td> |
---|
225 | </tr> |
---|
226 | <tr> |
---|
227 | <td align="center"> |
---|
228 | <button id="btnSave" runat="server" onclick="return CheckCKEditorLengths('CKEDITORLengthErrorSave', false);"> |
---|
229 | Save & Calculate the Grade |
---|
230 | </button> |
---|
231 | <br /> |
---|
232 | <label id="lblAnswerLengthError" class="errorLabel"> |
---|
233 | </label> |
---|
234 | <br /> |
---|
235 | <label id="lblTeacherCommentsLengthError" class="errorLabel"> |
---|
236 | </label> |
---|
237 | </td> |
---|
238 | </tr> |
---|
239 | <tr> |
---|
240 | <td height="8"> |
---|
241 | <img height="8" src="../Images/Nothing.gif" /> |
---|
242 | </td> |
---|
243 | </tr> |
---|
244 | </table> |
---|
245 | <asp:Panel ID="pnlStudentComment" runat="server"> |
---|
246 | <table width="60%" align="center" border="0"> |
---|
247 | <tr> |
---|
248 | <td align="left"> |
---|
249 | <asp:Label ID="Label13" runat="server" ForeColor="Blue" Width="120px">Student Comments:</asp:Label> |
---|
250 | <asp:Label ID="lblStudentComment" runat="server"></asp:Label><br> |
---|
251 | </td> |
---|
252 | </tr> |
---|
253 | </table> |
---|
254 | </asp:Panel> |
---|
255 | |
---|
256 | </td> |
---|
257 | <td valign="top" align="center" width="7%"> |
---|
258 | <br> |
---|
259 | <a href="#hlSave"> |
---|
260 | <img alt="Click here to go to the bottom of the page." src="../images/down2.gif" |
---|
261 | border="0" /> |
---|
262 | </a> |
---|
263 | </td> |
---|
264 | </tr> |
---|
265 | <tr> |
---|
266 | <td colspan="2"> |
---|
267 | |
---|
268 | </td> |
---|
269 | <td valign="top" align="center" width="7%"> |
---|
270 | <br /> |
---|
271 | <a href="#hltop"> |
---|
272 | <img alt="Click here to go to the top of the page." src="../images/up2.gif" border="0" /> |
---|
273 | </a> |
---|
274 | </td> |
---|
275 | </tr> |
---|
276 | </table> |
---|
277 | <br /> |
---|
278 | <asp:TextBox ID="txtStudent_DBID" runat="server" Visible="False"></asp:TextBox> |
---|
279 | <asp:TextBox ID="txtClass_DBID" runat="server" Visible="False"></asp:TextBox> |
---|
280 | <asp:TextBox ID="txtvlaLesson_DBID" runat="server" Visible="False"></asp:TextBox> |
---|
281 | <!-- The btnViewContent button is here because we are dynamically creating versions of it at runtime. |
---|
282 | We need this here so that the events get wired up correctly. --> |
---|
283 | <asp:Button ID="btnViewContent" runat="server" Text="View Content" Visible="False" /> |
---|
284 | </form> |
---|
285 | |
---|
286 | |
---|
287 | <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> |
---|
288 | <script type="text/javascript"> |
---|
289 | |
---|
290 | $(document).ready(function() { |
---|
291 | |
---|
292 | $('#rblLessonStatusCd_1').click(function() { |
---|
293 | if ($("#rblLessonStatusCd_1").is(':checked')) { |
---|
294 | var isAllowed = ValidateGradingStatus(); |
---|
295 | |
---|
296 | if (isAllowed == false) { |
---|
297 | alert("There are no answers marked for Re-Do. You will not be allowed to 'Save and Post the Grade' unless you mark an answer for Re-Do."); |
---|
298 | } |
---|
299 | } |
---|
300 | }); |
---|
301 | |
---|
302 | $('div').focus(function() { |
---|
303 | var divAreaId = this.id; |
---|
304 | |
---|
305 | // Exclude the Teacher comment at the bottom |
---|
306 | if (divAreaId.startsWith("panel_TeacherCommentdlmtr")) { |
---|
307 | var textControlId = "TeacherCommentdlmtr_" + getUniqueControlNumber(divAreaId); |
---|
308 | |
---|
309 | CKEDITOR.replace(textControlId, { |
---|
310 | toolbar: 'VlaLessonMarksToolbar', |
---|
311 | uiColor: '#eeeeee', |
---|
312 | height: '150px', |
---|
313 | toolbarStartupExpanded: true, |
---|
314 | resize_enabled: true, |
---|
315 | removePlugins: 'elementspath' |
---|
316 | }); |
---|
317 | document.getElementById(divAreaId).style.display = 'none'; |
---|
318 | document.getElementById(divAreaId).style.visibility = 'hidden'; |
---|
319 | } |
---|
320 | }); |
---|
321 | }); |
---|
322 | |
---|
323 | String.prototype.startsWith = function(str) { |
---|
324 | return (this.indexOf(str) === 0); |
---|
325 | } |
---|
326 | |
---|
327 | function getUniqueControlNumber(areaId) { |
---|
328 | var ctlNameParts = areaId.split('_'); |
---|
329 | var uniqueId = ctlNameParts[2]; |
---|
330 | return uniqueId; |
---|
331 | } |
---|
332 | |
---|
333 | function editTeacherComment(ctlName) { |
---|
334 | var ctlNameParts = ctlName.split('_'); |
---|
335 | var ctlCommentId = 'TeacherCommentdlmtr_' + ctlNameParts[2]; |
---|
336 | var ctlPanelCommentId = 'panel_TeacherCommentdlmtr_' + ctlNameParts[2]; |
---|
337 | |
---|
338 | if (isset(CKEDITOR.instances[ctlCommentId])) { |
---|
339 | var editor = CKEDITOR.instances[ctlCommentId]; |
---|
340 | |
---|
341 | document.getElementById(ctlPanelCommentId).style.display = 'none'; |
---|
342 | document.getElementById(ctlPanelCommentId).style.visibility = 'hidden'; |
---|
343 | } |
---|
344 | else { |
---|
345 | |
---|
346 | CKEDITOR.replace(ctlCommentId, { |
---|
347 | toolbar: 'VlaLessonMarksToolbar', |
---|
348 | uiColor: '#eeeeee', |
---|
349 | height: '150px', |
---|
350 | toolbarStartupExpanded: true, |
---|
351 | resize_enabled: true, |
---|
352 | removePlugins: 'elementspath' |
---|
353 | }); |
---|
354 | |
---|
355 | var editor = CKEDITOR.instances[ctlCommentId]; |
---|
356 | |
---|
357 | document.getElementById(ctlPanelCommentId).style.display = 'none'; |
---|
358 | document.getElementById(ctlPanelCommentId).style.visibility = 'hidden'; |
---|
359 | |
---|
360 | } |
---|
361 | |
---|
362 | } |
---|
363 | |
---|
364 | |
---|
365 | function copyStudentAnswer(ctlName) { |
---|
366 | |
---|
367 | var answer = $("#" + ctlName).html(); |
---|
368 | |
---|
369 | if (answer == null) { |
---|
370 | answer = "" |
---|
371 | } |
---|
372 | |
---|
373 | var ctlNameParts = ctlName.split('_'); |
---|
374 | var ctlCommentId = 'TeacherCommentdlmtr_' + ctlNameParts[1]; |
---|
375 | var ctlPanelCommentId = 'panel_TeacherCommentdlmtr_' + ctlNameParts[1]; |
---|
376 | |
---|
377 | var currentDate = new Date(); |
---|
378 | var dateSeperator = "[" + currentDate.toLocaleString() + "]"; |
---|
379 | |
---|
380 | // Read the current teacher comment |
---|
381 | var currentComment = $("#" + ctlPanelCommentId).html(); |
---|
382 | |
---|
383 | // Build the new teacher comment |
---|
384 | var answerCopy = "<span>" + dateSeperator + "</span><br/>" + answer + "<hr/>" + currentComment; |
---|
385 | |
---|
386 | // Is the teacher comment a rich text control |
---|
387 | if (isset(CKEDITOR.instances[ctlCommentId])) { |
---|
388 | var editor = CKEDITOR.instances[ctlCommentId]; |
---|
389 | |
---|
390 | // Append to existing comment |
---|
391 | //var appendComment = answerCopy + "<hr/>" + currentComment; |
---|
392 | |
---|
393 | editor.setData(answerCopy, function() { this.checkDirty(); }); |
---|
394 | |
---|
395 | document.getElementById(ctlPanelCommentId).style.display = 'none'; |
---|
396 | document.getElementById(ctlPanelCommentId).style.visibility = 'hidden'; |
---|
397 | } |
---|
398 | else { |
---|
399 | $("#" + ctlCommentId).val(answerCopy); |
---|
400 | |
---|
401 | CKEDITOR.replace(ctlCommentId, { |
---|
402 | toolbar: 'VlaLessonMarksToolbar', |
---|
403 | uiColor: '#eeeeee', |
---|
404 | height: '150px', |
---|
405 | toolbarStartupExpanded: true, |
---|
406 | resize_enabled: true, |
---|
407 | removePlugins: 'elementspath' |
---|
408 | }); |
---|
409 | |
---|
410 | var editor = CKEDITOR.instances[ctlCommentId]; |
---|
411 | editor.setData(answerCopy, function() { this.checkDirty(); }); |
---|
412 | |
---|
413 | document.getElementById(ctlPanelCommentId).style.display = 'none'; |
---|
414 | document.getElementById(ctlPanelCommentId).style.visibility = 'hidden'; |
---|
415 | |
---|
416 | } |
---|
417 | } |
---|
418 | |
---|
419 | function toggle() { |
---|
420 | $('#pnlFinal').toggle(); |
---|
421 | |
---|
422 | if ($('#showHide').text() == 'Show Calculated Grade') { |
---|
423 | $('#showHide').text('Hide Calculated Grade'); |
---|
424 | var src = $('#imageToggle').attr('src').replace('plus', 'minus'); |
---|
425 | $('#imageToggle').attr('src', src); |
---|
426 | } |
---|
427 | else { |
---|
428 | $('#showHide').text('Show Calculated Grade'); |
---|
429 | var src = $('#imageToggle').attr('src').replace('minus', 'plus'); |
---|
430 | $('#imageToggle').attr('src', src); |
---|
431 | } |
---|
432 | } |
---|
433 | </script> |
---|
434 | |
---|
435 | <script type="text/javascript"> |
---|
436 | //<![CDATA[ |
---|
437 | //]]> |
---|
438 | </script> |
---|
439 | |
---|
440 | <script language="javascript" type="text/javascript"> |
---|
441 | //var AnswerStatusCdIds; |
---|
442 | AnswerStatusCdIds = '<%= AnswerStatusCdIds %>'; |
---|
443 | |
---|
444 | //alert(AnswerStatusCdIds); |
---|
445 | </script> |
---|
446 | |
---|
447 | <script language="JavaScript" type="text/javascript"> |
---|
448 | //<![CDATA[ |
---|
449 | |
---|
450 | var AnswerStatusCdIds; |
---|
451 | |
---|
452 | function doSetFocus() { |
---|
453 | try { |
---|
454 | document.Form1.txt1.focus(); |
---|
455 | } catch (e) { } |
---|
456 | } |
---|
457 | |
---|
458 | function PutPositions() { |
---|
459 | document.Form1.WindowXPos.value = document.body.scrollLeft; |
---|
460 | document.Form1.WindowYPos.value = document.body.scrollTop; |
---|
461 | } |
---|
462 | |
---|
463 | function ScrollWindow() { |
---|
464 | |
---|
465 | if (document.Form1.WindowXPos.value < 0) { |
---|
466 | // We are forcing user to the top - do |
---|
467 | // not scroll |
---|
468 | } |
---|
469 | else { |
---|
470 | window.scrollTo(document.Form1.WindowXPos.value, |
---|
471 | document.Form1.WindowYPos.value); |
---|
472 | } |
---|
473 | } |
---|
474 | |
---|
475 | function goToBottom() { |
---|
476 | dh = document.body.scrollHeight; |
---|
477 | ch = document.body.clientHeight; |
---|
478 | if (dh > ch) { |
---|
479 | moveme = dh - ch; |
---|
480 | window.scrollTo(0, moveme); |
---|
481 | } |
---|
482 | } |
---|
483 | |
---|
484 | function CheckCKEditorLengths(eventTarget, validateReDo) { |
---|
485 | |
---|
486 | var isValid = ValidateCKEditorInput(4000); |
---|
487 | |
---|
488 | if (validateReDo == true) { |
---|
489 | if ($("#rblLessonStatusCd_1").is(':checked')) { |
---|
490 | isValid = ValidateGradingStatus(); |
---|
491 | |
---|
492 | if (isValid == false) { |
---|
493 | alert('You must have at least 1 answer marked for Re-Do if you want to mark the unit to be redone.'); |
---|
494 | } |
---|
495 | } |
---|
496 | } |
---|
497 | |
---|
498 | if (isValid == true) { |
---|
499 | PutPositions(); |
---|
500 | __doPostBackWithFormName('Form1', eventTarget, null); |
---|
501 | } |
---|
502 | else { |
---|
503 | return false; |
---|
504 | } |
---|
505 | } |
---|
506 | |
---|
507 | function ValidateGradingStatus() { |
---|
508 | |
---|
509 | var foundReDoSelected = false; |
---|
510 | |
---|
511 | $('input:radio').each(function() { |
---|
512 | |
---|
513 | // Is this a radio button we care about? |
---|
514 | var uniqueName = this.id; |
---|
515 | var pattern = /AnswerStatusCddlmtr_\d{1,}_\d{1}/; |
---|
516 | |
---|
517 | if (uniqueName.match(pattern)) { |
---|
518 | var idParts = uniqueName.split('_'); |
---|
519 | var status = 0; |
---|
520 | |
---|
521 | // Is this radio button control sequence 2 (Re-Do option)? |
---|
522 | if (idParts[2] == '2') { |
---|
523 | if ($(this).is(':checked')) { |
---|
524 | foundReDoSelected = true; |
---|
525 | } |
---|
526 | } |
---|
527 | } |
---|
528 | }); |
---|
529 | |
---|
530 | if (foundReDoSelected == false) { |
---|
531 | // There are no Re-Do, but are there any ungraded? |
---|
532 | // The presence of 1 ungraded is also valid for Re-Do |
---|
533 | foundReDoSelected = ValidateUnGradedStatus(); |
---|
534 | } |
---|
535 | |
---|
536 | return foundReDoSelected; |
---|
537 | } |
---|
538 | |
---|
539 | function ValidateUnGradedStatus() { |
---|
540 | |
---|
541 | var foundUngradedSelected = false; |
---|
542 | |
---|
543 | $('input:radio').each(function() { |
---|
544 | |
---|
545 | // Is this a radio button we care about? |
---|
546 | var uniqueName = this.id; |
---|
547 | var pattern = /AnswerStatusCddlmtr_\d{1,}_\d{1}/; |
---|
548 | |
---|
549 | if (uniqueName.match(pattern)) { |
---|
550 | var idParts = uniqueName.split('_'); |
---|
551 | var status = 0; |
---|
552 | |
---|
553 | // Is this radio button control sequence 2 (Re-Do option)? |
---|
554 | if (idParts[2] == '4') { |
---|
555 | if ($(this).is(':checked')) { |
---|
556 | foundUngradedSelected = true; |
---|
557 | } |
---|
558 | } |
---|
559 | } |
---|
560 | }); |
---|
561 | |
---|
562 | return foundUngradedSelected; |
---|
563 | } |
---|
564 | |
---|
565 | //]]> |
---|
566 | </script> |
---|
567 | |
---|
568 | <script language="javascript" type="text/javascript"> |
---|
569 | function pop_LessonContent2() { |
---|
570 | window.open("LessonMarks.aspx", "", "resizable=1,scrollbars=1,width=800,height=600"); |
---|
571 | } |
---|
572 | |
---|
573 | </script> |
---|
574 | |
---|
575 | <a name="hlSave" /> |
---|
576 | </body> |
---|
577 | </html> |
---|