根据用户偏好更新视图

时间:2018-01-09 18:01:39

标签: javascript json

我在学校网络项目上工作,我正在尝试根据学生在特定级别的注册课程显示一个讲座时间表,提供全面的时间表(所有不同级别的科目的时间表)并保存在管理员的timetable.json文件中。如何选择特定级别的特定学生的科目和出现的各个时期。

#timetable.json file

{
    "mon":{
        "1":["EEE104","","","",""],
        "2":["","EEE101","","",""],
        "3":["","","","","",""],
        "4":["","","","",""],
        "5":["","","","",""]
    },"tue":{
        "1":["","","","",""],
        "2":["","","","",""],
        "3":["","","","",""],
        "4":["","","","",""],
        "5":["","","","",""]
    },"wed":{
        "1":["","","","",""],
        "2":["","","","",""],
        "3":["","","","",""],
        "4":["","","","",""],
        "5":["","","","",""]
    },"thu":{
        "1":["","","","",""],
        "2":["","","","",""],
        "3":["","","","",""],
        "4":["","","","",""],
        "5":["","","","",""]
    },"fri":{
        "1":["","","","",""],
        "2":["","","","",""],
        "3":["","","","",""],
        "4":["","","","",""],
        "5":["","","","",""]
    }
}

在上面的文件中,缩写的工作日(“mon”,“tue”,...“fri”)代表一周中的各种日子,而数字(“1”,“2”,“3” “......”5“)代表 各个时期。

我正在考虑为学生创建一个单独的json文件,测试timetable.json文件中的每个值并查看是否存在主题,然后将其添加到student json文件中。 我觉得我的实现要求太高,有没有更优雅的方式来做这件事,我只需要指针,框架或任何想法。

0 个答案:

没有答案