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