diff --git a/resources/teacherTools/classManager.jsp b/resources/teacherTools/classManager.jsp index 1176a614..8556ce8d 100644 --- a/resources/teacherTools/classManager.jsp +++ b/resources/teacherTools/classManager.jsp @@ -58,7 +58,7 @@ - <%@ page contentType="text/html;charset=UTF-8" language="java" %> @@ -72,7 +72,7 @@ <%@ page import="java.sql.Connection"%> <%@ page import="edu.umass.ckc.wo.ttmain.ttservice.util.TeacherLogger"%> -<% +<% ResourceBundle versions = null; try { @@ -354,7 +354,12 @@ System.out.println("msHost = " + msHost + msContext); * Frank 12-02-20 Issue #322 added currentSelection to classReportCard URL */ - + var isCluster = 0; + var hasClusters = 0; + var classColor = ""; + var titleClassName = ""; + var moveStudentId = ""; + //Report1 Variables var perProblemSetReport; var perProblemSetLevelOne; @@ -387,7 +392,7 @@ var studentData; var surveyStudentTable; var surveyQuestionTable; var apply_content_table; -var filterLandingOne = "~7"; +var filterLandingOne = "7"; var filterLandingTwo = "~0"; var activeProblemSet; @@ -444,17 +449,19 @@ function getFilterLandingOne() { else { daysLandingOne = "" + nDays; } - filterLandingOne = daysLandingOne; + filterLandingOne = daysLandingOne + '~' + classesInCluster; } function getFilterLandingTwo() { - - + var d1 = parseInt(document.getElementById("selectDay_cal2").value); var d2 = parseInt(document.getElementById("selectDay").value); var m1 = parseInt(document.getElementById("month_cal2").value) + 1; var m2 = parseInt(document.getElementById("month").value) + 1; + + document.getElementById("year_cal2").value = "2023"; + document.getElementById("year").value = "2023"; if ((d1 > 0) && (d2 > 0)) { $('#calendarModalPopup').modal('hide'); @@ -508,17 +515,27 @@ function getFilterLandingTwo() { } } -var teacherClassSelections = ""; + +function moveToDestination(id, isCluster) { + + var splitter = id.split(','); + if(splitter[1] == "0") { + moveThisStudent(splitter[0]); + } + else { + moveThisStudent(splitter[0]); + } +} function moveThisStudent(id) { - var newClassId = document.getElementById('moveBtn').value; + var newClassId = id; $('#student_info_out').find('.loader').show(); $.ajax({ type : "POST", url :pgContext+"/tt/tt/changeStudentClass", data : { - studentId:id, + studentId: moveStudentId, newClassId: newClassId, lang: loc }, @@ -534,6 +551,7 @@ function moveThisStudent(id) { $("#successMsgModelPopup").find("[class*='modal-body']").html("<%= rb.getString("student_class_changed")%>"); $('#successMsgModelPopup').modal('show'); } + $("#clusterList").hide(); }, error : function(e) { console.log(e); @@ -541,39 +559,6 @@ function moveThisStudent(id) { }); } - - -function selectTeacherClass(myClassId) { - - - - var txtClassId = "" + myClassId; - for (var i=0; i < classChoices.length; i++) { - var splitter = classChoices[i].split(','); - if (splitter[2] === txtClassId) { - document.getElementById('moveBtn').value = splitter[2]; - document.getElementById('moveBtn').innerHTML = '<%= rb.getString("move_this_student_to")%>: ' + splitter[1]; - break; - } - } - - $("#moveBtn").show(); -} - -var classChoices = []; - -function addToTeacherList(item, index) { - - var titem = "" + item; - var tlist = titem.split(","); - - if (tlist[2] != classID) { - classChoices.push(titem); - teacherClassSelections = teacherClassSelections + ""; - } -} - - function logTeacherEvent(action,activityName) { $.ajax({ @@ -647,9 +632,47 @@ function userPrefixLookup() { } +function startClusterLoader() { + + $('#createClusterLoader').show(); +} +function cloneCurrentClass() { + +// CreateClassForm createForm = null; + + $('#clone_class_out').find('.loader').show(); + $.ajax({ + type: "POST", + url: pgContext + "/tt/ttCloneClass", + data: { + classId: classId + }, + success: function (data) { + $('#clone_class_out').find('.loader').hide(); + + if (response.includes("***")) { + $("#errorMsgModelPopup").find("[class*='modal-body']").html( response ); + $('#errorMsgModelPopup').modal('show'); + }else{ + if (teacherLoginType === "Normal") { + logTeacherEvent("createdClassCluster",""); + } + $("#successMsgModelPopup").find("[class*='modal-body']").html("Created Class Cluster"); + $('#successMsgModelPopup').modal('show'); + } + + } + , + error : function(e) { + alert("error"); + console.log(e); + } + }); +} + function verifyProbMinMax() { @@ -781,6 +804,7 @@ var liveDashboardTotal = 0; function liveDashboardPopulate() { + var liveDashboardFilter = "ProblemsSolved" + "~" + classesInCluster; $.ajax({ type : "POST", url : pgContext+"/tt/tt/getTeacherReports", @@ -789,7 +813,7 @@ function liveDashboardPopulate() { teacherId: teacherID, reportType: 'classLiveDashboard', lang: loc, - filter: "ProblemsSolved" + filter: liveDashboardFilter }, success : function(data) { @@ -1279,9 +1303,9 @@ function problemDetails(data, response) { } }); - var selector = "#"+JSONData["problemLevelId"]+"_handler"; + var saveselector = "#"+JSONData["problemLevelId"]+"_full_save_handler"; - $(document.body).on('click', selector ,function(){ + $(document.body).on('click', saveselector ,function(){ var rows = $("#"+JSONData["problemLevelId"]).dataTable( { "bPaginate": false, <%=jc_rb.getString("language_text")%> @@ -1326,7 +1350,121 @@ function problemDetails(data, response) { }); + var closeSelector = "#"+JSONData["problemLevelId"]+"_full_close_handler"; + + $(document.body).on('click', closeSelector ,function(){ + var newlocation = pgContext+'/tt/tt/viewClassDetails?classId='+classID+'¤tSelection=reorg_prob_sets_handler'; + $(location).attr('href', newlocation); + + + }); + + + + var selectallSelector = "#"+JSONData["problemLevelId"]+"_full_selectall_handler"; + + $(document.body).on('click', selectallSelector ,function(){ + var rows = $("#"+JSONData["problemLevelId"]).dataTable( + { "bPaginate": false, + <%=jc_rb.getString("language_text")%> + "bFilter": false, + "bLengthChange": false, + rowReorder: false, + "bSort": false + + + }).fnGetNodes(); + + var problemIds = [""]; + + $('#problem_set_content').find('.loader').show(); + $.ajax({ + type : "POST", + url :pgContext+"/tt/tt/saveChangesForProblemSet", + data : { + problemIds: problemIds, + classid: classID, + problemsetId: JSONData["problemLevelId"] + }, + success : function(response) { + $('#problem_set_content').find('.loader').hide(); + if (response.includes("***")) { + $("#errorMsgModelPopup").find("[class*='modal-body']").html( response ); + $('#errorMsgModelPopup').modal('show'); + }else{ + $("#successMsgModelPopupForProblemSets").find("[class*='modal-body']").html( "<%= rb.getString("content_changes_saved")%>" ); + $('#successMsgModelPopupForProblemSets').modal('show'); + } + } + }); + + }); + + + var deselectallSelector = "#"+JSONData["problemLevelId"]+"_full_deselectall_handler"; + + $(document.body).on('click', deselectallSelector ,function(){ + var rows = $("#"+JSONData["problemLevelId"]).dataTable( + { "bPaginate": false, + <%=jc_rb.getString("language_text")%> + "bFilter": false, + "bLengthChange": false, + rowReorder: false, + "bSort": false + + + }).fnGetNodes(); + + var j=0; + var rowsArray = []; + var problemIds = [""]; + + var i = 0; + + $("input:checkbox:not(:checked)", rows).each(function(){ + rowsArray[i] = $(this).closest('tr'); + i++; + }); + + $("input:checkbox:checked", rows).each(function(){ + rowsArray[i] = $(this).closest('tr'); + i++; + }); + + for(j=0; j < rowsArray.length; j++) + problemIds [j] = $("#"+JSONData["problemLevelId"]).DataTable().row( rowsArray [j] ).data()[1]; + + + $('#problem_set_content').find('.loader').show(); + $.ajax({ + type : "POST", + url :pgContext+"/tt/tt/saveChangesForProblemSet", + data : { + problemIds: problemIds, + classid: classID, + problemsetId: JSONData["problemLevelId"] + }, + success : function(response) { + $('#problem_set_content').find('.loader').hide(); + if (response.includes("***")) { + $("#errorMsgModelPopup").find("[class*='modal-body']").html( response ); + $('#errorMsgModelPopup').modal('show'); + }else{ + $("#successMsgModelPopupForProblemSets").find("[class*='modal-body']").html( "<%= rb.getString("content_changes_saved")%>" ); + $('#successMsgModelPopupForProblemSets').modal('show'); + } + } + }); + + }); + + + + var save_selections = "<%= rb.getString("save_selections")%>"; +var close_selections = "<%= rb.getString("close_cancel")%>"; +var activate_save_all = "<%= rb.getString("activate_save_all")%>"; +var deactivate_save_all = "<%= rb.getString("deactivate_save_all")%>"; var higherlevelDetailp1="<%= rb.getString("problem_set")%>"; var higherlevelDetailp2="<%= rb.getString("standards_covered_in_problemset")%>"; var higherlevelDetailp3="<%= rb.getString("student_will_see_selected_problems")%>"; @@ -1336,7 +1474,13 @@ var higherlevelDetail = "
"+higherlevelDetailp2+": " + html + "
" + "
"+summaryLabel+": " + JSONData["topicSummary"] + "
"+ "
"+higherlevelDetailp3+"
"+ - "
"; + "
"+ + "  "+ + "  "+ + "  "+ + "  "+ + "
"+ + ""; return higherlevelDetail + problemLevelDetails(JSONData,problems); @@ -1579,6 +1723,17 @@ function standardsProblemDetails(data, response, state) { }); + var closeSelector = "#"+JSONData["problemLevelId"]+"_close_handler"; + + $(document.body).on('click', closeSelector ,function(){ + var newlocation = pgContext+'/tt/tt/viewClassDetails?classId='+classID+'¤tSelection=reorg_prob_sets_handler'; + $(location).attr('href', newlocation); + + + }); + + + var selectallSelector = "#"+JSONData["problemLevelId"]+"_selectall_handler"; $(document.body).on('click', selectallSelector ,function(){ @@ -1678,6 +1833,7 @@ function standardsProblemDetails(data, response, state) { var save_selections = "<%= rb.getString("save_selections")%>"; + var close_selections = "<%= rb.getString("close_cancel")%>"; var activate_save_all = "<%= rb.getString("activate_save_all")%>"; var deactivate_save_all = "<%= rb.getString("deactivate_save_all")%>"; var higherlevelDetailp1="<%= rb.getString("problem_set")%>"; @@ -1692,7 +1848,8 @@ function standardsProblemDetails(data, response, state) { "
"+ "  "+ "  "+ - "  "+ + "  "+ + "  "+ "
"+ ""; @@ -1707,6 +1864,7 @@ function standardsProblemLevelDetails(JSONData,problems, selectedStd){ $.each(problems, function (i, obj) { var foundStandard = false; var html = ""; + var flash = ""; var checkBox = ""; var flashWindow = "'" + JSONData["uri"]+"?questionNum="+obj.problemNo + "'" + attri ; @@ -1885,7 +2043,15 @@ function handleclickHandlers() { message: '<%= rb.getString("emsg_minTime")%>' } } + }, + color: { + validators: { + notEmpty: { + message: '<%= rb.getString("emsg_class_color") %>' + } + } } + } }).on('success.form.bv', function (e) { $("#edit_class_form").data('bootstrapValidator').resetForm(); @@ -1896,11 +2062,43 @@ function handleclickHandlers() { }) }); + + $("#clone_class_form").bootstrapValidator({ + // To use feedback icons, ensure that you use Bootstrap v3.1.0 or later + feedbackIcons: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, + fields: { + className: { + validators: { + notEmpty: { + message: '<%= rb.getString("emsg_className")%>' + }, + regexp: { + regexp: /^[a-zA-Z0-9 _\-\.]+$/, + message: '<%= rb.getString("emsg_field_invalid")%>' + } + } + } + } + }).on('success.form.bv', function (e) { + $("#clone_class_form").data('bootstrapValidator').resetForm(); + e.preventDefault(); + var $form = $(e.target); + var bv = $form.data('bootstrapValidator'); + $.post($form.attr('action'), $form.serialize(), function (result) { + }) + }); + + $("#classHomePage").click(function () { $('#reorg_prob_sets_handler').css('color', '#ffffff'); $("#content-conatiner").children().hide(); - - $("#splash_page").show(); + if (isCluster == 0) { + $("#splash_page").show(); + } }); $("#reorg_prob_sets_handler").click(function () { @@ -1977,10 +2175,31 @@ function handleclickHandlers() { $("#cancelClassProfileBtn").click(function () { $('#reorg_prob_sets_handler').css('color', '#ffffff'); $("#content-conatiner").children().hide(); - $("#splash_page").show(); + if (isCluster == 0) { + $("#splash_page").show(); + } }); + $("#clone_class_handler").click(function () { + $('#reorg_prob_sets_handler').css('background-color', ''); + $('#reorg_prob_sets_handler').css('color', '#dddddd'); + $("#content-conatiner").children().hide(); + + $("#clone_class_out").show(); + }); + + $("#cancelCloneClassBtn").click(function () { + $('#reorg_prob_sets_handler').css('color', '#ffffff'); + $("#content-conatiner").children().hide(); + if (isCluster == 0) { + $("#splash_page").show(); + } + }); + + + + $('#activateProbSetTable input[type="checkbox"]').click(function () { if ($('#activateProbSetTable input[type="checkbox"]:checked').size()) { $('#deactivateProblemSets').prop('disabled', false); @@ -2114,13 +2333,13 @@ function handleclickHandlers() { function changeLandingPageHeaderAccordingToLanguage(){ - var header = {'sid': '<%= rb.getString("student_id")%>','sname': '<%= rb.getString("student_name")%>','uname': '<%= rb.getString("username")%>','problems': '<%= rb.getString("problems_solved")%>','timeInMS': '<%= rb.getString("time_solving_problems")%>','latestLogin': '<%= rb.getString("problems_solved")%>','timeInMS': '<%= rb.getString("most_recent_login")%>'}; + var header = {'sid': '<%= rb.getString("student_id")%>','sname': '<%= rb.getString("student_name")%>','uname': '<%= rb.getString("username")%>','problems': '<%= rb.getString("problems_solved")%>','timeInMS': '<%= rb.getString("time_solving_problems")%>','latestLogin': '<%= rb.getString("most_recent_login")%>'}; return header; } function changeLandingPageHeader2AccordingToLanguage(){ - var header = {'sid': '<%= rb.getString("student_id")%>','sname': '<%= rb.getString("student_name")%>','uname': '<%= rb.getString("username")%>','problems': '<%= rb.getString("problems_solved")%>','timeInMS': '<%= rb.getString("time_solving_problems")%>','latestLogin': '<%= rb.getString("problems_solved")%>','timeInMS': '<%= rb.getString("most_recent_login")%>'}; + var header = {'sid': '<%= rb.getString("student_id")%>','sname': '<%= rb.getString("student_name")%>','uname': '<%= rb.getString("username")%>','problems': '<%= rb.getString("problems_solved")%>','timeInMS': '<%= rb.getString("time_solving_problems")%>','latestLogin': '<%= rb.getString("most_recent_login")%>'}; return header; } @@ -2994,8 +3213,14 @@ function registerAllEvents(){ var sessionID = "0"; var prePostIds = '${prepostIds}'.split("~~"); var problem_imageURL = '${webContentpath}'+'problemSnapshots/prob_'; + var classesInCluster = ""; $(document).ready(function () { + classesInCluster = '${classInfo.classesInCluster}'; + hasClusters = parseInt('${classInfo.hasClusters}'); + isCluster = parseInt('${classInfo.isCluster}'); + classColor = '${classInfo.color}'; + className = '${classInfo.name}'; var classGrade = parseInt('${classInfo.grade}'); var simpleLowDiff = '${classInfo.simpleLowDiff}'; simpleLowDiff = simpleLowDiff.replace('below',""); @@ -3014,12 +3239,33 @@ function registerAllEvents(){ registerAllEvents(); handleclickHandlers(); + if (isCluster == 1) { + document.getElementById("li_classHomePage").style.display = 'none'; + document.getElementById("li_classReportCard").style.display = 'none'; + document.getElementById("li_manage_roster").style.display = 'none'; + document.getElementById("li_manage_class").style.display = 'none'; + document.getElementById("li_live_garden").style.display = 'none'; + document.getElementById("li_live_dashboard").style.display = 'none'; + document.getElementById("li_teacher_feedback").style.display = 'none'; + document.getElementById("li_clone_class").style.display = 'none'; + document.getElementById("li_apply_content").style.display = 'none'; + } + + $("#content-conatiner").children().hide(); if (currentSelection == "classHomePage") { + var titleClassname = ""; + if (isCluster == 0) { + titleClassname = 'home-title-' + '${classInfo.color}'; + } + else { + titleClassname = 'home-title-' + '${classInfo.color}' + '-cluster'; + } $("#splash_page").show(); $('#landing-report-loader').show(); $("#classLandingReportOne").collapse('show'); + document.getElementById("titleLine").innerHTML = '<%= rb.getString("home_page_for_class") %>:   ${classInfo.name}  '; } else if (currentSelection == "reorg_prob_sets_handler") { $('#reorg_prob_sets_handler').click(); @@ -3112,42 +3358,53 @@ function registerAllEvents(){ @@ -3262,37 +3571,39 @@ function registerAllEvents(){ /tt/tt/ttMain"> <%= rb.getString("home") %> -
  • +
  • <%= rb.getString("class_home") %>
  • -
  • /tt/tt/viewClassReportCard?classId=${classInfo.classid}¤tSelection=classReportCard" id="report_card"> <%= rb.getString("class_report_card") %>
  • - -
  • <%= rb.getString("manage_problem_sets") %>
  • +
  • /tt/tt/viewClassReportCard?classId=${classInfo.classid}¤tSelection=classReportCard" id="report_card"> <%= rb.getString("class_report_card") %>
  • + -
  • <%= rb.getString("manage_class_roster") %>
  • +
  • <%= rb.getString("manage_problem_sets") %>
  • -
  • <%= rb.getString("manage_student_info") %>
  • +
  • <%= rb.getString("manage_class_roster") %>
  • -
  • <%= rb.getString("manage_class") %>
  • +
  • <%= rb.getString("manage_student_info") %>
  • +
  • <%= rb.getString("manage_class") %>
  • +
  • <%= rb.getString("survey_settings") %>
  • -
  • <%= rb.getString("apply_class_content") %>
  • +
  • <%= rb.getString("apply_class_content") %>
  • -
  • <%= rb.getString("live_dashboard") %>
  • +
  • <%= rb.getString("live_dashboard") %>
  • -
  • <%= rb.getString("class_garden") %>
  • -
  • - <%= rb.getString("send_us_feedback") %> -
  • - +
  • <%= rb.getString("class_garden") %>
  • + +
  • <%= rb.getString("send_us_feedback") %>
  • + +
  • <%= rb.getString("create_class_cluster") %>
  • +
    -

    - <%= rb.getString("home_page_for_class") %>: ${classInfo.name} +

    +

    @@ -3797,6 +4108,84 @@ function registerAllEvents(){
    + + + @@ -3870,6 +4259,22 @@ function registerAllEvents(){ + +
    + +
    + + + <%= rb.getString("select_color_scheme") %> + <%= rb.getString("green") %> + <%= rb.getString("blue") %> + <%= rb.getString("red") %> + <%= rb.getString("violet") %> + <%= rb.getString("yellow") %> + +
    @@ -3921,7 +4326,7 @@ function registerAllEvents(){ + name="highEndDiff" value="${classInfo.simpleHighDiff}"> <%= rb.getString("select_complexity") %> <%= rb.getString("three_grades_above") %> <%= rb.getString("two_grades_above") %> @@ -4241,6 +4646,7 @@ function registerAllEvents(){ + @@ -4280,6 +4686,7 @@ function registerAllEvents(){ +