Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
b6cdd175
Commit
b6cdd175
authored
Jun 23, 2015
by
Victor Yacovlev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-uploaded newer files after GIT/TeamCity error
parent
dd02e92b
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
87 additions
and
85 deletions
+87
-85
share/kumir2/courses/practicum/Fields/12_1_1.fil
share/kumir2/courses/practicum/Fields/12_1_1.fil
+1
-2
share/kumir2/courses/practicum/Fields/7_3_1.fil
share/kumir2/courses/practicum/Fields/7_3_1.fil
+20
-44
share/kumir2/courses/practicum/Fields/labirint2.fil
share/kumir2/courses/practicum/Fields/labirint2.fil
+1
-1
share/kumir2/courses/practicum/Texts/alg1.kum
share/kumir2/courses/practicum/Texts/alg1.kum
+1
-1
share/kumir2/courses/practicum/Texts/file_med.kum
share/kumir2/courses/practicum/Texts/file_med.kum
+5
-5
share/kumir2/courses/practicum/Texts/file_summa.kum
share/kumir2/courses/practicum/Texts/file_summa.kum
+1
-1
src/actors/robot/robotmodule.cpp
src/actors/robot/robotmodule.cpp
+5
-4
src/actors/robot/robotmodule.h
src/actors/robot/robotmodule.h
+3
-2
src/actors/vodoley/vodoleymodule.cpp
src/actors/vodoley/vodoleymodule.cpp
+1
-0
src/plugins/coursemanager/course_model.h
src/plugins/coursemanager/course_model.h
+1
-0
src/plugins/coursemanager/coursemanager_plugin.cpp
src/plugins/coursemanager/coursemanager_plugin.cpp
+1
-1
src/plugins/coursemanager/task/mainwindow.cpp
src/plugins/coursemanager/task/mainwindow.cpp
+32
-3
src/plugins/coursemanager/task/mainwindow.h
src/plugins/coursemanager/task/mainwindow.h
+1
-1
src/plugins/coursemanager/task/mainwindow.ui
src/plugins/coursemanager/task/mainwindow.ui
+10
-9
src/tools/courseeditor/mainwindow.cpp
src/tools/courseeditor/mainwindow.cpp
+1
-11
src/tools/courseeditor/mainwindow.h
src/tools/courseeditor/mainwindow.h
+3
-0
No files found.
share/kumir2/courses/practicum/Fields/12_1_1.fil
View file @
b6cdd175
...
...
@@ -9,7 +9,6 @@
3 0 0 0 0.000000 0.000000 4 $ 1
4 0 0 0 0.000000 0.000000 5 $ 1
5 0 0 0 0.000000 0.000000 6 $ 1
6 0 0 0 0.000000 0.000000 7
$
6 0 0 0 0.000000 0.000000 7
Б
7 0 0 0 0.000000 0.000000 8 $
8 0 0 0 0.000000 0.000000 $ Б
; End Of File
share/kumir2/courses/practicum/Fields/7_3_1.fil
View file @
b6cdd175
; Field Size: x, y
8 7
6 5
; Robot position: x, y
0 0
; A set of special Fields: x, y, Wall, Color, Radiation, Temperature, Symbol, Symbol1, Point
...
...
@@ -8,53 +8,29 @@
2 0 0 0 0.000000 0.000000 $ $ 1
3 0 0 0 0.000000 0.000000 $ $ 1
4 0 0 0 0.000000 0.000000 $ $ 1
5 0 0 0 0.000000 0.000000 $ $ 1
6 0 0 0 0.000000 0.000000 $ $ 1
7 0 0 0 0.000000 0.000000 $ Б
5 0 0 0 0.000000 0.000000 $ Б 1
0 1 0 0 0.000000 0.000000 $ $ 1
1 1 1 0 0.000000 0.000000 $ $ 1
2 1 1 0 0.000000 0.000000 $ $ 1
3 1 1 0 0.000000 0.000000 $ $ 1
4 1 3 0 0.000000 0.000000 $ $ 1
5 1 2 0 0.000000 0.000000 $ $ 1
6 1 2 0 0.000000 0.000000 $ $ 1
7 1 8 0 0.000000 0.000000 $ $
0 2 2 0 0.000000 0.000000 $ $ 1
1 2 2 0 0.000000 0.000000 $ $ 1
2 2 2 0 0.000000 0.000000 $ $ 1
3 2 0 0 0.000000 0.000000 $ $ 1
4 2 3 0 0.000000 0.000000 $ $ 1
5 2 0 0 0.000000 0.000000 $ $ 1
6 2 3 0 0.000000 0.000000 $ $ 1
3 1 3 0 0.000000 0.000000 $ $ 1
4 1 0 0 0.000000 0.000000 $ $ 1
5 1 9 0 0.000000 0.000000 $ $
0 2 0 0 0.000000 0.000000 $ $ 1
1 2 3 0 0.000000 0.000000 $ $ 1
2 2 0 0 0.000000 0.000000 $ $ 1
3 2 1 0 0.000000 0.000000 $ $ 1
4 2 1 0 0.000000 0.000000 $ $ 1
5 2 1 0 0.000000 0.000000 $ $
0 3 2 0 0.000000 0.000000 $ $ 1
1 3 0 0 0.000000 0.000000 $ $ 1
2 3 3 0 0.000000 0.000000 $ $ 1
3 3 0 0 0.000000 0.000000 $ $ 1
4 3 3 0 0.000000 0.000000 $ $ 1
5 3 0 0 0.000000 0.000000 $ $ 1
6 3 1 0 0.000000 0.000000 $ $ 1
7 3 1 0 0.000000 0.000000 $ $
0 4 2 0 0.000000 0.000000 $ $ 1
1 4 0 0 0.000000 0.000000 $ $ 1
2 4 3 0 0.000000 0.000000 $ $ 1
3 4 0 0 0.000000 0.000000 $ $ 1
2 3 1 0 0.000000 0.000000 $ $ 1
3 3 1 0 0.000000 0.000000 $ $ 1
4 3 1 0 0.000000 0.000000 $ $ 1
5 3 1 0 0.000000 0.000000 $ $
0 4 0 0 0.000000 0.000000 $ $ 1
1 4 1 0 0.000000 0.000000 $ $ 1
2 4 1 0 0.000000 0.000000 $ $ 1
3 4 1 0 0.000000 0.000000 $ $ 1
4 4 1 0 0.000000 0.000000 $ $ 1
5 4 1 0 0.000000 0.000000 $ $ 1
6 4 1 0 0.000000 0.000000 $ $ 1
7 4 1 0 0.000000 0.000000 $ $
0 5 0 0 0.000000 0.000000 $ $ 1
1 5 1 0 0.000000 0.000000 $ $ 1
2 5 3 0 0.000000 0.000000 $ $ 1
3 5 0 0 0.000000 0.000000 $ $ 1
4 5 3 0 0.000000 0.000000 $ $ 1
5 5 0 0 0.000000 0.000000 $ $ 1
6 5 3 0 0.000000 0.000000 $ $ 1
0 6 0 0 0.000000 0.000000 $ $ 1
1 6 3 0 0.000000 0.000000 $ $ 1
2 6 2 0 0.000000 0.000000 $ $ 1
3 6 2 0 0.000000 0.000000 $ $ 1
4 6 2 0 0.000000 0.000000 $ $ 1
5 6 0 0 0.000000 0.000000 $ $ 1
6 6 1 0 0.000000 0.000000 $ $ 1
7 6 1 0 0.000000 0.000000 $ $
5 4 1 0 0.000000 0.000000 $ $
; End Of File
share/kumir2/courses/practicum/Fields/labirint2.fil
View file @
b6cdd175
...
...
@@ -32,7 +32,7 @@
7 4 8 0 0.000000 0.000000 $ $
8 4 1 0 0.000000 0.000000 $ $
9 4 1 0 0.000000 0.000000 $ $
0 5 8 1 0.000000 0.000000
Б $
1
0 5 8 1 0.000000 0.000000
$ Б
1
1 5 1 0 0.000000 0.000000 $ $
2 5 10 0 0.000000 0.000000 $ $
3 5 8 0 0.000000 0.000000 $ $
...
...
share/kumir2/courses/practicum/Texts/alg1.kum
View file @
b6cdd175
...
...
@@ -8,7 +8,7 @@
кон|@protected
|@protected
алг цел длин
н
а коридора|@protected
алг цел длина коридора|@protected
дано | Возможно, снизу от робота коридор|@protected
надо | Посчитано количество клеток коридора|@protected
| |и робот вернулся туда где был. |@protected
...
...
share/kumir2/courses/practicum/Texts/file_med.kum
View file @
b6cdd175
использовать Файлы|@protected
алг|@protected
нач|@protected
вывод среднее("file1.txt")|@protected
вывод среднее("file1.txt")
,нс
|@protected
кон|@protected
алг
цел
среднее(лит имя файла)|@protected
алг
вещ
среднее(лит имя файла)|@protected
дано | Имя файла со случайными числами |@protected
|от -100 до 100|@protected
надо | Среднее арифметическое чисел в файле|@protected
| | |@protected
нач|@protected
цел
сред ар=0|@protected
вещ
сред ар=0|@protected
знач:=сред ар|@protected
...
...
@@ -21,7 +21,7 @@
|#%%|@hidden
|@hidden
|@hidden
алг
цел
@проверка(лит имя файла)|@hidden
алг
вещ
@проверка(лит имя файла)|@hidden
нач|@hidden
файл а|@hidden
а:=открыть на чтение(имя файла)|@hidden
...
...
@@ -33,7 +33,7 @@
знач:=знач+число|@hidden
счет:=счет+1|@hidden
кц|@hidden
вывод div(знач,счет)
|@hidden
знач := знач/счет
|@hidden
закрыть(а)|@hidden
кон|@hidden
|@hidden
...
...
share/kumir2/courses/practicum/Texts/file_summa.kum
View file @
b6cdd175
использовать Файлы|@protected
алг|@protected
нач|@protected
вывод сумма("file1.txt")|@protected
вывод сумма("file1.txt")
,нс
|@protected
кон|@protected
алг цел сумма(лит имя файла)|@protected
дано | Имя файла со случайными числами |@protected
...
...
src/actors/robot/robotmodule.cpp
View file @
b6cdd175
...
...
@@ -748,7 +748,7 @@ namespace ActorRobot {
Items
.
clear
();
}
RoboField
::
RoboField
(
QWidget
*
parent
)
RoboField
::
RoboField
(
QWidget
*
parent
,
RobotModule
*
actor
)
:
QGraphicsScene
(
parent
)
...
...
@@ -772,7 +772,7 @@ namespace ActorRobot {
this
->
setItemIndexMethod
(
NoIndex
);
robot
=
NULL
;
markMode
=
true
;
Actor
=
actor
;
wasEdit
=
false
;
showWall
=
new
QGraphicsLineItem
(
0
,
0
,
0
,
0
);
this
->
addItem
(
showWall
);
...
...
@@ -3312,7 +3312,7 @@ namespace ActorRobot {
RoboField
*
RoboField
::
Clone
()
{
RoboField
*
clone
=
new
RoboField
(
0
);
RoboField
*
clone
=
new
RoboField
(
0
,
Actor
);
clone
->
setFieldItems
(
Items
);
clone
->
robo_x
=
robo_x
;
clone
->
robo_y
=
robo_y
;
...
...
@@ -3538,7 +3538,7 @@ RobotModule::RobotModule(ExtensionSystem::KPlugin * parent)
void
RobotModule
::
createGui
()
{
field
=
new
RoboField
(
0
);
field
=
new
RoboField
(
0
,
this
);
//field->editField();
field
->
createField
(
7
,
7
);
...
...
@@ -3610,6 +3610,7 @@ void RobotModule::copyFromPult(QString log)
// The source should be ready-to-read QIODevice like QBuffer or QFile
qDebug
()
<<
"Load env"
;
if
(
field
->
loadFromDataStream
(
source
)
!=
0
)
return
;
m_pultWidget
->
Logger
->
ClearLog
();
m_mainWidget
->
setWindowTitle
(
trUtf8
(
"Робот - "
)
+
source
->
objectName
());
startField
=
field
->
Clone
();
field
->
dropWasEdit
();
...
...
src/actors/robot/robotmodule.h
View file @
b6cdd175
...
...
@@ -69,7 +69,7 @@ namespace ActorRobot {
#define MAX_ROWS 128
class
EditLine
;
class
RobotModule
;
class
SimpleRobot
:
...
...
@@ -248,7 +248,7 @@ namespace ActorRobot {
{
Q_OBJECT
public:
RoboField
(
QWidget
*
parent
);
RoboField
(
QWidget
*
parent
,
RobotModule
*
actor
);
RoboField
*
Clone
();
~
RoboField
();
...
...
@@ -419,6 +419,7 @@ namespace ActorRobot {
QGraphicsProxyWidget
*
wAddRow
,
*
wAddCol
,
*
wRemCol
,
*
wRemRow
;
QToolButton
*
btnAddRow
,
*
btnAddCol
,
*
btnRemCol
,
*
btnRemRow
;
int
mode
;
RobotModule
*
Actor
;
};
...
...
src/actors/vodoley/vodoleymodule.cpp
View file @
b6cdd175
...
...
@@ -90,6 +90,7 @@ QString VodoleyModule::initialize(const QStringList &configurationParameters, co
// The source should be ready-to-read QIODevice like QBuffer or QFile
MainWindow
->
loadIoDevice
(
source
);
MainWindow
->
pult
->
pltLogger
()
->
ClearLog
();
MainWindow
->
reset
();
}
...
...
src/plugins/coursemanager/course_model.h
View file @
b6cdd175
...
...
@@ -554,6 +554,7 @@ public:
QDomNode
el
=
nodeById
(
index
.
internalId
(),
root
);
return
!
el
.
nextSiblingElement
(
"T"
).
isNull
();
};
QModelIndex
moveUp
(
QModelIndex
&
index
)
{
if
(
!
hasUpSib
(
index
))
return
index
;
...
...
src/plugins/coursemanager/coursemanager_plugin.cpp
View file @
b6cdd175
...
...
@@ -154,7 +154,7 @@ bool Plugin::startNewTask(QStringList isps,KumZadanie* task)
return
false
;
}
//TODO LOAD FIELDS;
QFile
*
field_data
=
new
QFile
(
task
->
field
(
isps
.
at
(
i
),
field_no
));
qDebug
()
<<
"Set field"
<<
task
->
field
(
isps
.
at
(
i
),
field_no
);
if
(
!
field_data
->
open
(
QIODevice
::
ReadOnly
))
return
false
;
...
...
src/plugins/coursemanager/task/mainwindow.cpp
View file @
b6cdd175
...
...
@@ -53,6 +53,7 @@ cursFile="";
connect
(
ui
->
actionSaveK
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
saveKurs
()));
connect
(
ui
->
actionSaveKas
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
saveKursAs
()));
connect
(
ui
->
actionRemove
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
deleteTask
()));
connect
(
ui
->
actionNext
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
nextTask
()));
// newDialog=new newKursDialog();
// connect(ui->actionNewK,SIGNAL(triggered()),this,SLOT(newKurs()));
// editDialog = new EditDialog(this);
...
...
@@ -71,6 +72,15 @@ isTeacher=false;
setupWebView
();
//ui->textBrowser->setVisible(false);
};
void
MainWindowTask
::
nextTask
()
{
if
(
ui
->
treeView
->
indexBelow
(
curTaskIdx
).
isValid
())
{
ui
->
treeView
->
setCurrentIndex
(
ui
->
treeView
->
indexBelow
(
curTaskIdx
));
// curTaskIdx=ui->treeView->currentIndex();
showText
(
ui
->
treeView
->
currentIndex
());
}
}
void
MainWindowTask
::
setupWebView
()
{
...
...
@@ -598,11 +608,22 @@ if(ioDir.isFile())
ui
->
do_task
->
setEnabled
(
false
);
ui
->
checkTask
->
setEnabled
(
true
);
onTask
=
true
;
QModelIndex
nextT
=
ui
->
treeView
->
indexBelow
(
curTaskIdx
);
if
(
nextT
.
isValid
()
&&
course
->
isTask
(
nextT
.
internalId
())
&&
nextT
.
internalId
()
>
0
&&
course
->
taskAvailable
(
nextT
.
internalId
()))
ui
->
actionNext
->
setEnabled
(
true
);
else
ui
->
actionNext
->
setEnabled
(
false
);
//ui->loadCurs->setEnabled(false);
qDebug
()
<<
"end load task"
;
if
(
progChange
.
indexOf
(
curTaskIdx
.
internalId
())
==-
1
)
progChange
.
append
(
curTaskIdx
.
internalId
());
};
void
MainWindowTask
::
checkTask
()
void
MainWindowTask
::
checkTask
()
{
qDebug
()
<<
"CheckTASK"
;
if
(
!
onTask
){
qDebug
()
<<
"!onTASK"
;
return
;};
...
...
@@ -627,13 +648,21 @@ interface->startProgram(QVariant("TODO LOAD SCRIPT"),&task);
ui
->
splitter
->
setEnabled
(
false
);
ui
->
checkTask
->
setEnabled
(
false
);
ui
->
loadCurs
->
setEnabled
(
false
);
ui
->
actionNext
->
setEnabled
(
false
);
};
void
MainWindowTask
::
unlockControls
()
{
ui
->
splitter
->
setEnabled
(
true
);
ui
->
checkTask
->
setEnabled
(
true
);
ui
->
loadCurs
->
setEnabled
(
true
);
ui
->
loadCurs
->
setEnabled
(
true
);
QModelIndex
nextT
=
ui
->
treeView
->
indexBelow
(
curTaskIdx
);
if
(
nextT
.
isValid
()
&&
course
->
isTask
(
nextT
.
internalId
())
&&
nextT
.
internalId
()
>
0
&&
course
->
taskAvailable
(
nextT
.
internalId
()))
ui
->
actionNext
->
setEnabled
(
true
);
else
ui
->
actionNext
->
setEnabled
(
false
);
};
void
MainWindowTask
::
setMark
(
int
mark
)
...
...
@@ -690,7 +719,7 @@ void MainWindowTask::saveCourse()
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
trUtf8
(
"Сохранить изменения"
),
curDir
,
open
,
trUtf8
(
"Тетради(*.work.xml);;Все файлы (*)"
)
);
QString
type
=
fileName
.
right
(
9
);
...
...
src/plugins/coursemanager/task/mainwindow.h
View file @
b6cdd175
...
...
@@ -137,7 +137,7 @@ public slots:
void
unlockControls
();
void
updateLastFiles
(
const
QString
newFile
);
void
nextTask
();
protected:
void
changeEvent
(
QEvent
*
e
);
...
...
src/plugins/coursemanager/task/mainwindow.ui
View file @
b6cdd175
...
...
@@ -67,8 +67,7 @@
<bool>
true
</bool>
</property>
</widget>
<widget
class=
"QWidget"
name=
"webView"
>
</widget>
<widget
class=
"QWidget"
name=
"webView"
native=
"true"
/>
</widget>
</item>
</layout>
...
...
@@ -83,6 +82,7 @@
<addaction
name=
"loadCurs"
/>
<addaction
name=
"do_task"
/>
<addaction
name=
"checkTask"
/>
<addaction
name=
"actionNext"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"actionup"
/>
<addaction
name=
"actionDown"
/>
...
...
@@ -226,15 +226,16 @@
<string>
Переместить вниз
</string>
</property>
</action>
<action
name=
"actionNext"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"text"
>
<string>
Следующее задание
</string>
</property>
</action>
</widget>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
<customwidgets>
<customwidget>
<class>
QWebView
</class>
<extends>
QWidget
</extends>
<header>
QtWebKit/QWebView
</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
src/tools/courseeditor/mainwindow.cpp
View file @
b6cdd175
...
...
@@ -398,23 +398,13 @@ void MainWindowTask::showText(const QModelIndex & index )
if
(
index
==
curTaskIdx
)
return
;
unLockEditFields
();
// if(onTask)
// {
// QMessageBox::StandardButton ans;
// ans = QMessageBox::question(this, trUtf8("Задание"), trUtf8("Вы хотите сменить задание?"),
// QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes);
// if ((ans == QMessageBox::Cancel)||(ans == QMessageBox::No))
// {
// qDebug()<<"Cancel";
// if(curTaskIdx.internalId()>0)ui->treeView->setCurrentIndex(curTaskIdx);
// return;};
// }
onTask
=
false
;
ui
->
checkTask
->
setEnabled
(
false
);
QString
taskText
=
course
->
getTaskText
(
index
);
//ui->textBrowser->setText(taskText);
...
...
src/tools/courseeditor/mainwindow.h
View file @
b6cdd175
...
...
@@ -99,6 +99,9 @@ private:
void
loadCourseData
(
const
QString
filename
);
void
loadMarks
(
const
QString
fileName
);
void
refreshIspsNEnv
();
Ui
::
MainWindowTask
*
ui
;
QString
curDir
;
courseModel
*
course
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment