我正在尝试进行一项测验,该测验使用同一页面上的动态更新来计算10分以内的分数。
对于每个分数,我希望程序根据他们的得分加载不同的网页。
例如,如果得分为:
1 = Endscreen1.html
2 = Endscreen2.html
3 = Endscreen3.html
4 = Endscreen4.html
5 = Endscreen5.html
6 = Endscreen6.html
我在下面有这个代码,根据10分的分数,我需要做些什么才能启动不同的页面?
function showScores() {
var gameOverHtml = "<h1>Result</h1>";
gameOverHtml += "<h2 id='score'> Your score, click the score button below to guide patient: " + quiz.score + "</h2>";
var element = document.getElementById("quiz");
element.innerHTML = gameOverHtml;
};
答案 0 :(得分:0)
此功能需要放在标题标记内。
structure = parser.get_structure('mainc', f)
number_a = []
number_b = []
coord_a = []
coord_b = []
am_a_chain=list(structure.get_chains())
chain_a = am_a_chain[0]
chain_b = am_a_chain[1]
for residue_a in chain_a:
for residue_b in chain_b:
for atom_a in residue_a:
for atom_b in residue_b:
if (np.linalg.norm(atom_a - atom_b)) <= 3.5 \
and (residue_a.get_resname() == "ALA" and atom_a.get_name() == "O" and residue_b.get_resname() == "LEU" and atom_b.get_name() == "N") \
or (residue_a.get_resname() == "ALA" and atom_a.get_name() == "N" and residue_b.get_resname() == "LEU" and atom_b.get_name() == "O"):
number_a.append(atom_a)
number_b.append(atom_b)
coord_a.append(atom_a.serial_number)
coord_b.append(atom_b.serial_number)
else:
break
您可以在showScores()函数中调用函数redirect()