Skip to content

Commit cf6ec09

Browse files
committed
Merge branch 'master' of http://github.com/meefik/openITMO
2 parents 78ddfa7 + 3d48d98 commit cf6ec09

File tree

15 files changed

+524
-101
lines changed

15 files changed

+524
-101
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ openITMO
3939

4040
Проект опубликован под лицензией [GPL версии 3](http://www.gnu.org/licenses/gpl-3.0.html) и выше.
4141

42-
Адрес в Интернете: http://open.ifmo.ru/
42+
Адрес в Интернете: http://courses.ifmo.ru/
4343

app/public/courses/CS0001/json/exam.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"id": 1,
1111
"name": "Вопрос 1",
1212
"description": "Выберите один из вариантов ответа. ",
13-
"qtype": "oneSelect",
13+
"qtype": "radio",
1414
"answer" : ["qwe"],
15+
"hint" : "Это подсказка",
1516
"variants": [
1617
{
1718
"variantId": "qwe",
@@ -35,8 +36,9 @@
3536
"id": 2,
3637
"name": "Вопрос 2",
3738
"description": "Ответьте да или нет:",
38-
"qtype": "oneSelect",
39+
"qtype": "radio",
3940
"answer" : ["1q"],
41+
"hint" : "Это подсказка",
4042
"variants": [
4143
{
4244
"variantId": "1q",
@@ -52,8 +54,9 @@
5254
"id": 3,
5355
"name": "Вопрос 3",
5456
"description": "Выберите правильные варианты:",
55-
"qtype": "manySelect",
57+
"qtype": "checkbox",
5658
"answer" : ["1gre", "2reh"],
59+
"hint" : "Это подсказка",
5760
"variants": [
5861
{
5962
"variantId": "1gre",
@@ -82,8 +85,9 @@
8285
"id": 1,
8386
"name": "Вопрос 1",
8487
"description": "Выберите один из вариантов ответа. ",
85-
"qtype": "oneSelect",
88+
"qtype": "radio",
8689
"answer" : ["1"],
90+
"hint" : "Это подсказка",
8791
"variants": [
8892
{
8993
"variantId": "1",
@@ -107,8 +111,9 @@
107111
"id": 2,
108112
"name": "Вопрос 2",
109113
"description": "Ответьте да или нет:",
110-
"qtype": "oneSelect",
114+
"qtype": "radio",
111115
"answer" : ["1"],
116+
"hint" : "Это подсказка",
112117
"variants": [
113118
{
114119
"variantId": "1",
@@ -124,8 +129,9 @@
124129
"id": 3,
125130
"name": "Вопрос 3",
126131
"description": "Выберите правильные варианты:",
127-
"qtype": "manySelect",
132+
"qtype": "checkbox",
128133
"answer" : ["erfdgrehretdh", "erbenet"],
134+
"hint" : "Это подсказка",
129135
"variants": [
130136
{
131137
"variantId": "erfdgrehretdh",
@@ -147,6 +153,7 @@
147153
"description": "Введите 'Правильно':",
148154
"qtype": "text",
149155
"answer" : ["Правильно"],
156+
"hint" : "Это подсказка",
150157
"variants" : [
151158
{
152159
"variantId": "rthrtrtnnh",
@@ -160,6 +167,7 @@
160167
"description": "Восстановите порядок (по возрастанию):",
161168
"qtype": "order",
162169
"answer" : ["2", "4", "3", "1"],
170+
"hint" : "Это подсказка",
163171
"variants" : [
164172
{
165173
"variantId": "1",

app/public/courses/tpl/exam-test.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
<div class="alert alert-error" ng-show="isLate" >
2+
Вы приступаете к тесту после контрольных сроков сдачи, поэтому не получите бонусных баллов в рейтинг!
3+
</div>
4+
15
<div ng-repeat="question in questions" class="well">
6+
<div class="btn-group pull-right">
7+
<a class="btn" data-toggle="dropdown"><span class="caret"></span></a>
8+
<ul class="dropdown-menu">
9+
<li ng-hide="isHintShowed(question)"><a href ng-click="registerHint(question)">Подсказка</a></li>
10+
<li ng-show="isHintShowed(question)" class="disabled"><a>Подсказка дана</a></li>
11+
<li ng-show="isModerator()" ><a href ng-click="edit(question)">Редактировать (не работает)</a></li>
12+
<li ng-show="isModerator()" ><a href ng-click="remove(question)">Удалить</a></li>
13+
</ul>
14+
</div>
215
<h4>{{question.name}}</h4>
316
<p>{{question.description}}</p>
417
<div ng-repeat="item in question.variants" ng-show="isItRadio(question)" >
@@ -20,12 +33,15 @@ <h4>{{question.name}}</h4>
2033
</div>
2134
<div ng-repeat="item in question.variants" ng-show="isItRestoreOrder(question)" >
2235
<label class="question dropdown">
36+
<span style="margin-right: 6px; bottom: 3px; position: relative;">{{$index+1}}.</span>
2337
<select name="{{question.name}}" >
2438
<option disabled/>
2539
<option ng-repeat="item in question.variants" value="{{item.variantId}}">{{item.text}}</option>
2640
</select>
2741
</label>
28-
42+
</div>
43+
<div ng-class="hintClass(question)" class="alert alert-info">
44+
{{question.hint}}
2945
</div>
3046
</div>
3147

app/public/courses/tpl/exam.html

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1-
<div ng-repeat="test in exam" ng-hide="isNotLoggedIn()" class="well well-small">
2-
<h3>{{test.name}}</h3>
3-
<p><i>Крайний срок сдачи: {{test.deadline | dateToText:'date'}}</i></p>
1+
<div ng-repeat="test in exam" ng-hide="isNotLoggedIn()" class="well well-small passed" >
2+
<div class="btn-group pull-right" ng-show="isModerator()">
3+
<a class="btn " data-toggle="dropdown"><span class="caret"></span></a>
4+
<ul class="dropdown-menu">
5+
<li><a href ng-click="edit(test)" >Редактировать</a></li>
6+
<li><a href ng-click="remove(test)" >Удалить</a></li>
7+
</ul>
8+
</div>
9+
10+
<h3>{{test.title}}</h3>
411
<p>{{test.description}}</p>
5-
<a class="btn btn-primary " href ng-click="start(test)">Перейти к тесту</a>
6-
<a class="btn btn-danger" href ng-click="remove(test)" ng-show="isModerator()">Удалить тест</a>
12+
<p><i>Крайний срок сдачи: {{test.deadline | dateToText:'date'}}</i></p>
13+
<div class="container-fluid">
14+
<a class="btn btn-primary pull-left" href ng-click="start(test)"
15+
ng-hide="isExhausted(tries(test)) || isSuccess(test)" >
16+
Перейти к тесту
17+
</a>
18+
<a class="btn btn-success pull-left" href ng-click="start(test)"
19+
ng-hide="isExhausted(tries(test)) || !isSuccess(test)" >
20+
Перейти к тесту
21+
</a>
22+
<a class="btn btn-primary disabled pull-left" href ng-show="isExhausted(tries(test)) && !isSuccess(test)">
23+
Перейти к тесту</a>
24+
<a class="btn btn-success disabled pull-left" href ng-show="isExhausted(tries(test)) && isSuccess(test)" >
25+
Перейти к тесту</a>
26+
<p class="span2" style="margin-top: 5px;">Попыток: <b>{{tries(test)}} / 3</b>.</p>
27+
</div>
728
</div>
829

930
<div style="position: absolute">
@@ -25,7 +46,6 @@ <h3 id="myModalLabel">Тесты загружены</h3>
2546
</div>
2647
</div>
2748
</div>
28-
2949
</div>
3050

3151

app/public/courses/tpl/progress.html

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,58 @@
1-
<table class="table table-striped" ng-show="isLoggedIn()" ng-hide="isNotLoggedIn()">
1+
<style type="text/css">
2+
tbody tr td > div.toolbar {
3+
text-align: left;
4+
display: inline-block;
5+
visibility: hidden;
6+
}
7+
tbody tr:hover td > div.toolbar {
8+
visibility: visible;
9+
}
10+
</style>
11+
12+
<div class="btn-block" ng-show="isModerator()" >
13+
<a class="btn btn-danger" ng-click="deleteAll()">Удалить все</a>
14+
<a class="btn btn-danger inactual" ng-click="deleteInactual()"
15+
title="Удалить только те записи, которые были связаны с удаленными тестами">Удалить неактуальные</a>
16+
</div>
17+
<table class="table table-striped table-hover" ng-show="isLoggedIn()" ng-hide="isNotLoggedIn()">
218
<thead>
319
<tr ng-hide="isModerator()">
420
<td>Тест </td>
521
<td>Баллы</td>
622
<td>Дата </td>
23+
<td></td>
724
</tr>
825
<tr ng-show="isModerator()">
926
<td>Обучающийся</td>
1027
<td>Тест </td>
1128
<td>Баллы</td>
1229
<td>Дата </td>
30+
<td></td>
1331
</tr>
1432
</thead>
1533
<tbody>
1634
<tr ng-hide="isModerator()" ng-repeat="answer in milestones">
17-
<td>{{answer.examId}}</td>
35+
<td>{{answer.title}}</td>
1836
<td>{{answer.score}} </td>
1937
<td>{{answer.date | dateToText}}</td>
38+
<td>
39+
<div class="toolbar">
40+
<a class="button" ng-click="protocol(answer)" title="протокол теста"><i class="icon-list-alt"></i></a>
41+
</div >
42+
</td>
43+
2044
</tr>
2145
<tr ng-show="isModerator()" ng-repeat="answer in milestones">
2246
<td>{{answer.user}} </td>
23-
<td>{{answer.examId}}</td>
47+
<td>{{answer.title}}</td>
2448
<td>{{answer.score}} </td>
2549
<td>{{answer.date | dateToText}}</td>
50+
<td>
51+
<div class="toolbar">
52+
<a class="button" ng-click="protocol(answer)" title="протокол теста"><i class="icon-list-alt"></i></a>
53+
<a class="button" ng-click="del(answer)" title="удалить"><i class="icon-trash"></i></a>
54+
</div>
55+
</td>
2656
</tr>
2757
</tbody>
2858
</table>

app/public/courses/tpl/protocol.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<h3>Протокол теста "{{test.title}}"</h3>
2+
<div id="{{question.id}}" ng-repeat="question in questions" class="well">
3+
<h4>{{question.name}}</h4>
4+
<p>{{question.description}}</p>
5+
<div ng-repeat="item in question.variants" ng-show="isItRadio(question)" >
6+
<label class="question radio">
7+
<input ng-checked="isChecked(question,item)" disabled type="radio" name="{{question.name}}" value="{{item.variantId}}">
8+
{{item.text}}
9+
<i style="margin-left: 10px;" ng-class="icon(question,item)"></i>
10+
</label>
11+
</div>
12+
<div ng-repeat="item in question.variants" ng-show="isItCheckbox(question)" >
13+
<label class="question checkbox">
14+
<input ng-checked="isChecked(question,item)" disabled type="checkbox" name="{{question.name}}" value="{{item.variantId}}" >
15+
{{item.text}}
16+
<i style="margin-left: 10px;" ng-class="icon(question,item)"></i>
17+
</label>
18+
</div>
19+
<div ng-repeat="item in question.variants" ng-show="isItInputText(question)" >
20+
<label class="question input-medium" style="display: inline;">
21+
<input ng-value="setValue(question)" disabled type="text" name="{{question.name}}" >
22+
<i style="margin-left: 10px; margin-top: -1px;" ng-class="icon(question,item)"></i>
23+
</label>
24+
</div>
25+
<div ng-repeat="item in question.variants" ng-show="isItRestoreOrder(question)" >
26+
<label class="question dropdown">
27+
<span id="{{item._id}}" style="margin-right: 6px; bottom: 3px; position: relative;">{{$index+1}}.</span>
28+
<select ng-value="setValue(question)" disabled name="{{question.name}}" >
29+
<option disabled/>
30+
<option ng-repeat="item in question.variants" value="{{item.variantId}}">{{item.text}}</option>
31+
</select>
32+
<i style="margin-left: 10px;" ng-class="icon(question,item)"></i>
33+
</label>
34+
</div>
35+
<div ng-class="hintClass(question)" class="alert alert-info">
36+
{{question.hint}}
37+
</div>
38+
</div>
39+
<div style="text-align: center">
40+
<a class="btn btn-inverse" ng-click="back()">
41+
Закрыть протокол
42+
</a>
43+
</div>
44+
45+
<div style="padding-bottom: 1em;"></div>

app/public/js/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ angular.module('openITMO', ['ngCookies', 'app.services', 'app.filters', 'app.dir
2222
when('/courses/:courseId/forum/:topicId', { templateUrl: 'tpl/parts.html', controller: ForumPostsCtrl, reloadOnSearch: false }).
2323
when('/courses/:courseId/shelf', { templateUrl: 'tpl/parts.html', controller: ShelfCtrl }).
2424
when('/courses/:courseId/progress', { templateUrl: 'tpl/parts.html', controller: ProgressCtrl }).
25+
when('/courses/:courseId/progress/:examId/:answerId', { templateUrl: 'tpl/parts.html', controller: ProtocolCtrl }).
2526
when('/courses/:courseId/ontology', { templateUrl: 'tpl/parts.html', controller: OntologyCtrl }).
2627
when('/courses/:courseId/video/:videoId', { templateUrl: 'tpl/parts.html', controller: VideoCtrl }).
2728
otherwise({ redirectTo: '/' });

0 commit comments

Comments
 (0)