|
|
@ -3,17 +3,24 @@
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
$("#RSide").removeAttr("id");
|
|
|
|
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
|
|
|
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
|
$("#Container").css("width","1000px");
|
|
|
|
var time = <%=exercise.time %>;
|
|
|
|
/*start_time = new Date();
|
|
|
|
var total_seconds = time * 60;
|
|
|
|
start_time.setFullYear(<%#=exercise_user.start_at.year%>);
|
|
|
|
getTime(total_seconds);
|
|
|
|
start_time.setMonth(<%#=exercise_user.start_at.month%>);
|
|
|
|
|
|
|
|
start_time.setDate(<%#=exercise_user.start_at.day%>);
|
|
|
|
|
|
|
|
start_time.setHours(<%#=exercise_user.start_at.hour%>);
|
|
|
|
|
|
|
|
start_time.setMinutes(<%#=exercise_user.start_at.min%>);
|
|
|
|
|
|
|
|
start_time.setSeconds(<%#=exercise_user.start_at.sec%>);
|
|
|
|
|
|
|
|
//alert(start_time);
|
|
|
|
|
|
|
|
end_time = start_time.getTime() + 1000*60*<%#=exercise.time %>;
|
|
|
|
|
|
|
|
getTime(end_time);*/
|
|
|
|
});
|
|
|
|
});
|
|
|
|
function getTime(total_seconds) {
|
|
|
|
function getTime(end_time) {
|
|
|
|
start_time = new Date($("#start_time").html());
|
|
|
|
//alert(end_time);
|
|
|
|
end_time = start_time + 60*60*<%=exercise.time %>;
|
|
|
|
|
|
|
|
now = new Date();
|
|
|
|
now = new Date();
|
|
|
|
|
|
|
|
var total_seconds = (now.getTime() - end_time)/1000;
|
|
|
|
//start = new Date(start_time);
|
|
|
|
//start = new Date(start_time);
|
|
|
|
//end_time = start_time;
|
|
|
|
//end_time = start_time;
|
|
|
|
var total_seconds = total_seconds - 1;
|
|
|
|
//var total_seconds = total_seconds - 1;
|
|
|
|
var hours = total_seconds / 60 / 60;
|
|
|
|
var hours = total_seconds / 60 / 60;
|
|
|
|
var hoursRound = Math.floor(hours);
|
|
|
|
var hoursRound = Math.floor(hours);
|
|
|
|
var minutes = total_seconds /60 - (60 * hoursRound);
|
|
|
|
var minutes = total_seconds /60 - (60 * hoursRound);
|
|
|
@ -23,9 +30,9 @@
|
|
|
|
$("#rest_hours").html(hoursRound);
|
|
|
|
$("#rest_hours").html(hoursRound);
|
|
|
|
$("#rest_minutes").html(minutesRound);
|
|
|
|
$("#rest_minutes").html(minutesRound);
|
|
|
|
$("#rest_seconds").html(secondsRound);
|
|
|
|
$("#rest_seconds").html(secondsRound);
|
|
|
|
if(total_seconds >0) {
|
|
|
|
//if(total_seconds >0) {
|
|
|
|
setTimeout("getTime("+total_seconds+");", 1000);
|
|
|
|
setTimeout("getTime("+end_time+");", 1000);
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<div class="homepageRight mt0 ml10">
|
|
|
|
<div class="homepageRight mt0 ml10">
|
|
|
@ -36,7 +43,9 @@
|
|
|
|
<div class="fontGrey2">
|
|
|
|
<div class="fontGrey2">
|
|
|
|
<span class="mr130">开始时间:<%=format_time(exercise_user.start_at.to_s)%></span>
|
|
|
|
<span class="mr130">开始时间:<%=format_time(exercise_user.start_at.to_s)%></span>
|
|
|
|
<span class="mr130">测验时长:<%=exercise.time %>分钟</span>
|
|
|
|
<span class="mr130">测验时长:<%=exercise.time %>分钟</span>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
<span class="fr">剩余时长:<span class="c_red" id="rest_hours"></span> 小时 <span class="c_red" id="rest_minutes"></span> 分钟 <span class="c_red" id="rest_seconds"></span> 秒</span>
|
|
|
|
<span class="fr">剩余时长:<span class="c_red" id="rest_hours"></span> 小时 <span class="c_red" id="rest_minutes"></span> 分钟 <span class="c_red" id="rest_seconds"></span> 秒</span>
|
|
|
|
|
|
|
|
-->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="testDesEdit mt5"><%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%></div>
|
|
|
|
<div class="testDesEdit mt5"><%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|